1 # Makefile for Amanda server programs.
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
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
15 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
16 AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
19 LINTFLAGS=$(AMLINTFLAGS)
21 amlib_LTLIBRARIES = libamserver.la
23 sbin_PROGRAMS = amadmin amcheck \
27 amlibexec_PROGRAMS = amindexd amtrmidx \
28 amtrmlog driver dumper \
29 planner amcleanupdisk \
32 amlibexec_SCRIPTS_PERL = \
52 amlibexec_SCRIPTS_PERL += \
54 sbin_SCRIPTS_PERL += \
59 sbin_SCRIPTS_SHELL = \
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)
69 dest=$(sbindir) chown=root:setuid chmod=04750 \
71 dest=$(amlibexecdir) \
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.
81 LDADD = ../common-src/libamanda.la \
83 ../device-src/libamdevice.la \
84 ../common-src/libamanda.la
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 \
92 libamserver_la_LDFLAGS= -release $(VERSION)
93 libamserver_la_LIBADD= ../device-src/libamdevice.la \
94 ../common-src/libamanda.la
96 amindexd_LDADD = $(LDADD) \
97 ../amandad-src/libamandad.la
99 # there are used for testing only:
100 TEST_PROGS = diskfile infofile
102 EXTRA_PROGRAMS = $(TEST_PROGS)
104 CLEANFILES += *.test.c
106 amindexd_CSRC = amindexd.c disk_history.c list_dir.c
107 amindexd_SOURCES = disk_history.h list_dir.h $(amindexd_CSRC)
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 \
116 @ for p in $(amlibexec_PROGRAMS) $(sbin_PROGRAMS); do \
117 p=`basename $$p $(EXEEXT)`; \
118 if [ $$p = "amindexd" ]; then \
119 s="$(amindexd_CSRC)"; \
123 f="$$s $(libamserver_la_SOURCES)"; \
124 (cd ../common-src; make listlibsrc); \
125 f="$$f "`cat ../common-src/listlibsrc.output`; \
127 $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config \
129 if [ $$? -ne 0 ]; then \
136 @ for p in $(libamserver_la_SOURCES); do \
137 listlibsrcs="$$listlibsrcs `pwd`/$$p"; \
139 echo $$listlibsrcs >listlibsrc.output
142 diskfile_SOURCES = diskfile.test.c
143 infofile_SOURCES = infofile.test.c
145 %.test.c: $(srcdir)/%.c
146 echo '#define TEST' >$@
147 echo '#include "$<"' >>$@