1# Makefile for Amanda client programs.
2
3include $(top_srcdir)/config/automake/vars.am
4include $(top_srcdir)/config/automake/scripts.am
5include $(top_srcdir)/config/automake/installperms.am
6include $(top_srcdir)/config/automake/precompile.am
7
8INCLUDES =	-I$(top_builddir)/common-src \
9		-I$(top_srcdir)/common-src   \
10		-I$(top_srcdir)/amandad-src  \
11		-I$(top_srcdir)/gnulib
12
13AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
14AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS)
15
16LINT=$(AMLINT)
17LINTFLAGS=$(AMLINTFLAGS)
18
19amlib_LTLIBRARIES =	libamclient.la
20
21amlibexec_PROGRAMS =	noop calcsize killpgrp rundump runtar selfcheck sendbackup sendsize
22
23amlibexec_SCRIPTS_SHELL = patch-system
24
25sbin_SCRIPTS_PERL = amdump_client
26
27SCRIPTS_PERL = $(sbin_SCRIPTS_PERL)
28SCRIPTS_SHELL = $(amlibexec_SCRIPTS_SHELL)
29sbin_SCRIPTS = $(sbin_SCRIPTS_PERL)
30amlibexec_SCRIPTS = $(amlibexec_SCRIPTS_SHELL)
31
32libamclient_la_SOURCES=	amandates.c		getfsent.c	\
33			unctime.c		client_util.c
34if WANT_SAMBA
35libamclient_la_SOURCES += findpass.c
36endif
37
38libamclient_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
39libamclient_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
48LDADD = ../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:
55TEST_PROGS = getfsent
56
57EXTRA_PROGRAMS =	$(TEST_PROGS)
58
59CLEANFILES += *.test.c
60
61
62sendbackup_SOURCES = 	sendbackup.c		sendbackup.h	  \
63			sendbackup-dump.c	sendbackup-gnutar.c
64
65noinst_HEADERS	= 	amandates.h	getfsent.h	\
66			findpass.h	client_util.h
67
68if WANT_SETUID_CLIENT
69INSTALLPERMS_exec = dest=$(amlibexecdir) chown=root:setuid chmod=04750 \
70		calcsize killpgrp rundump runtar
71endif
72
73lint:
74	@ for p in $(amlibexec_PROGRAMS); do					\
75		p=`basename $$p $(EXEEXT)`;					\
76		f="$$p.c $(libamclient_la_SOURCES)";				\
77		(cd ../common-src; make listlibsrc);				\
78		f="$$f "`cat ../common-src/listlibsrc.output`;			\
79		echo $(LINT) $$f;						\
80		$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config	\
81		    $(INCLUDES) $$f;						\
82		if [ $$? -ne 0 ]; then						\
83		    exit 1;							\
84		fi;								\
85	done;									\
86        exit 0
87
88getfsent_SOURCES = getfsent.test.c
89
90%.test.c: $(srcdir)/%.c
91	echo '#define TEST' >$@
92	echo '#include "$<"' >>$@
93