Imported Debian patch 2.5.1-1
[debian/amanda] / changer-src / Makefile.am
index 68c186ced9e66a56a31a23f7a967b9457df8b807..2471aa25c22da162a6166d5cdeae53c5e353f191 100644 (file)
@@ -1,6 +1,12 @@
 # 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
+
+LINT=@AMLINT@
+LINTFLAGS=@AMLINTFLAGS@
 
 LIB_EXTENSION = la
 
@@ -21,6 +27,8 @@ libexec_SCRIPTS =     chg-manual      chg-multi       chg-mtx         \
                        chg-null        chg-mcutil      chg-disk        \
                        chg-iomega
 
+CLEANFILES = $(libexec_SCRIPTS)
+
 ###
 # Because libamanda includes routines (e.g. regex) provided by some system
 # libraries, and because of the way libtool sets up the command line, we
@@ -31,15 +39,18 @@ 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)   \
+       $(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 +80,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