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 amlogroll amtrmidx \
28 amtrmlog driver dumper \
29 planner amcleanupdisk \
32 amlibexec_SCRIPTS_PERL = \
50 amlibexec_SCRIPTS_PERL += \
52 sbin_SCRIPTS_PERL += \
57 sbin_SCRIPTS_SHELL = \
61 SCRIPTS_PERL = $(sbin_SCRIPTS_PERL) $(amlibexec_SCRIPTS_PERL)
62 SCRIPTS_SHELL = $(sbin_SCRIPTS_SHELL) $(amlibexec_SCRIPTS_SHELL)
63 sbin_SCRIPTS = $(sbin_SCRIPTS_PERL) $(sbin_SCRIPTS_SHELL)
64 amlibexec_SCRIPTS = $(amlibexec_SCRIPTS_PERL) $(amlibexec_SCRIPTS_SHELL)
67 dest=$(sbindir) chown=amanda chmod= \
69 chown=root chmod=04750 \
71 dest=$(amlibexecdir) chown=amanda chmod= \
72 $(amlibexec_PROGRAMS) \
73 $(amlibexec_SCRIPTS) \
74 chown=root chmod=04750 \
78 dest=$(sbindir) chown=amanda chmod= \
80 dest=$(amlibexecdir) chown=amanda chmod= \
84 # Because libamanda includes routines (e.g. regex) provided by some system
85 # libraries, and because of the way libtool sets up the command line, we
86 # need to list libamanda twice here, first to override the system library
87 # routines, and second to pick up any references in the other libraries.
90 LDADD = ../common-src/libamanda.la \
92 ../device-src/libamdevice.la \
93 ../common-src/libamanda.la \
96 libamserver_la_SOURCES= amindex.c \
97 diskfile.c driverio.c cmdline.c \
98 holding.c infofile.c logfile.c \
99 tapefile.c find.c server_util.c \
100 xfer-source-holding.c
102 libamserver_la_LDFLAGS= -release $(VERSION)
103 libamserver_la_LIBADD= ../device-src/libamdevice.la \
104 ../common-src/libamanda.la
106 amindexd_LDADD = $(LDADD) \
107 ../amandad-src/libamandad.la
109 # there are used for testing only:
110 TEST_PROGS = diskfile infofile
112 EXTRA_PROGRAMS = $(TEST_PROGS)
114 CLEANFILES += *.test.c
116 amindexd_CSRC = amindexd.c disk_history.c list_dir.c
117 amindexd_SOURCES = disk_history.h list_dir.h $(amindexd_CSRC)
119 noinst_HEADERS = amindex.h cmdline.h \
120 diskfile.h driverio.h \
121 holding.h infofile.h logfile.h \
122 tapefile.h find.h server_util.h \
126 @ for p in $(amlibexec_PROGRAMS) $(sbin_PROGRAMS); do \
127 p=`basename $$p $(EXEEXT)`; \
128 if [ $$p = "amindexd" ]; then \
129 s="$(amindexd_CSRC)"; \
133 f="$$s $(libamserver_la_SOURCES)"; \
134 (cd ../common-src; make listlibsrc); \
135 f="$$f "`cat ../common-src/listlibsrc.output`; \
137 $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config \
139 if [ $$? -ne 0 ]; then \
146 @ for p in $(libamserver_la_SOURCES); do \
147 listlibsrcs="$$listlibsrcs `pwd`/$$p"; \
149 echo $$listlibsrcs >listlibsrc.output
152 diskfile_SOURCES = diskfile.test.c
153 infofile_SOURCES = infofile.test.c
155 %.test.c: $(srcdir)/%.c
156 echo '#define TEST' >$@
157 echo '#include "$<"' >>$@