Imported Upstream version 2.5.1
[debian/amanda] / changer-src / Makefile.am
index 490e987702b095353e2e68486bcd1fc1f9c01fe1..2471aa25c22da162a6166d5cdeae53c5e353f191 100644 (file)
@@ -5,6 +5,9 @@ INCLUDES =      -I$(top_builddir)/common-src \
                -I$(top_srcdir)/server-src   \
                -I$(top_srcdir)/tape-src
 
+LINT=@AMLINT@
+LINTFLAGS=@AMLINTFLAGS@
+
 LIB_EXTENSION = la
 
 if WANT_CHIO_SCSI
@@ -36,15 +39,18 @@ CLEANFILES = $(libexec_SCRIPTS)
 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
 
@@ -74,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