Imported Upstream version 3.2.0
[debian/amanda] / client-src / Makefile.am
1 # Makefile for Amanda client programs.
2
3 include $(top_srcdir)/config/automake/vars.am
4 include $(top_srcdir)/config/automake/scripts.am
5 include $(top_srcdir)/config/automake/installperms.am
6 include $(top_srcdir)/config/automake/precompile.am
7
8 INCLUDES =      -I$(top_builddir)/common-src \
9                 -I$(top_srcdir)/common-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 amlib_LTLIBRARIES =     libamclient.la
20
21 amlibexec_PROGRAMS =    noop calcsize killpgrp rundump runtar selfcheck sendbackup sendsize
22
23 amlibexec_SCRIPTS = patch-system
24
25 SCRIPTS_PERL = $(sbin_SCRIPTS)
26 SCRIPTS_SHELL = $(amlibexec_SCRIPTS)
27
28 libamclient_la_SOURCES= amandates.c             getfsent.c      \
29                         unctime.c               client_util.c
30 if WANT_SAMBA
31 libamclient_la_SOURCES += findpass.c
32 endif
33
34 libamclient_la_LDFLAGS = -release $(VERSION)
35 libamclient_la_LIBADD  = ../common-src/libamanda.la
36
37 ###
38 # Because libamanda includes routines (e.g. regex) provided by some system
39 # libraries, and because of the way libtool sets up the command line, we
40 # need to list libamanda twice here, first to override the system library
41 # routines, and second to pick up any references in the other libraries.
42 ###
43
44 LDADD = ../common-src/libamanda.la \
45         libamclient.la \
46         ../amandad-src/libamandad.la \
47         ../common-src/libamanda.la \
48         ../gnulib/libgnu.la
49
50 # these are used for testing only:
51 TEST_PROGS = getfsent
52
53 EXTRA_PROGRAMS =        $(TEST_PROGS)
54
55 CLEANFILES += *.test.c
56
57
58 sendbackup_SOURCES =    sendbackup.c            sendbackup.h      \
59                         sendbackup-dump.c       sendbackup-gnutar.c
60
61 noinst_HEADERS  =       amandates.h     getfsent.h      \
62                         findpass.h      client_util.h
63                         
64 if WANT_SETUID_CLIENT
65 INSTALLPERMS_exec = dest=$(amlibexecdir) chown=root:setuid chmod=04750 \
66                 calcsize killpgrp rundump runtar
67 endif
68
69 lint:
70         @ for p in $(amlibexec_PROGRAMS); do                                    \
71                 p=`basename $$p $(EXEEXT)`;                                     \
72                 f="$$p.c $(libamclient_la_SOURCES)";                            \
73                 (cd ../common-src; make listlibsrc);                            \
74                 f="$$f "`cat ../common-src/listlibsrc.output`;                  \
75                 echo $(LINT) $$f;                                               \
76                 $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config   \
77                     $(INCLUDES) $$f;                                            \
78                 if [ $$? -ne 0 ]; then                                          \
79                     exit 1;                                                     \
80                 fi;                                                             \
81         done;                                                                   \
82         exit 0
83
84 getfsent_SOURCES = getfsent.test.c
85
86 %.test.c: $(srcdir)/%.c
87         echo '#define TEST' >$@
88         echo '#include "$<"' >>$@