Imported Upstream version 2.5.1p3
[debian/amanda] / recover-src / Makefile.am
index 042feba69cd943d5a8dd4fa89e9aaa967013ad06..2dfe457161560535b710dfed0b226f3b8fef33f2 100644 (file)
@@ -1,7 +1,11 @@
 # Makefile for Amanda file recovery programs.
 
-INCLUDES =             -I$(top_srcdir)/common-src -I$(top_srcdir)/client-src \
-                       -I$(top_srcdir)/tape-src
+INCLUDES =     -I$(top_builddir)/common-src \
+               -I$(top_srcdir)/common-src   \
+               -I$(top_srcdir)/client-src
+
+LINT=@AMLINT@
+LINTFLAGS=@AMLINTFLAGS@
 
 LIB_EXTENSION = la
 
@@ -24,15 +28,27 @@ LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        $(READLINE_LIBS)
 
-amrecover_SOURCES =    amrecover.c                                     \
+amrecover_CSRC =       amrecover.c                                     \
                        display_commands.c              extract_list.c  \
-                       help.c                          set_commands.c  \
-                       uparse.y                        uscan.l
+                       help.c                          set_commands.c
+
+amrecover_SOURCES =    $(amrecover_CSRC)       uparse.y        uscan.l
 
 noinst_HEADERS =       amrecover.h uparse.h
 
 AM_YFLAGS =            -d
 
+# so that uscan.c is never generated before uparse.h
+# otherwise we might have makedepend problems
+$(srcdir)/uscan.c: $(srcdir)/uparse.h
+
+uscan.$(OBJEXT): $(srcdir)/uscan.c
+       $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -c $<
+
+uparse.$(OBJEXT): $(srcdir)/uparse.c
+       $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -c $<
+
+
 install-exec-hook:
        @list="$(sbin_PROGRAMS)"; \
        for p in $$list; do \
@@ -45,6 +61,17 @@ install-exec-hook:
                chmod o-rwx $$pa; \
        done
 
-# so that uscan.c is never generated before uparse.h
-# otherwise we might have makedepend problems
-$(srcdir)/uscan.c: $(srcdir)/uparse.h
+
+lint:
+       @f="$(amrecover_CSRC)";                                                 \
+       (cd ../common-src; make listlibsrc);                                    \
+       f="$$f "`cat ../common-src/listlibsrc.output`;                          \
+       (cd ../server-src; make listlibsrc);                                    \
+       f="$$f "`cat ../server-src/listlibsrc.output`;                          \
+       echo $(LINT) $$f;                                                       \
+       $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config $(INCLUDES) $$f;\
+       if [ $$? -ne 0 ]; then                                                  \
+           exit 1;                                                             \
+       fi;                                                                     \
+        exit 0
+