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
10 LINTFLAGS=@AMLINTFLAGS@
12 lib_LTLIBRARIES = libamserver.la
15 sbin_PROGRAMS = amadmin amcheck amflush \
16 amgetconf amlabel amtape \
19 libexec_PROGRAMS = amindexd amlogroll amtrmidx \
20 amtrmlog driver dumper \
21 planner taper amcleanupdisk \
24 sbin_SCRIPTS = amcheckdb amcleanup amdump \
25 amoverview amrmtape amtoc \
26 amverify amverifyrun amstatus \
27 amcrypt amaespipe amcrypt-ossl \
30 libamserver_la_SOURCES= amindex.c changer.c \
31 conffile.c diskfile.c driverio.c \
32 holding.c infofile.c logfile.c \
33 tapefile.c find.c server_util.c \
36 libamserver_la_LDFLAGS= -release $(VERSION)
39 # Because libamanda includes routines (e.g. regex) provided by some system
40 # libraries, and because of the way libtool sets up the command line, we
41 # need to list libamanda twice here, first to override the system library
42 # routines, and second to pick up any references in the other libraries.
45 LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
46 libamserver.$(LIB_EXTENSION) \
47 ../tape-src/libamtape.$(LIB_EXTENSION) \
48 ../common-src/libamanda.$(LIB_EXTENSION) \
49 ../tape-src/libamtape.$(LIB_EXTENSION) \
50 ../common-src/libamanda.$(LIB_EXTENSION) \
53 amindexd_LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
54 libamserver.$(LIB_EXTENSION) \
55 ../amandad-src/libamandad.$(LIB_EXTENSION) \
56 ../tape-src/libamtape.$(LIB_EXTENSION) \
57 ../common-src/libamanda.$(LIB_EXTENSION) \
58 ../tape-src/libamtape.$(LIB_EXTENSION) \
59 ../common-src/libamanda.$(LIB_EXTENSION)
66 -test -z "$(PERL)" || $(PERL) -c $@
72 # there are used for testing only:
73 TEST_PROGS = diskfile conffile infofile
75 EXTRA_PROGRAMS = $(TEST_PROGS)
77 CLEANFILES = *.test.c $(sbin_SCRIPTS)
79 amindexd_CSRC = amindexd.c disk_history.c list_dir.c
80 amindexd_SOURCES = disk_history.h list_dir.h $(amindexd_CSRC)
82 amreport_SOURCES = reporter.c
84 amgetconf_SOURCES = getconf.c
86 noinst_HEADERS = amindex.h changer.h \
87 conffile.h diskfile.h driverio.h \
88 holding.h infofile.h logfile.h \
89 tapefile.h find.h server_util.h \
93 @list="$(sbin_PROGRAMS) $(sbin_SCRIPTS)"; \
95 pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
96 echo chown $(BINARY_OWNER) $$pa; \
97 chown $(BINARY_OWNER) $$pa; \
98 echo chgrp $(SETUID_GROUP) $$pa; \
99 chgrp $(SETUID_GROUP) $$pa; \
101 @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \
102 for p in $$list; do \
103 pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
104 echo chown $(BINARY_OWNER) $$pa; \
105 chown $(BINARY_OWNER) $$pa; \
106 echo chgrp $(SETUID_GROUP) $$pa; \
107 chgrp $(SETUID_GROUP) $$pa; \
110 for p in $$list; do \
111 if echo "$(sbin_PROGRAMS)" | grep $$p >/dev/null 2>&1; then \
112 pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
113 echo chown root $$pa; \
115 echo chmod u+s,o-rwx $$pa; \
116 chmod u+s,o-rwx $$pa; \
121 ## enterprise version will install dumper/planner suid ##
124 @list="dumper planner"; \
125 for p in $$list; do \
126 if echo "$(libexec_PROGRAMS)" | grep $$p >/dev/null 2>&1; then \
127 pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
128 echo chown root $$pa; \
130 echo chmod u+s,o-rwx $$pa; \
131 chmod u+s,o-rwx $$pa; \
137 @ for p in $(libexec_PROGRAMS) $(sbin_PROGRAMS); do \
138 if [ $$p = "amindexd" ]; then \
139 s="$(amindexd_CSRC)"; \
140 elif [ $$p = "amreport" ]; then \
141 s="$(amreport_SOURCES)"; \
142 elif [ $$p = "amgetconf" ]; then \
143 s="$(getconf_SOURCES)"; \
147 f="$$s $(libamserver_la_SOURCES)"; \
148 (cd ../common-src; make listlibsrc); \
149 f="$$f "`cat ../common-src/listlibsrc.output`; \
150 (cd ../tape-src; make listlibsrc); \
151 f="$$f "`cat ../tape-src/listlibsrc.output`; \
153 $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config \
155 if [ $$? -ne 0 ]; then \
162 @ for p in $(libamserver_la_SOURCES); do \
163 listlibsrcs="$$listlibsrcs `pwd`/$$p"; \
165 echo $$listlibsrcs >listlibsrc.output
168 diskfile_SOURCES = diskfile.test.c
169 conffile_SOURCES = conffile.test.c
170 infofile_SOURCES = infofile.test.c
172 %.test.c: $(srcdir)/%.c
173 echo '#define TEST' >$@
174 echo '#include "$<"' >>$@