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)/restore-src \
11 -I$(top_srcdir)/amandad-src \
12 -I$(top_srcdir)/device-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 \
24 amflush amgetconf amlabel \
27 noinst_PROGRAMS = taper_source_test
29 amlibexec_PROGRAMS = amindexd amlogroll amtrmidx \
30 amtrmlog driver dumper \
31 planner taper amcleanupdisk \
34 # Exclude scripts which depend on perl extension modules from the syntax checks
54 sbin_SCRIPTS = $(SCRIPTS_PERL) $(SCRIPTS_SHELL)
57 dest=$(sbindir) chown=amanda chmod= \
59 chown=root chmod=u+s,o-rwx \
61 dest=$(amlibexecdir) chown=amanda chmod= \
62 $(amlibexec_PROGRAMS) \
63 chown=root chmod=u+s,o-rwx \
67 dest=$(sbindir) chown=amanda chmod= \
69 dest=$(amlibexecdir) chown=amanda chmod= \
73 # Because libamanda includes routines (e.g. regex) provided by some system
74 # libraries, and because of the way libtool sets up the command line, we
75 # need to list libamanda twice here, first to override the system library
76 # routines, and second to pick up any references in the other libraries.
79 LDADD = ../common-src/libamanda.la \
81 ../device-src/libamdevice.la \
82 ../common-src/libamanda.la \
86 libamserver_la_SOURCES= amindex.c changer.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 taper_source_test_SOURCES = taper-source-test.c \
100 taper-disk-port-source.c \
101 taper-mem-port-source.c
103 taper_SOURCES = taper.c \
105 taper-file-source.c \
106 taper-port-source.c \
107 taper-disk-port-source.c \
108 taper-mem-port-source.c
110 taper_LDADD = $(LDADD) \
111 ../amandad-src/libamandad.la
113 taper_source_test_LDADD = $(LDADD) \
114 ../amandad-src/libamandad.la
116 amindexd_LDADD = $(LDADD) \
117 ../amandad-src/libamandad.la
119 # there are used for testing only:
120 TEST_PROGS = diskfile infofile
122 EXTRA_PROGRAMS = $(TEST_PROGS)
124 CLEANFILES += *.test.c
126 amindexd_CSRC = amindexd.c disk_history.c list_dir.c
127 amindexd_SOURCES = disk_history.h list_dir.h $(amindexd_CSRC)
129 amreport_SOURCES = reporter.c
131 amgetconf_SOURCES = getconf.c
133 noinst_HEADERS = amindex.h changer.h cmdline.h \
134 diskfile.h driverio.h \
135 holding.h infofile.h logfile.h \
136 tapefile.h find.h server_util.h \
137 taperscan.h taper-disk-port-source.h \
138 taper-mem-port-source.h taper-file-source.h \
139 taper-port-source.h taper-source.h
142 @ for p in $(amlibexec_PROGRAMS) $(sbin_PROGRAMS); do \
143 if [ $$p = "amindexd" ]; then \
144 s="$(amindexd_CSRC)"; \
145 elif [ $$p = "amreport" ]; then \
146 s="$(amreport_SOURCES)"; \
147 elif [ $$p = "amgetconf" ]; then \
148 s="$(getconf_SOURCES)"; \
152 f="$$s $(libamserver_la_SOURCES)"; \
153 (cd ../common-src; make listlibsrc); \
154 f="$$f "`cat ../common-src/listlibsrc.output`; \
155 (cd ../tape-src; make listlibsrc); \
156 f="$$f "`cat ../tape-src/listlibsrc.output`; \
158 $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config \
160 if [ $$? -ne 0 ]; then \
167 @ for p in $(libamserver_la_SOURCES); do \
168 listlibsrcs="$$listlibsrcs `pwd`/$$p"; \
170 echo $$listlibsrcs >listlibsrc.output
173 diskfile_SOURCES = diskfile.test.c
174 infofile_SOURCES = infofile.test.c
176 %.test.c: $(srcdir)/%.c
177 echo '#define TEST' >$@
178 echo '#include "$<"' >>$@