Makefile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # See LICENSE file for copyright and license details.
  2. include config.mk
  3. SRC = unfy.c unfp.c
  4. OBJ = $(SRC:.c=.o)
  5. LIB = libunfy.a
  6. INC = unfy.h unfp.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. unfy.3.gz: unfy.3
  16. @gzip -k unfy.3
  17. install: $(LIB) $(INC) unfy.3.gz unfy.pc unfp.pc
  18. @echo @ install libunfy to $(PREFIX)
  19. @mkdir -p $(PREFIX)/lib
  20. @cp $(LIB) $(PREFIX)/lib/
  21. @echo @ install $(INC) to $(PREFIX)
  22. @mkdir -p $(PREFIX)/include/unfy
  23. @cp $(INC) $(PREFIX)/include/unfy/
  24. @echo @ install unfy.3 to $(PREFIX)
  25. @mkdir -p $(PREFIX)/share/man/man3
  26. @cp unfy.3.gz $(PREFIX)/share/man/man3/
  27. @mandb -q -p
  28. @echo @ install unfy.pc and unfp.pc to $(PREFIX)
  29. @printf $(PKG_STR)
  30. @mkdir -p $(PREFIX)/lib/pkgconfig
  31. @cp unfy.pc $(PREFIX)/lib/pkgconfig/
  32. @cp unfp.pc $(PREFIX)/lib/pkgconfig/
  33. uninstall:
  34. @echo @ uninstall unfy from $(PREFIX)
  35. @rm -f $(PREFIX)/lib/$(LIB)
  36. @rm -rf $(PREFIX)/include/unfy
  37. @rm -f $(PREFIX)/share/man/man3/unfy.3.gz
  38. @rm -f $(PREFIX)/lib/pkgconfig/unfy.pc
  39. @rm -f $(PREFIX)/lib/pkgconfig/unfp.pc
  40. clean:
  41. @rm -f $(LIB) $(OBJ) unfy.3.gz