Makefile 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #-------------------------------------------------------------------------
  2. #
  3. # Makefile for src/include
  4. #
  5. # 'make install' installs whole contents of src/include.
  6. #
  7. # src/include/Makefile
  8. #
  9. #-------------------------------------------------------------------------
  10. subdir = src/include
  11. top_builddir = ../..
  12. include $(top_builddir)/src/Makefile.global
  13. all: pg_config.h pg_config_ext.h pg_config_os.h
  14. # Subdirectories containing installable headers
  15. SUBDIRS = access bootstrap catalog commands common datatype \
  16. executor fe_utils foreign jit \
  17. lib libpq mb nodes optimizer parser partitioning postmaster \
  18. regex replication rewrite \
  19. statistics storage tcop snowball snowball/libstemmer tsearch \
  20. tsearch/dicts utils port port/atomics port/win32 port/win32_msvc \
  21. port/win32_msvc/sys port/win32/arpa port/win32/netinet \
  22. port/win32/sys portability
  23. # Install all headers
  24. install: all installdirs
  25. # These headers are needed by the public headers of the interfaces.
  26. $(INSTALL_DATA) $(srcdir)/postgres_ext.h '$(DESTDIR)$(includedir)'
  27. $(INSTALL_DATA) $(srcdir)/libpq/libpq-fs.h '$(DESTDIR)$(includedir)/libpq'
  28. $(INSTALL_DATA) pg_config.h '$(DESTDIR)$(includedir)'
  29. $(INSTALL_DATA) pg_config_ext.h '$(DESTDIR)$(includedir)'
  30. $(INSTALL_DATA) pg_config_os.h '$(DESTDIR)$(includedir)'
  31. $(INSTALL_DATA) $(srcdir)/pg_config_manual.h '$(DESTDIR)$(includedir)'
  32. # These headers are needed by the not-so-public headers of the interfaces.
  33. $(INSTALL_DATA) $(srcdir)/c.h '$(DESTDIR)$(includedir_internal)'
  34. $(INSTALL_DATA) $(srcdir)/port.h '$(DESTDIR)$(includedir_internal)'
  35. $(INSTALL_DATA) $(srcdir)/postgres_fe.h '$(DESTDIR)$(includedir_internal)'
  36. $(INSTALL_DATA) $(srcdir)/libpq/pqcomm.h '$(DESTDIR)$(includedir_internal)/libpq'
  37. # These headers are needed for server-side development
  38. $(INSTALL_DATA) pg_config.h '$(DESTDIR)$(includedir_server)'
  39. $(INSTALL_DATA) pg_config_ext.h '$(DESTDIR)$(includedir_server)'
  40. $(INSTALL_DATA) pg_config_os.h '$(DESTDIR)$(includedir_server)'
  41. $(INSTALL_DATA) utils/errcodes.h '$(DESTDIR)$(includedir_server)/utils'
  42. $(INSTALL_DATA) utils/fmgroids.h '$(DESTDIR)$(includedir_server)/utils'
  43. $(INSTALL_DATA) utils/fmgrprotos.h '$(DESTDIR)$(includedir_server)/utils'
  44. # We don't use INSTALL_DATA for performance reasons --- there are a lot of files
  45. # (in fact, we have to take some pains to avoid overlength shell commands here)
  46. cp $(srcdir)/*.h '$(DESTDIR)$(includedir_server)'/
  47. for dir in $(SUBDIRS); do \
  48. cp $(srcdir)/$$dir/*.h '$(DESTDIR)$(includedir_server)'/$$dir/ || exit; \
  49. done
  50. ifeq ($(vpath_build),yes)
  51. for file in catalog/schemapg.h catalog/system_fk_info.h catalog/pg_*_d.h parser/gram.h storage/lwlocknames.h utils/probes.h; do \
  52. cp $$file '$(DESTDIR)$(includedir_server)'/$$file || exit; \
  53. done
  54. endif
  55. cd '$(DESTDIR)$(includedir_server)' && chmod $(INSTALL_DATA_MODE) *.h
  56. for dir in $(SUBDIRS); do \
  57. cd '$(DESTDIR)$(includedir_server)'/$$dir || exit; \
  58. chmod $(INSTALL_DATA_MODE) *.h || exit; \
  59. done
  60. installdirs:
  61. $(MKDIR_P) '$(DESTDIR)$(includedir)/libpq' '$(DESTDIR)$(includedir_internal)/libpq'
  62. $(MKDIR_P) $(addprefix '$(DESTDIR)$(includedir_server)'/, $(SUBDIRS))
  63. uninstall:
  64. rm -f $(addprefix '$(DESTDIR)$(includedir)'/, pg_config.h pg_config_ext.h pg_config_os.h pg_config_manual.h postgres_ext.h libpq/libpq-fs.h)
  65. rm -f $(addprefix '$(DESTDIR)$(includedir_internal)'/, c.h port.h postgres_fe.h libpq/pqcomm.h)
  66. # heuristic...
  67. rm -rf $(addprefix '$(DESTDIR)$(includedir_server)'/, $(SUBDIRS) *.h)
  68. clean:
  69. rm -f utils/fmgroids.h utils/fmgrprotos.h utils/errcodes.h utils/header-stamp
  70. rm -f parser/gram.h storage/lwlocknames.h utils/probes.h
  71. rm -f catalog/schemapg.h catalog/system_fk_info.h
  72. rm -f catalog/pg_*_d.h catalog/header-stamp
  73. distclean maintainer-clean: clean
  74. rm -f pg_config.h pg_config_ext.h pg_config_os.h stamp-h stamp-ext-h