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