Imported Upstream version 2.5.2p1
[debian/amanda] / changer-src / Makefile.am
index 68c186ced9e66a56a31a23f7a967b9457df8b807..76328451193a830dfd94a398352539c22c891198 100644 (file)
@@ -1,6 +1,13 @@
 # Makefile for Amanda tape changer programs.
 
-INCLUDES =             -I$(top_srcdir)/common-src -I$(top_srcdir)/server-src -I$(top_srcdir)/tape-src
+INCLUDES =     -I$(top_builddir)/common-src \
+               -I$(top_srcdir)/common-src   \
+               -I$(top_srcdir)/server-src   \
+               -I$(top_srcdir)/tape-src     \
+               -I$(top_srcdir)/gnulib
+
+LINT=@AMLINT@
+LINTFLAGS=@AMLINTFLAGS@
 
 LIB_EXTENSION = la
 
@@ -19,7 +26,9 @@ libexec_SCRIPTS =     chg-manual      chg-multi       chg-mtx         \
                        chg-rth         chg-chs         chg-chio        \
                        chg-zd-mtx      chg-juke        chg-rait        \
                        chg-null        chg-mcutil      chg-disk        \
-                       chg-iomega
+                       chg-iomega  chg-lib.sh
+
+CLEANFILES = $(libexec_SCRIPTS)
 
 ###
 # Because libamanda includes routines (e.g. regex) provided by some system
@@ -31,15 +40,19 @@ libexec_SCRIPTS =   chg-manual      chg-multi       chg-mtx         \
 LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../server-src/libamserver.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION)   \
+       ../gnulib/libgnu.$(LIB_EXTENSION) \
+       $(READLINE_LIBS)
 
 SUFFIXES =             .pl .sh
 
-chg_scsi_SOURCES =     chg-scsi.c libscsi.h scsi-defs.h \
-       scsi-aix.c scsi-changer-driver.c scsi-hpux_new.c scsi-irix.c \
-       scsi-linux.c scsi-solaris.c scsi-bsd.c scsi-cam.c sense.c 
+chg_scsi_CSRC = chg-scsi.c scsi-aix.c scsi-changer-driver.c            \
+               scsi-hpux_new.c scsi-irix.c scsi-linux.c scsi-solaris.c \
+               scsi-bsd.c scsi-cam.c sense.c 
+chg_scsi_SOURCES = libscsi.h scsi-defs.h $(chg_scsi_CSRC)
 
-chg_scsi_chio_SOURCES = chg-scsi-chio.c scsi-hpux.c scsi-chio.c libscsi.h
+chg_scsi_chio_CSRC = chg-scsi-chio.c scsi-hpux.c scsi-chio.c
+chg_scsi_chio_SOURCES = libscsi.h $(chg_scsi_chio_CSRC)
 
 EXTRA_DIST = scsi-proto.c
 
@@ -69,3 +82,21 @@ install-exec-hook:
                echo chgrp $(SETUID_GROUP) $$pa; \
                chgrp $(SETUID_GROUP) $$pa; \
        done
+
+lint:
+       @ for p in $(libexec_PROGRAMS) $(EXTRA_PROGRAMS); do                    \
+               f="$$p.c $(libamandad_la_SOURCES)";                             \
+               (cd ../common-src; make listlibsrc);                            \
+               f="$$f "`cat ../common-src/listlibsrc.output`;                  \
+               (cd ../server-src; make listlibsrc);                            \
+               f="$$f "`cat ../server-src/listlibsrc.output`;                  \
+               (cd ../tape-src; make listlibsrc);                              \
+               f="$$f "`cat ../tape-src/listlibsrc.output`;                    \
+               echo $(LINT) $$f;                                               \
+               $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config        \
+                   $(INCLUDES) $$f;                                            \
+               if [ $$? -ne 0 ]; then                                          \
+                   exit 1;                                                     \
+               fi;                                                             \
+       done;                                                                   \
+        exit 0