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