Makefile 1.1 KB

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