Imported Upstream version 2.5.1
[debian/amanda] / recover-src / Makefile.am
1 # Makefile for Amanda file recovery programs.
2
3 INCLUDES =      -I$(top_builddir)/common-src \
4                 -I$(top_srcdir)/common-src   \
5                 -I$(top_srcdir)/client-src
6
7 LINT=@AMLINT@
8 LINTFLAGS=@AMLINTFLAGS@
9
10 LIB_EXTENSION = la
11
12 sbin_PROGRAMS =         amrecover
13
14 if WANT_RUNTIME_PSEUDO_RELOC
15 AM_LDFLAGS = -Wl,-enable-runtime-pseudo-reloc
16 endif
17
18 ###
19 # Because libamanda includes routines (e.g. regex) provided by some system
20 # libraries, and because of the way libtool sets up the command line, we
21 # need to list libamanda twice here, first to override the system library
22 # routines, and second to pick up any references in the other libraries.
23 ###
24
25 LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
26         @LEXLIB@ \
27         ../client-src/libamclient.$(LIB_EXTENSION) \
28         ../common-src/libamanda.$(LIB_EXTENSION) \
29         $(READLINE_LIBS)
30
31 amrecover_CSRC =        amrecover.c                                     \
32                         display_commands.c              extract_list.c  \
33                         help.c                          set_commands.c
34
35 amrecover_SOURCES =     $(amrecover_CSRC)       uparse.y        uscan.l
36
37 noinst_HEADERS =        amrecover.h uparse.h
38
39 AM_YFLAGS =             -d
40
41 # so that uscan.c is never generated before uparse.h
42 # otherwise we might have makedepend problems
43 $(srcdir)/uscan.c: $(srcdir)/uparse.h
44
45 uscan.$(OBJEXT): $(srcdir)/uscan.c
46         $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -c $<
47
48 uparse.$(OBJEXT): $(srcdir)/uparse.c
49         $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -c $<
50
51
52 install-exec-hook:
53         @list="$(sbin_PROGRAMS)"; \
54         for p in $$list; do \
55                 pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
56                 echo chown $(BINARY_OWNER) $$pa; \
57                 chown $(BINARY_OWNER) $$pa; \
58                 echo chgrp $(SETUID_GROUP) $$pa; \
59                 chgrp $(SETUID_GROUP) $$pa; \
60                 echo chmod o-rwx $$pa; \
61                 chmod o-rwx $$pa; \
62         done
63
64
65 lint:
66         @f="$(amrecover_CSRC)";                                                 \
67         (cd ../common-src; make listlibsrc);                                    \
68         f="$$f "`cat ../common-src/listlibsrc.output`;                          \
69         (cd ../server-src; make listlibsrc);                                    \
70         f="$$f "`cat ../server-src/listlibsrc.output`;                          \
71         echo $(LINT) $$f;                                                       \
72         $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config $(INCLUDES) $$f;\
73         if [ $$? -ne 0 ]; then                                                  \
74             exit 1;                                                             \
75         fi;                                                                     \
76         exit 0
77