Imported Upstream version 3.2.0
[debian/amanda] / server-src / Makefile.am
1 # Makefile for Amanda server 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)/device-src   \
12                 -I$(top_srcdir)/xfer-src   \
13                 -I$(top_srcdir)/gnulib
14
15 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
16 AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
17
18 LINT=$(AMLINT)
19 LINTFLAGS=$(AMLINTFLAGS)
20
21 amlib_LTLIBRARIES =     libamserver.la
22
23 sbin_PROGRAMS =         amadmin         amcheck         \
24                         amflush         \
25                         amservice
26
27 amlibexec_PROGRAMS =    amindexd        amtrmidx        \
28                         amtrmlog        driver          dumper          \
29                         planner         amcleanupdisk   \
30                         chunker
31
32 amlibexec_SCRIPTS_PERL = \
33             amlogroll \
34             taper \
35             amcheck-device
36
37 sbin_SCRIPTS_PERL = \
38             amaddclient \
39             amoverview \
40             amserverconfig \
41             amtoc \
42             amcheckdump \
43             amcleanup \
44             amrmtape \
45             amlabel \
46             amreport \
47             amtape \
48             amvault \
49             amdump \
50             amstatus
51 if WANT_RESTORE
52 amlibexec_SCRIPTS_PERL += \
53             amidxtaped
54 sbin_SCRIPTS_PERL += \
55             amfetchdump \
56             amrestore
57 endif
58
59 sbin_SCRIPTS_SHELL = \
60             amcheckdb
61
62
63 SCRIPTS_PERL = $(sbin_SCRIPTS_PERL) $(amlibexec_SCRIPTS_PERL)
64 SCRIPTS_SHELL = $(sbin_SCRIPTS_SHELL) $(amlibexec_SCRIPTS_SHELL)
65 sbin_SCRIPTS = $(sbin_SCRIPTS_PERL) $(sbin_SCRIPTS_SHELL)
66 amlibexec_SCRIPTS = $(amlibexec_SCRIPTS_PERL) $(amlibexec_SCRIPTS_SHELL)
67
68 INSTALLPERMS_exec = \
69         dest=$(sbindir) chown=root:setuid chmod=04750 \
70                 amcheck amservice \
71         dest=$(amlibexecdir) \
72                 dumper planner
73
74 ###
75 # Because libamanda includes routines (e.g. regex) provided by some system
76 # libraries, and because of the way libtool sets up the command line, we
77 # need to list libamanda twice here, first to override the system library
78 # routines, and second to pick up any references in the other libraries.
79 ###
80
81 LDADD = ../common-src/libamanda.la   \
82         libamserver.la               \
83         ../device-src/libamdevice.la     \
84         ../common-src/libamanda.la
85
86 libamserver_la_SOURCES= amindex.c       \
87                         diskfile.c      driverio.c      cmdline.c  \
88                         holding.c       infofile.c      logfile.c       \
89                         tapefile.c      find.c          server_util.c   \
90                         xfer-source-holding.c
91
92 libamserver_la_LDFLAGS= -release $(VERSION)
93 libamserver_la_LIBADD= ../device-src/libamdevice.la \
94                        ../common-src/libamanda.la
95
96 amindexd_LDADD = $(LDADD) \
97         ../amandad-src/libamandad.la
98
99 # there are used for testing only:
100 TEST_PROGS = diskfile infofile
101
102 EXTRA_PROGRAMS =        $(TEST_PROGS)
103
104 CLEANFILES += *.test.c
105
106 amindexd_CSRC =         amindexd.c      disk_history.c  list_dir.c
107 amindexd_SOURCES =      disk_history.h  list_dir.h      $(amindexd_CSRC)
108
109 noinst_HEADERS =        amindex.h       cmdline.h       \
110                         diskfile.h      driverio.h      \
111                         holding.h       infofile.h      logfile.h       \
112                         tapefile.h      find.h          server_util.h   \
113                         xfer-server.h
114
115 lint:
116         @ for p in $(amlibexec_PROGRAMS) $(sbin_PROGRAMS); do                   \
117                 p=`basename $$p $(EXEEXT)`;                                     \
118                 if [ $$p = "amindexd" ]; then                                   \
119                         s="$(amindexd_CSRC)";                                   \
120                 else                                                            \
121                         s=$$p.c;                                                \
122                 fi;                                                             \
123                 f="$$s $(libamserver_la_SOURCES)";                              \
124                 (cd ../common-src; make listlibsrc);                            \
125                 f="$$f "`cat ../common-src/listlibsrc.output`;                  \
126                 echo $(LINT) $$f;                                               \
127                 $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config   \
128                     $(INCLUDES) $$f;                                            \
129                 if [ $$? -ne 0 ]; then                                          \
130                     exit 1;                                                     \
131                 fi;                                                             \
132         done;                                                                   \
133         exit 0
134
135 listlibsrc:
136         @ for p in $(libamserver_la_SOURCES); do                \
137                 listlibsrcs="$$listlibsrcs `pwd`/$$p";          \
138         done;                                                   \
139         echo $$listlibsrcs >listlibsrc.output
140
141
142 diskfile_SOURCES = diskfile.test.c
143 infofile_SOURCES = infofile.test.c
144
145 %.test.c: $(srcdir)/%.c
146         echo '#define TEST' >$@
147         echo '#include "$<"' >>$@