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