Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #
  2. # Makefile
  3. #
  4. # This library is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU Lesser General Public
  6. # License as published by the Free Software Foundation version 2.1
  7. # of the License.
  8. #
  9. # Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
  10. #
  11. ifeq ($(shell [ ! -r Makefile.opts ] && echo 1),)
  12. include Makefile.opts
  13. endif
  14. SUBDIRS := lib include doc src tests
  15. .PHONY: all clean distclean install gendoc $(SUBDIRS)
  16. all: Makefile.opts
  17. @for dir in $(SUBDIRS); do \
  18. echo "Entering $$dir" && $(MAKE) -C $$dir || exit $$?; \
  19. done
  20. clean: Makefile.opts
  21. rm -f cscope.*
  22. @for dir in $(SUBDIRS); do \
  23. echo "Entering $$dir" && $(MAKE) -C $$dir clean || exit $$?; \
  24. done
  25. distclean: clean
  26. @$(RM) -rf Makefile.opts autom4te.cache config.log config.status
  27. @for dir in $(SUBDIRS); do \
  28. echo "Entering $$dir" && $(MAKE) -C $$dir distclean || exit $$?; \
  29. done
  30. install: Makefile.opts
  31. @for dir in $(SUBDIRS); do \
  32. echo "Entering $$dir" && cd $$dir && $(MAKE) install && cd ..; \
  33. done
  34. mkdir -p $(DESTDIR)$(libdir)/pkgconfig/
  35. install -m 0644 libnl-1.pc $(DESTDIR)$(libdir)/pkgconfig/
  36. gendoc:
  37. $(MAKE) -C doc gendoc
  38. show: Makefile.opts
  39. @echo "CC: $(CC)"
  40. @echo "RM: $(RM)"
  41. @echo "CFLAGS: $(CFLAGS)"
  42. @echo "DEPFLAGS: $(DEPFLAGS)"
  43. @echo "LDFLAGS: $(LDFLAGS)"
  44. @echo "DESTDIR: $(DESTDIR)"
  45. @echo "prefix: $(prefix)"
  46. @echo "libdir: $(libdir)"
  47. @echo "includedir: $(includedir)"
  48. cscope:
  49. cscope -b -q -R -Iinclude -slib -ssrc
  50. $(SUBDIRS):
  51. cd $@ && $(MAKE)
  52. -include Makefile.rules