Makefile 967 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # See LICENSE file for copyright and license details.
  2. include config.mk
  3. SRC = front.c utilize.c examine.c
  4. OBJ = $(SRC:.c=.o)
  5. LIB = libilk.a
  6. INC = front.h utilize.h examine.h
  7. PKG_STR = "\nIf this is a local install you may need to run:\n\t\
  8. \"export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig\" \nto use this library.\n"
  9. .PHONY: all install uninstall clean
  10. all: $(LIB)
  11. $(LIB): $(OBJ)
  12. @$(AR) -rcs $@ $(OBJ)
  13. .c.o:
  14. @$(CC) $(CFLAGS) -c $<
  15. install: $(LIB) $(INC)
  16. @echo @ install libilk to $(PREFIX)
  17. @mkdir -p $(PREFIX)/lib
  18. @cp $(LIB) $(PREFIX)/lib/
  19. @echo @ install ilk.h to $(PREFIX)
  20. @mkdir -p $(PREFIX)/include/ilk
  21. @cp $(INC) $(PREFIX)/include/ilk
  22. @echo @ install ilk.pc to $(PREFIX)
  23. @printf $(PKG_STR)
  24. @mkdir -p $(PREFIX)/lib/pkgconfig
  25. @cp ilk.pc $(PREFIX)/lib/pkgconfig/
  26. uninstall:
  27. @echo @ uninstall ilk from $(PREFIX)
  28. @rm -f $(PREFIX)/lib/$(LIB)
  29. @rm -rf $(PREFIX)/include/ilk/
  30. @rm -f $(PREFIX)/lib/pkgconfig/ilk.pc
  31. clean:
  32. @rm -f $(LIB) $(OBJ)