PageRenderTime 57ms CodeModel.GetById 32ms RepoModel.GetById 0ms app.codeStats 0ms

/amanda/tags/amanda252p1/server-src/Makefile.am

#
Makefile | 176 lines | 137 code | 28 blank | 11 comment | 13 complexity | a41746e10839915355fc57de7a235675 MD5 | raw file
  1. # Makefile for Amanda server programs.
  2. INCLUDES = -I$(top_builddir)/common-src \
  3. -I$(top_srcdir)/common-src \
  4. -I$(top_srcdir)/restore-src \
  5. -I$(top_srcdir)/tape-src \
  6. -I$(top_srcdir)/amandad-src \
  7. -I$(top_srcdir)/gnulib
  8. LINT=@AMLINT@
  9. LINTFLAGS=@AMLINTFLAGS@
  10. lib_LTLIBRARIES = libamserver.la
  11. LIB_EXTENSION = la
  12. sbin_PROGRAMS = amadmin amcheck amflush \
  13. amgetconf amlabel amtape \
  14. amreport
  15. libexec_PROGRAMS = amindexd amlogroll amtrmidx \
  16. amtrmlog driver dumper \
  17. planner taper amcleanupdisk \
  18. chunker
  19. sbin_SCRIPTS = amcheckdb amcleanup amdump \
  20. amoverview amrmtape amtoc \
  21. amverify amverifyrun amstatus \
  22. amcrypt amaespipe amcrypt-ossl \
  23. amcrypt-ossl-asym
  24. libamserver_la_SOURCES= amindex.c changer.c \
  25. diskfile.c driverio.c cmdline.c \
  26. holding.c infofile.c logfile.c \
  27. tapefile.c find.c server_util.c \
  28. taperscan.c
  29. libamserver_la_LDFLAGS= -release $(VERSION)
  30. ###
  31. # Because libamanda includes routines (e.g. regex) provided by some system
  32. # libraries, and because of the way libtool sets up the command line, we
  33. # need to list libamanda twice here, first to override the system library
  34. # routines, and second to pick up any references in the other libraries.
  35. ###
  36. LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
  37. libamserver.$(LIB_EXTENSION) \
  38. ../tape-src/libamtape.$(LIB_EXTENSION) \
  39. ../common-src/libamanda.$(LIB_EXTENSION) \
  40. ../tape-src/libamtape.$(LIB_EXTENSION) \
  41. ../common-src/libamanda.$(LIB_EXTENSION) \
  42. ../gnulib/libgnu.$(LIB_EXTENSION) \
  43. $(READLINE_LIBS)
  44. amindexd_LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
  45. libamserver.$(LIB_EXTENSION) \
  46. ../amandad-src/libamandad.$(LIB_EXTENSION) \
  47. ../tape-src/libamtape.$(LIB_EXTENSION) \
  48. ../common-src/libamanda.$(LIB_EXTENSION) \
  49. ../tape-src/libamtape.$(LIB_EXTENSION) \
  50. ../common-src/libamanda.$(LIB_EXTENSION) \
  51. ../gnulib/libgnu.$(LIB_EXTENSION)
  52. SUFFIXES = .sh .pl
  53. .pl:
  54. cat $< > $@
  55. chmod a+x $@
  56. -test -z "$(PERL)" || $(PERL) -c -w -W -t -T $@
  57. .sh:
  58. cat $< > $@
  59. chmod a+x $@
  60. # there are used for testing only:
  61. TEST_PROGS = diskfile infofile
  62. EXTRA_PROGRAMS = $(TEST_PROGS)
  63. CLEANFILES = *.test.c $(sbin_SCRIPTS)
  64. amindexd_CSRC = amindexd.c disk_history.c list_dir.c
  65. amindexd_SOURCES = disk_history.h list_dir.h $(amindexd_CSRC)
  66. amreport_SOURCES = reporter.c
  67. amgetconf_SOURCES = getconf.c
  68. noinst_HEADERS = amindex.h changer.h \
  69. diskfile.h driverio.h \
  70. holding.h infofile.h logfile.h \
  71. tapefile.h find.h server_util.h \
  72. taperscan.h cmdline.h
  73. install-exec-hook:
  74. @list="$(sbin_PROGRAMS) $(sbin_SCRIPTS)"; \
  75. for p in $$list; do \
  76. pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
  77. echo chown $(BINARY_OWNER) $$pa; \
  78. chown $(BINARY_OWNER) $$pa; \
  79. echo chgrp $(SETUID_GROUP) $$pa; \
  80. chgrp $(SETUID_GROUP) $$pa; \
  81. done
  82. @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \
  83. for p in $$list; do \
  84. pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
  85. echo chown $(BINARY_OWNER) $$pa; \
  86. chown $(BINARY_OWNER) $$pa; \
  87. echo chgrp $(SETUID_GROUP) $$pa; \
  88. chgrp $(SETUID_GROUP) $$pa; \
  89. done
  90. @list="amcheck"; \
  91. for p in $$list; do \
  92. if echo "$(sbin_PROGRAMS)" | grep $$p >/dev/null 2>&1; then \
  93. pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
  94. echo chown root $$pa; \
  95. chown root $$pa; \
  96. echo chmod u+s,o-rwx $$pa; \
  97. chmod u+s,o-rwx $$pa; \
  98. else true; \
  99. fi; \
  100. done
  101. ## ##
  102. ## enterprise version will install dumper/planner suid ##
  103. ## ##
  104. @list="dumper planner"; \
  105. for p in $$list; do \
  106. if echo "$(libexec_PROGRAMS)" | grep $$p >/dev/null 2>&1; then \
  107. pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
  108. echo chown root $$pa; \
  109. chown root $$pa; \
  110. echo chmod u+s,o-rwx $$pa; \
  111. chmod u+s,o-rwx $$pa; \
  112. else true; \
  113. fi; \
  114. done
  115. lint:
  116. @ for p in $(libexec_PROGRAMS) $(sbin_PROGRAMS); do \
  117. if [ $$p = "amindexd" ]; then \
  118. s="$(amindexd_CSRC)"; \
  119. elif [ $$p = "amreport" ]; then \
  120. s="$(amreport_SOURCES)"; \
  121. elif [ $$p = "amgetconf" ]; then \
  122. s="$(getconf_SOURCES)"; \
  123. else \
  124. s=$$p.c; \
  125. fi; \
  126. f="$$s $(libamserver_la_SOURCES)"; \
  127. (cd ../common-src; make listlibsrc); \
  128. f="$$f "`cat ../common-src/listlibsrc.output`; \
  129. (cd ../tape-src; make listlibsrc); \
  130. f="$$f "`cat ../tape-src/listlibsrc.output`; \
  131. echo $(LINT) $$f; \
  132. $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config \
  133. $(INCLUDES) $$f; \
  134. if [ $$? -ne 0 ]; then \
  135. exit 1; \
  136. fi; \
  137. done; \
  138. exit 0
  139. listlibsrc:
  140. @ for p in $(libamserver_la_SOURCES); do \
  141. listlibsrcs="$$listlibsrcs `pwd`/$$p"; \
  142. done; \
  143. echo $$listlibsrcs >listlibsrc.output
  144. diskfile_SOURCES = diskfile.test.c
  145. infofile_SOURCES = infofile.test.c
  146. %.test.c: $(srcdir)/%.c
  147. echo '#define TEST' >$@
  148. echo '#include "$<"' >>$@