5face92160014e52cec0c9a4d63319b5b0c33f49
[debian/amanda] / recover-src / Makefile.am
1 # Makefile for Amanda file recovery programs.
2
3 include $(top_srcdir)/config/automake/installperms.am
4 include $(top_srcdir)/config/automake/precompile.am
5
6 INCLUDES =      -I$(top_builddir)/common-src \
7                 -I$(top_srcdir)/common-src   \
8                 -I$(top_srcdir)/client-src   \
9                 -I$(top_srcdir)/gnulib
10
11 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
12 AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
13
14 LINT=@AMLINT@
15 LINTFLAGS=@AMLINTFLAGS@
16
17 LIB_EXTENSION = la
18
19 sbin_PROGRAMS =         amrecover
20
21 ###
22 # Because libamanda includes routines (e.g. regex) provided by some system
23 # libraries, and because of the way libtool sets up the command line, we
24 # need to list libamanda twice here, first to override the system library
25 # routines, and second to pick up any references in the other libraries.
26 ###
27
28 LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
29         @LEXLIB@ \
30         $(READLINE_LIBS) \
31         ../client-src/libamclient.$(LIB_EXTENSION) \
32         ../common-src/libamanda.$(LIB_EXTENSION) \
33         ../gnulib/libgnu.$(LIB_EXTENSION) 
34
35 amrecover_CSRC =        amrecover.c                                     \
36                         display_commands.c              extract_list.c  \
37                         help.c                          set_commands.c
38
39 amrecover_SOURCES =     $(amrecover_CSRC)       uparse.y        uscan.l
40
41 noinst_HEADERS =        amrecover.h uparse.h
42
43 AM_YFLAGS =             -d
44
45 # so that uscan.c is never generated before uparse.h
46 # otherwise we might have makedepend problems
47 uscan.c: uparse.h
48
49 # these two commands are specially defined to omit $(AMANDA_WARNING_CFLAGS)
50 # since we don't want warnings for generated code
51 uscan.$(OBJEXT): uscan.c
52         $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -c $<
53
54 uparse.$(OBJEXT): uparse.c
55         $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -c $<
56
57 INSTALLPERMS_exec = \
58         dest=$(sbindir) chown=amanda chmod=o-rwx $(sbin_PROGRAMS)
59
60 lint:
61         @f="$(amrecover_CSRC)";                                                 \
62         (cd ../common-src; make listlibsrc);                                    \
63         f="$$f "`cat ../common-src/listlibsrc.output`;                          \
64         (cd ../server-src; make listlibsrc);                                    \
65         f="$$f "`cat ../server-src/listlibsrc.output`;                          \
66         echo $(LINT) $$f;                                                       \
67         $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $$f;\
68         if [ $$? -ne 0 ]; then                                                  \
69             exit 1;                                                             \
70         fi;                                                                     \
71         exit 0
72