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
8 lib_LTLIBRARIES = libamserver.la
11 sbin_PROGRAMS = amadmin amcheck amflush \
12 amgetconf amlabel amtape \
15 libexec_PROGRAMS = amindexd amlogroll amtrmidx \
16 amtrmlog driver dumper \
17 planner taper amcleanupdisk \
20 sbin_SCRIPTS = amcheckdb amcleanup amdump \
21 amoverview amrmtape amtoc \
22 amverify amverifyrun amstatus \
25 libamserver_la_SOURCES= amindex.c changer.c \
26 conffile.c diskfile.c driverio.c \
27 holding.c infofile.c logfile.c \
28 tapefile.c find.c server_util.c \
31 libamserver_la_LDFLAGS= -release $(VERSION)
34 # Because libamanda includes routines (e.g. regex) provided by some system
35 # libraries, and because of the way libtool sets up the command line, we
36 # need to list libamanda twice here, first to override the system library
37 # routines, and second to pick up any references in the other libraries.
40 LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
41 libamserver.$(LIB_EXTENSION) \
42 ../tape-src/libamtape.$(LIB_EXTENSION) \
43 ../common-src/libamanda.$(LIB_EXTENSION) \
44 ../tape-src/libamtape.$(LIB_EXTENSION) \
45 ../common-src/libamanda.$(LIB_EXTENSION)
52 -test -z "$(PERL)" || $(PERL) -c $@
58 # there are used for testing only:
59 TEST_PROGS = diskfile conffile infofile
61 EXTRA_PROGRAMS = $(TEST_PROGS)
63 CLEANFILES = *.test.c $(sbin_SCRIPTS)
65 amindexd_SOURCES = amindexd.c \
66 disk_history.c disk_history.h \
69 amreport_SOURCES = reporter.c
71 amgetconf_SOURCES = getconf.c
73 noinst_HEADERS = amindex.h changer.h \
74 conffile.h diskfile.h driverio.h \
75 holding.h infofile.h logfile.h \
76 tapefile.h find.h server_util.h \
80 @list="$(sbin_PROGRAMS) $(sbin_SCRIPTS)"; \
82 pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
83 echo chown $(BINARY_OWNER) $$pa; \
84 chown $(BINARY_OWNER) $$pa; \
85 echo chgrp $(SETUID_GROUP) $$pa; \
86 chgrp $(SETUID_GROUP) $$pa; \
88 @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \
90 pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
91 echo chown $(BINARY_OWNER) $$pa; \
92 chown $(BINARY_OWNER) $$pa; \
93 echo chgrp $(SETUID_GROUP) $$pa; \
94 chgrp $(SETUID_GROUP) $$pa; \
98 if echo "$(sbin_PROGRAMS)" | grep $$p >/dev/null 2>&1; then \
99 pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
100 echo chown root $$pa; \
102 echo chmod u+s,o-rwx $$pa; \
103 chmod u+s,o-rwx $$pa; \
107 if !WANT_SSH_SECURITY
108 @list="dumper planner"; \
109 for p in $$list; do \
110 if echo "$(libexec_PROGRAMS)" | grep $$p >/dev/null 2>&1; then \
111 pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
112 echo chown root $$pa; \
114 echo chmod u+s,o-rwx $$pa; \
115 chmod u+s,o-rwx $$pa; \
121 diskfile_SOURCES = diskfile.test.c
122 conffile_SOURCES = conffile.test.c
123 infofile_SOURCES = infofile.test.c
125 %.test.c: $(srcdir)/%.c
126 echo '#define TEST' >$@
127 echo '#include "$<"' >>$@