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