768d0bbc26184284d2a9d0ff6909a17844eec2cd
[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 LIB_EXTENSION = la
19
20 amlibexec_PROGRAMS =    amandad
21
22 libamandad_la_SOURCES= amandad_util.c
23 libamandad_la_LDFLAGS = -release $(VERSION)
24 libamandad_la_LIBADD = ../common-src/libamanda.la
25
26 noinst_HEADERS  = amandad.h
27
28 ###
29 # Because libamanda includes routines (e.g. regex) provided by some system
30 # libraries, and because of the way libtool sets up the command line, we
31 # need to list libamanda twice here, first to override the system library
32 # routines, and second to pick up any references in the other libraries.
33 ###
34
35 LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
36         libamandad.$(LIB_EXTENSION) \
37         ../common-src/libamanda.$(LIB_EXTENSION) \
38         ../gnulib/libgnu.$(LIB_EXTENSION)
39
40 INSTALLPERMS_exec = \
41         dest=$(amlibexecdir) chown=amanda \
42                 $(amlibexec_PROGRAMS)
43
44 INSTALLPERMS_data = \
45         dest=$(amlibexecdir) chown=amanda \
46                 $(amlibexec_SCRIPTS)
47
48 lint:
49         @ for p in $(amlibexec_PROGRAMS); do                                    \
50                 p=`basename $$p $(EXEEXT)`;                                     \
51                 f="$$p.c $(libamandad_la_SOURCES)";                             \
52                 (cd ../common-src; make listlibsrc);                            \
53                 f="$$f "`cat ../common-src/listlibsrc.output`;                  \
54                 (cd ../server-src; make listlibsrc);                            \
55                 f="$$f "`cat ../server-src/listlibsrc.output`;                  \
56                 echo $(LINT) $$f;                                               \
57                 $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config   \
58                     $(INCLUDES) $$f;                                            \
59                 if [ $$? -ne 0 ]; then                                          \
60                     exit 1;                                                     \
61                 fi;                                                             \
62         done;                                                                   \
63         exit 0
64