77c7fa86db1b5c81b2d3b9634cc911e1b81722ab
[debian/amanda] / oldrecover-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)/gnulib
11
12 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
13 AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
14
15 LINT=$(AMLINT)
16 LINTFLAGS=$(AMLINTFLAGS)
17
18 LIB_EXTENSION = la
19
20 sbin_PROGRAMS =         amoldrecover
21
22 ###
23 # Because libamanda includes routines (e.g. regex) provided by some system
24 # libraries, and because of the way libtool sets up the command line, we
25 # need to list libamanda twice here, first to override the system library
26 # routines, and second to pick up any references in the other libraries.
27 ###
28
29 LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
30         @LEXLIB@ \
31         $(READLINE_LIBS) \
32         ../client-src/libamclient.$(LIB_EXTENSION) \
33         ../common-src/libamanda.$(LIB_EXTENSION)
34
35 amoldrecover_CSRC =     amrecover.c                                     \
36                         display_commands.c              extract_list.c  \
37                         help.c                          set_commands.c
38
39 amoldrecover_SOURCES =  $(amoldrecover_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
58 INSTALLPERMS_exec = \
59         dest=$(sbindir) chown=amanda chmod=0750 $(sbin_PROGRAMS)
60
61 lint:
62         @ f="$(amoldrecover_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