1 # Makefile for Amanda tape library.
3 include $(top_srcdir)/config/automake/precompile.am
5 INCLUDES = -I$(top_builddir)/common-src \
6 -I$(top_srcdir)/common-src \
9 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
10 AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
13 LINTFLAGS=@AMLINTFLAGS@
15 amlib_LTLIBRARIES = libamtape.la
18 sbin_PROGRAMS= ammt amdd amtapetype
20 libamtape_la_SOURCES = output-file.c \
26 libamtape_la_LDFLAGS = -release $(VERSION)
27 libamtape_la_LIBADD = ../common-src/libamanda.$(LIB_EXTENSION)
30 # Because libamanda includes routines (e.g. regex) provided by some system
31 # libraries, and because of the way libtool sets up the command line, we
32 # need to list libamanda twice here, first to override the system library
33 # routines, and second to pick up any references in the other libraries.
36 LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
37 libamtape.$(LIB_EXTENSION) \
38 ../common-src/libamanda.$(LIB_EXTENSION)
40 # used for testing only
44 EXTRA_PROGRAMS = $(TEST_PROGS)
48 amtapetype_SOURCES = tapetype.c
58 dest=$(sbindir) chown=amanda $(sbin_PROGRAMS) $(sbin_SCRIPTS) \
59 dest=$(amlibexecdir) chown=amanda $(amlibexec_PROGRAMS) $(amlibexec_SCRIPTS)
61 amtapeio_SOURCES = amtapeio.test.c
62 amtapeio_LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
63 libamtape.$(LIB_EXTENSION) \
64 ../common-src/libamanda.$(LIB_EXTENSION)
66 amtapeio.test.c: $(srcdir)/tapeio.c
67 echo '#define TEST' >$@
68 echo '#include "$<"' >>$@
70 %.test.c: $(srcdir)/%.c
71 echo '#define TEST' >$@
72 echo '#include "$<"' >>$@
75 @echo "Use amtapetype instead"
78 @ for p in $(sbin_PROGRAMS); do \
79 if [ $$p = "amtapetype" ]; then \
80 s="$(amtapetype_SOURCES)"; \
84 f="$$s $(libamandad_la_SOURCES)"; \
85 f="$$f "`(cd ../common-src; make listlibsrc 2>&1 > /dev/null)`; \
86 (cd ../common-src; make listlibsrc); \
87 f="$$f "`cat ../common-src/listlibsrc.output`; \
89 $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config \
91 if [ $$? -ne 0 ]; then \
98 @ for p in $(libamtape_la_SOURCES); do \
99 listlibsrcs="$$listlibsrcs `pwd`/$$p"; \
101 echo $$listlibsrcs > listlibsrc.output