6edcb32b3e954956730a5e1dfafc3ed8fae50b6a
[debian/amanda] / amandad-src / Makefile.am
1 # Makefile for Amanda client 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)/gnulib
10
11 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
12 AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
13
14 LINT=$(AMLINT)
15 LINTFLAGS=$(AMLINTFLAGS)
16
17 amlib_LTLIBRARIES =       libamandad.la
18
19 amlibexec_PROGRAMS =    amandad
20
21 libamandad_la_SOURCES= amandad_util.c
22 libamandad_la_LDFLAGS = -release $(VERSION)
23 libamandad_la_LIBADD = ../common-src/libamanda.la
24
25 noinst_HEADERS  = amandad.h
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 = ../common-src/libamanda.la \
35         libamandad.la \
36         ../common-src/libamanda.la \
37         ../gnulib/libgnu.la
38
39 INSTALLPERMS_exec = \
40         dest=$(amlibexecdir) chown=amanda \
41                 $(amlibexec_PROGRAMS)
42
43 INSTALLPERMS_data = \
44         dest=$(amlibexecdir) chown=amanda \
45                 $(amlibexec_SCRIPTS)
46
47 lint:
48         @ for p in $(amlibexec_PROGRAMS); do                                    \
49                 p=`basename $$p $(EXEEXT)`;                                     \
50                 f="$$p.c $(libamandad_la_SOURCES)";                             \
51                 (cd ../common-src; make listlibsrc);                            \
52                 f="$$f "`cat ../common-src/listlibsrc.output`;                  \
53                 (cd ../server-src; make listlibsrc);                            \
54                 f="$$f "`cat ../server-src/listlibsrc.output`;                  \
55                 echo $(LINT) $$f;                                               \
56                 $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config   \
57                     $(INCLUDES) $$f;                                            \
58                 if [ $$? -ne 0 ]; then                                          \
59                     exit 1;                                                     \
60                 fi;                                                             \
61         done;                                                                   \
62         exit 0
63