Imported Upstream version 3.1.0
[debian/amanda] / changer-src / Makefile.am
1 # Makefile for Amanda tape changer programs.
2
3 include $(top_srcdir)/config/automake/vars.am
4 include $(top_srcdir)/config/automake/scripts.am
5 include $(top_srcdir)/config/automake/installperms.am
6 include $(top_srcdir)/config/automake/precompile.am
7
8 INCLUDES =      -I$(top_builddir)/common-src \
9                 -I$(top_srcdir)/common-src   \
10                 -I$(top_srcdir)/device-src   \
11                 -I$(top_srcdir)/gnulib
12
13 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
14 AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
15
16 LINT=$(AMLINT)
17 LINTFLAGS=$(AMLINTFLAGS)
18
19 if WANT_CHG_SCSI_CHIO
20 CHIO_SCSI = chg-scsi-chio
21 endif
22
23 if WANT_CHG_SCSI
24 CHG_SCSI = chg-scsi
25 endif
26
27 amlibexec_PROGRAMS =    $(CHG_SCSI)
28 EXTRA_PROGRAMS =        $(CHIO_SCSI)
29
30 SCRIPTS_PERL = \
31                 chg-chio \
32                 chg-iomega \
33                 chg-rth
34
35 SCRIPTS_SHELL = \
36                 chg-manual \
37                 chg-multi \
38                 chg-mtx \
39                 chg-chs \
40                 chg-zd-mtx \
41                 chg-rait \
42                 chg-null \
43                 chg-juke \
44                 chg-mcutil \
45                 chg-disk
46
47 SCRIPTS_INCLUDE = \
48                 chg-lib.sh
49 EXTRA_DIST += chg-lib.sh.in
50
51 amlibexec_SCRIPTS = $(SCRIPTS_PERL) $(SCRIPTS_SHELL)
52 amlibexec_DATA = $(SCRIPTS_INCLUDE)
53
54 ###
55 # Because libamanda includes routines (e.g. regex) provided by some system
56 # libraries, and because of the way libtool sets up the command line, we
57 # need to list libamanda twice here, first to override the system library
58 # routines, and second to pick up any references in the other libraries.
59 ###
60
61 LDADD = ../common-src/libamanda.la \
62         ../common-src/libamanda.la \
63         ../device-src/libamdevice.la \
64         ../gnulib/libgnu.la \
65         $(READLINE_LIBS)
66
67 chg_scsi_CSRC = chg-scsi.c scsi-changer-driver.c sense.c 
68 if WANT_SCSI_AIX
69 chg_scsi_CSRC += scsi-aix.c
70 endif
71 if WANT_SCSI_HPUX_NEW
72 chg_scsi_CSRC += scsi-hpux_new.c
73 endif
74 if WANT_SCSI_IRIX
75 chg_scsi_CSRC += scsi-irix.c
76 endif
77 if WANT_SCSI_LINUX
78 chg_scsi_CSRC += scsi-linux.c
79 endif
80 if WANT_SCSI_SOLARIS
81 chg_scsi_CSRC += scsi-solaris.c
82 endif
83 if WANT_SCSI_BSD
84 chg_scsi_CSRC += scsi-bsd.c
85 endif
86 if WANT_SCSI_CAM
87 chg_scsi_CSRC += scsi-cam.c
88 endif
89
90 chg_scsi_SOURCES = libscsi.h scsi-defs.h $(chg_scsi_CSRC)
91
92 chg_scsi_chio_CSRC = chg-scsi-chio.c
93 if WANT_SCSI_HPUX
94 chg_scsi_chio_CSRC += scsi-hpux.c
95 endif
96 if WANT_SCSI_CHIO
97 chg_scsi_chio_CSRC += scsi-chio.c
98 endif
99 chg_scsi_chio_SOURCES = libscsi.h $(chg_scsi_chio_CSRC)
100
101 EXTRA_DIST += scsi-proto.c
102
103 INSTALLPERMS_exec = \
104         chown=amanda \
105         dest=$(sbindir) $(sbin_PROGRAMS) \
106         dest=$(amlibexecdir) $(amlibexec_PROGRAMS) 
107
108 INSTALLPERMS_data = \
109         chown=amanda \
110         dest=$(sbindir) $(sbin_SCRIPTS) \
111         dest=$(amlibexecdir) $(amlibexec_SCRIPTS) $(amlibexec_DATA)
112
113 lint:
114         @ for p in $(amlibexec_PROGRAMS) $(EXTRA_PROGRAMS); do                  \
115                 p=`basename $$p $(EXEEXT)`;                                     \
116                 f="$$p.c $(libamandad_la_SOURCES)";                             \
117                 (cd ../common-src; make listlibsrc);                            \
118                 f="$$f "`cat ../common-src/listlibsrc.output`;                  \
119                 (cd ../server-src; make listlibsrc);                            \
120                 f="$$f "`cat ../server-src/listlibsrc.output`;                  \
121                 echo $(LINT) $$f;                                               \
122                 $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config   \
123                     $(INCLUDES) $$f;                                            \
124                 if [ $$? -ne 0 ]; then                                          \
125                     exit 1;                                                     \
126                 fi;                                                             \
127         done;                                                                   \
128         exit 0