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