1 # Makefile for Amanda server programs.
3 INCLUDES = -I$(top_builddir)/common-src \
4 -I$(top_srcdir)/common-src \
5 -I$(top_srcdir)/restore-src \
6 -I$(top_srcdir)/tape-src \
7 -I$(top_srcdir)/amandad-src \
11 LINTFLAGS=@AMLINTFLAGS@
13 lib_LTLIBRARIES = libamserver.la
16 sbin_PROGRAMS = amadmin amcheck amflush \
17 amgetconf amlabel amtape \
20 libexec_PROGRAMS = amindexd amlogroll amtrmidx \
21 amtrmlog driver dumper \
22 planner taper amcleanupdisk \
25 sbin_SCRIPTS = amcheckdb amcleanup amdump \
26 amoverview amrmtape amtoc \
27 amverify amverifyrun amstatus \
28 amcrypt amaespipe amcrypt-ossl \
31 libamserver_la_SOURCES= amindex.c changer.c \
32 diskfile.c driverio.c cmdline.c \
33 holding.c infofile.c logfile.c \
34 tapefile.c find.c server_util.c \
37 libamserver_la_LDFLAGS= -release $(VERSION)
40 # Because libamanda includes routines (e.g. regex) provided by some system
41 # libraries, and because of the way libtool sets up the command line, we
42 # need to list libamanda twice here, first to override the system library
43 # routines, and second to pick up any references in the other libraries.
46 LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
47 libamserver.$(LIB_EXTENSION) \
48 ../tape-src/libamtape.$(LIB_EXTENSION) \
49 ../common-src/libamanda.$(LIB_EXTENSION) \
50 ../tape-src/libamtape.$(LIB_EXTENSION) \
51 ../common-src/libamanda.$(LIB_EXTENSION) \
52 ../gnulib/libgnu.$(LIB_EXTENSION) \
55 amindexd_LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
56 libamserver.$(LIB_EXTENSION) \
57 ../amandad-src/libamandad.$(LIB_EXTENSION) \
58 ../tape-src/libamtape.$(LIB_EXTENSION) \
59 ../common-src/libamanda.$(LIB_EXTENSION) \
60 ../tape-src/libamtape.$(LIB_EXTENSION) \
61 ../common-src/libamanda.$(LIB_EXTENSION) \
62 ../gnulib/libgnu.$(LIB_EXTENSION)
69 -test -z "$(PERL)" || $(PERL) -c -w -W -t -T $@
75 # there are used for testing only:
76 TEST_PROGS = diskfile infofile
78 EXTRA_PROGRAMS = $(TEST_PROGS)
80 CLEANFILES = *.test.c $(sbin_SCRIPTS)
82 amindexd_CSRC = amindexd.c disk_history.c list_dir.c
83 amindexd_SOURCES = disk_history.h list_dir.h $(amindexd_CSRC)
85 amreport_SOURCES = reporter.c
87 amgetconf_SOURCES = getconf.c
89 noinst_HEADERS = amindex.h changer.h \
90 diskfile.h driverio.h \
91 holding.h infofile.h logfile.h \
92 tapefile.h find.h server_util.h \
96 @list="$(sbin_PROGRAMS) $(sbin_SCRIPTS)"; \
98 pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
99 echo chown $(BINARY_OWNER) $$pa; \
100 chown $(BINARY_OWNER) $$pa; \
101 echo chgrp $(SETUID_GROUP) $$pa; \
102 chgrp $(SETUID_GROUP) $$pa; \
104 @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \
105 for p in $$list; do \
106 pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
107 echo chown $(BINARY_OWNER) $$pa; \
108 chown $(BINARY_OWNER) $$pa; \
109 echo chgrp $(SETUID_GROUP) $$pa; \
110 chgrp $(SETUID_GROUP) $$pa; \
113 for p in $$list; do \
114 if echo "$(sbin_PROGRAMS)" | grep $$p >/dev/null 2>&1; then \
115 pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
116 echo chown root $$pa; \
118 echo chmod u+s,o-rwx $$pa; \
119 chmod u+s,o-rwx $$pa; \
124 ## enterprise version will install dumper/planner suid ##
127 @list="dumper planner"; \
128 for p in $$list; do \
129 if echo "$(libexec_PROGRAMS)" | grep $$p >/dev/null 2>&1; then \
130 pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
131 echo chown root $$pa; \
133 echo chmod u+s,o-rwx $$pa; \
134 chmod u+s,o-rwx $$pa; \
140 @ for p in $(libexec_PROGRAMS) $(sbin_PROGRAMS); do \
141 if [ $$p = "amindexd" ]; then \
142 s="$(amindexd_CSRC)"; \
143 elif [ $$p = "amreport" ]; then \
144 s="$(amreport_SOURCES)"; \
145 elif [ $$p = "amgetconf" ]; then \
146 s="$(getconf_SOURCES)"; \
150 f="$$s $(libamserver_la_SOURCES)"; \
151 (cd ../common-src; make listlibsrc); \
152 f="$$f "`cat ../common-src/listlibsrc.output`; \
153 (cd ../tape-src; make listlibsrc); \
154 f="$$f "`cat ../tape-src/listlibsrc.output`; \
156 $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config \
158 if [ $$? -ne 0 ]; then \
165 @ for p in $(libamserver_la_SOURCES); do \
166 listlibsrcs="$$listlibsrcs `pwd`/$$p"; \
168 echo $$listlibsrcs >listlibsrc.output
171 diskfile_SOURCES = diskfile.test.c
172 infofile_SOURCES = infofile.test.c
174 %.test.c: $(srcdir)/%.c
175 echo '#define TEST' >$@
176 echo '#include "$<"' >>$@