Imported Upstream version 2.6.1p2
[debian/amanda] / restore-src / Makefile.am
1 # Makefile for Amanda restore 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)/device-src   \
10                 -I$(top_srcdir)/server-src   \
11                 -I$(top_srcdir)/amandad-src  \
12                 -I$(top_srcdir)/gnulib
13
14 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
15 AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
16
17 LINT=$(AMLINT)
18 LINTFLAGS=$(AMLINTFLAGS)
19
20 amlib_LTLIBRARIES =     librestore.la
21 LIB_EXTENSION = la
22
23 sbin_PROGRAMS =         amrestore amfetchdump
24
25 amlibexec_PROGRAMS =    amidxtaped
26
27 ###
28 # Because libamanda includes routines (e.g. regex) provided by some system
29 # libraries, and because of the way libtool sets up the command line, we
30 # need to list libamanda twice here, first to override the system library
31 # routines, and second to pick up any references in the other libraries.
32 ###
33
34 LDADD = librestore.$(LIB_EXTENSION)              \
35       ../common-src/libamanda.$(LIB_EXTENSION) \
36       $(READLINE_LIBS)
37
38 amidxtaped_LDADD = $(LDADD) \
39                    ../gnulib/libgnu.$(LIB_EXTENSION) \
40                    ../amandad-src/libamandad.$(LIB_EXTENSION)
41
42 amidxtaped_SOURCES =    amidxtaped.c
43
44 amfetchdump_SOURCES =   amfetchdump.c
45
46 librestore_la_SOURCES   =       restore.c
47 librestore_la_LDFLAGS   =       -release $(VERSION)
48 librestore_la_LIBADD    =       ../common-src/libamanda.$(LIB_EXTENSION) \
49                                 ../server-src/libamserver.$(LIB_EXTENSION) \
50                                 ../device-src/libamdevice.$(LIB_EXTENSION)
51
52 noinst_HEADERS = restore.h
53
54 INSTALLPERMS_exec = \
55         dest=$(sbindir) chown=amanda $(sbin_PROGRAMS) \
56         dest=$(amlibexecdir) chown=amanda $(amlibexec_PROGRAMS)
57
58 lint:
59         @ for p in $(amlibexec_PROGRAMS) $(sbin_PROGRAMS); do                   \
60                 p=`basename $$p $(EXEEXT)`;                                     \
61                 f="$$p.c $(librestore_la_SOURCES)";                             \
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   \
68                     $(INCLUDES) $$f;                                            \
69                 if [ $$? -ne 0 ]; then                                          \
70                     exit 1;                                                     \
71                 fi;                                                             \
72         done;                                                                   \
73         exit 0
74