1 # Makefile for Amanda tape library.
3 INCLUDES = -I$(top_builddir)/common-src \
4 -I$(top_srcdir)/common-src \
8 LINTFLAGS=@AMLINTFLAGS@
10 lib_LTLIBRARIES = libamtape.la
13 sbin_PROGRAMS= ammt amdd amtapetype
15 libamtape_la_SOURCES = output-file.c \
21 libamtape_la_LDFLAGS = -release $(VERSION)
24 # Because libamanda includes routines (e.g. regex) provided by some system
25 # libraries, and because of the way libtool sets up the command line, we
26 # need to list libamanda twice here, first to override the system library
27 # routines, and second to pick up any references in the other libraries.
30 LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
31 libamtape.$(LIB_EXTENSION) \
32 ../common-src/libamanda.$(LIB_EXTENSION)
34 # used for testing only
38 EXTRA_PROGRAMS = $(TEST_PROGS)
42 amtapetype_SOURCES = tapetype.c
52 @list="$(sbin_PROGRAMS) $(sbin_SCRIPTS)"; \
54 pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
55 echo chown $(BINARY_OWNER) $$pa; \
56 chown $(BINARY_OWNER) $$pa; \
57 echo chgrp $(SETUID_GROUP) $$pa; \
58 chgrp $(SETUID_GROUP) $$pa; \
60 @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \
62 pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
63 echo chown $(BINARY_OWNER) $$pa; \
64 chown $(BINARY_OWNER) $$pa; \
65 echo chgrp $(SETUID_GROUP) $$pa; \
66 chgrp $(SETUID_GROUP) $$pa; \
69 amtapeio_SOURCES = amtapeio.test.c
70 amtapeio_LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
71 libamtape.$(LIB_EXTENSION) \
72 ../common-src/libamanda.$(LIB_EXTENSION)
74 amtapeio.test.c: $(srcdir)/tapeio.c
75 echo '#define TEST' >$@
76 echo '#include "$<"' >>$@
78 %.test.c: $(srcdir)/%.c
79 echo '#define TEST' >$@
80 echo '#include "$<"' >>$@
83 @echo "Use amtapetype instead"
86 @ for p in $(sbin_PROGRAMS); do \
87 if [ $$p = "amtapetype" ]; then \
88 s="$(amtapetype_SOURCES)"; \
92 f="$$s $(libamandad_la_SOURCES)"; \
93 f="$$f "`(cd ../common-src; make listlibsrc 2>&1 > /dev/null)`; \
94 (cd ../common-src; make listlibsrc); \
95 f="$$f "`cat ../common-src/listlibsrc.output`; \
97 $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config \
99 if [ $$? -ne 0 ]; then \
106 @ for p in $(libamtape_la_SOURCES); do \
107 listlibsrcs="$$listlibsrcs `pwd`/$$p"; \
109 echo $$listlibsrcs > listlibsrc.output