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