Makefile 574 B

12345678910111213141516171819202122232425262728293031323334
  1. # See LICENSE file for copyright and license details.
  2. include config.mk
  3. SRC = uch.c
  4. OBJ = $(SRC:.c=.o)
  5. LIB = libuch.a
  6. INC = uch.h
  7. all: $(LIB)
  8. $(LIB): $(OBJ)
  9. @$(AR) -rcs $@ $(OBJ)
  10. .c.o:
  11. @$(CC) $(CFLAGS) -c $<
  12. install: $(LIB) $(INC)
  13. @echo @ install libuch to $(PREFIX)
  14. @mkdir -p $(PREFIX)/lib
  15. @cp $(LIB) $(PREFIX)/lib/$(LIB)
  16. @echo @ install uch.h to $(PREFIX)
  17. @mkdir -p $(PREFIX)/include/
  18. @cp $(INC) $(PREFIX)/include/
  19. uninstall:
  20. @echo @ uninstall uch from $(PREFIX)
  21. @rm -f $(PREFIX)/lib/$(LIB)
  22. @rm -f $(PREFIX)/include/$(INC)
  23. clean:
  24. @rm -f $(LIB) $(OBJ)