d37ef2df72bf8a3fa6ec5f7a1bf5a1a6c4611b00
[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 CHECK_PERL = \
31                 chg-glue \
32                 chg-chio \
33                 chg-iomega \
34                 chg-rth
35
36 SCRIPTS_PERL = $(CHECK_PERL)
37
38 SCRIPTS_SHELL = \
39                 chg-manual \
40                 chg-multi \
41                 chg-mtx \
42                 chg-chs \
43                 chg-zd-mtx \
44                 chg-juke \
45                 chg-rait \
46                 chg-null \
47                 chg-mcutil \
48                 chg-disk
49
50 SCRIPTS_INCLUDE = \
51                 chg-lib.sh
52 EXTRA_DIST += chg-lib.sh.in
53
54 amlibexec_SCRIPTS = $(SCRIPTS_PERL) $(SCRIPTS_SHELL)
55 amlibexec_DATA = $(SCRIPTS_INCLUDE)
56
57 ###
58 # Because libamanda includes routines (e.g. regex) provided by some system
59 # libraries, and because of the way libtool sets up the command line, we
60 # need to list libamanda twice here, first to override the system library
61 # routines, and second to pick up any references in the other libraries.
62 ###
63
64 LDADD = ../common-src/libamanda.la \
65         ../common-src/libamanda.la \
66         ../device-src/libamdevice.la \
67         ../gnulib/libgnu.la \
68         $(READLINE_LIBS)
69
70 chg_scsi_CSRC = chg-scsi.c scsi-changer-driver.c sense.c 
71 if WANT_SCSI_AIX
72 chg_scsi_CSRC += scsi-aix.c
73 endif
74 if WANT_SCSI_HPUX_NEW
75 chg_scsi_CSRC += scsi-hpux_new.c
76 endif
77 if WANT_SCSI_IRIX
78 chg_scsi_CSRC += scsi-irix.c
79 endif
80 if WANT_SCSI_LINUX
81 chg_scsi_CSRC += scsi-linux.c
82 endif
83 if WANT_SCSI_SOLARIS
84 chg_scsi_CSRC += scsi-solaris.c
85 endif
86 if WANT_SCSI_BSD
87 chg_scsi_CSRC += scsi-bsd.c
88 endif
89 if WANT_SCSI_CAM
90 chg_scsi_CSRC += scsi-cam.c
91 endif
92
93 chg_scsi_SOURCES = libscsi.h scsi-defs.h $(chg_scsi_CSRC)
94
95 chg_scsi_chio_CSRC = chg-scsi-chio.c
96 if WANT_SCSI_HPUX
97 chg_scsi_chio_CSRC += scsi-hpux.c
98 endif
99 if WANT_SCSI_CHIO
100 chg_scsi_chio_CSRC += scsi-chio.c
101 endif
102 chg_scsi_chio_SOURCES = libscsi.h $(chg_scsi_chio_CSRC)
103
104 EXTRA_DIST += scsi-proto.c
105
106 INSTALLPERMS_exec = \
107         chown=amanda \
108         dest=$(sbindir) $(sbin_PROGRAMS) \
109         dest=$(amlibexecdir) $(amlibexec_PROGRAMS) 
110
111 INSTALLPERMS_data = \
112         chown=amanda \
113         dest=$(sbindir) $(sbin_SCRIPTS) \
114         dest=$(amlibexecdir) $(amlibexec_SCRIPTS) $(amlibexec_DATA)
115
116 lint:
117         @ for p in $(amlibexec_PROGRAMS) $(EXTRA_PROGRAMS); do                  \
118                 p=`basename $$p $(EXEEXT)`;                                     \
119                 f="$$p.c $(libamandad_la_SOURCES)";                             \
120                 (cd ../common-src; make listlibsrc);                            \
121                 f="$$f "`cat ../common-src/listlibsrc.output`;                  \
122                 (cd ../server-src; make listlibsrc);                            \
123                 f="$$f "`cat ../server-src/listlibsrc.output`;                  \
124                 echo $(LINT) $$f;                                               \
125                 $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config   \
126                     $(INCLUDES) $$f;                                            \
127                 if [ $$? -ne 0 ]; then                                          \
128                     exit 1;                                                     \
129                 fi;                                                             \
130         done;                                                                   \
131         exit 0