PageRenderTime 22ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Makefile | 109 lines | 80 code | 21 blank | 8 comment | 6 complexity | 77ea3fd7bf920ae36c4e8bda21b05c68 MD5 | raw file
  1. # Makefile for Amanda tape library.
  2. INCLUDES = -I$(top_builddir)/common-src \
  3. -I$(top_srcdir)/common-src \
  4. -I$(top_srcdir)/gnulib
  5. LINT=@AMLINT@
  6. LINTFLAGS=@AMLINTFLAGS@
  7. lib_LTLIBRARIES = libamtape.la
  8. LIB_EXTENSION = la
  9. sbin_PROGRAMS= ammt amdd amtapetype
  10. libamtape_la_SOURCES = output-file.c \
  11. output-null.c \
  12. output-rait.c \
  13. output-tape.c \
  14. tapeio.c
  15. libamtape_la_LDFLAGS = -release $(VERSION)
  16. ###
  17. # Because libamanda includes routines (e.g. regex) provided by some system
  18. # libraries, and because of the way libtool sets up the command line, we
  19. # need to list libamanda twice here, first to override the system library
  20. # routines, and second to pick up any references in the other libraries.
  21. ###
  22. LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
  23. libamtape.$(LIB_EXTENSION) \
  24. ../common-src/libamanda.$(LIB_EXTENSION)
  25. # used for testing only
  26. TEST_PROGS = amtapeio
  27. EXTRA_PROGRAMS = $(TEST_PROGS)
  28. CLEANFILES = *.test.c
  29. amtapetype_SOURCES = tapetype.c
  30. noinst_HEADERS = \
  31. output-file.h \
  32. output-null.h \
  33. output-rait.h \
  34. output-tape.h \
  35. tapeio.h
  36. install-exec-hook:
  37. @list="$(sbin_PROGRAMS) $(sbin_SCRIPTS)"; \
  38. for p in $$list; do \
  39. pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
  40. echo chown $(BINARY_OWNER) $$pa; \
  41. chown $(BINARY_OWNER) $$pa; \
  42. echo chgrp $(SETUID_GROUP) $$pa; \
  43. chgrp $(SETUID_GROUP) $$pa; \
  44. done
  45. @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \
  46. for p in $$list; do \
  47. pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
  48. echo chown $(BINARY_OWNER) $$pa; \
  49. chown $(BINARY_OWNER) $$pa; \
  50. echo chgrp $(SETUID_GROUP) $$pa; \
  51. chgrp $(SETUID_GROUP) $$pa; \
  52. done
  53. amtapeio_SOURCES = amtapeio.test.c
  54. amtapeio_LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
  55. libamtape.$(LIB_EXTENSION) \
  56. ../common-src/libamanda.$(LIB_EXTENSION)
  57. amtapeio.test.c: $(srcdir)/tapeio.c
  58. echo '#define TEST' >$@
  59. echo '#include "$<"' >>$@
  60. %.test.c: $(srcdir)/%.c
  61. echo '#define TEST' >$@
  62. echo '#include "$<"' >>$@
  63. tapetype:
  64. @echo "Use amtapetype instead"
  65. lint:
  66. @ for p in $(sbin_PROGRAMS); do \
  67. if [ $$p = "amtapetype" ]; then \
  68. s="$(amtapetype_SOURCES)"; \
  69. else \
  70. s=$$p.c; \
  71. fi; \
  72. f="$$s $(libamandad_la_SOURCES)"; \
  73. f="$$f "`(cd ../common-src; make listlibsrc 2>&1 > /dev/null)`; \
  74. (cd ../common-src; make listlibsrc); \
  75. f="$$f "`cat ../common-src/listlibsrc.output`; \
  76. echo $(LINT) $$f; \
  77. $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config \
  78. $(INCLUDES) $$f; \
  79. if [ $$? -ne 0 ]; then \
  80. exit 1; \
  81. fi; \
  82. done; \
  83. exit 0
  84. listlibsrc:
  85. @ for p in $(libamtape_la_SOURCES); do \
  86. listlibsrcs="$$listlibsrcs `pwd`/$$p"; \
  87. done; \
  88. echo $$listlibsrcs > listlibsrc.output