Makefile 1.1 KB

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