1 # Makefile for Amanda server programs.
4 # Yes, I really mean ../common-src. The genversion.h file ends up getting
5 # built there rather than into the source tree.
8 INCLUDES = -I$(top_srcdir)/common-src \
10 -I$(top_srcdir)/tape-src
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
23 sbin_SCRIPTS = amcheckdb amcleanup amdump \
24 amoverview amrmtape amtoc \
25 amverify amverifyrun amstatus
27 libamserver_la_SOURCES= amindex.c changer.c \
28 conffile.c diskfile.c driverio.c \
29 holding.c infofile.c logfile.c \
30 tapefile.c find.c server_util.c
32 libamserver_la_LDFLAGS= -release $(VERSION)
35 # Because libamanda includes routines (e.g. regex) provided by some system
36 # libraries, and because of the way libtool sets up the command line, we
37 # need to list libamanda twice here, first to override the system library
38 # routines, and second to pick up any references in the other libraries.
41 LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
42 libamserver.$(LIB_EXTENSION) \
43 ../tape-src/libamtape.$(LIB_EXTENSION) \
44 ../common-src/libamanda.$(LIB_EXTENSION)
51 -test -z "$(PERL)" || $(PERL) -c $@
57 # there are used for testing only:
58 TEST_PROGS = diskfile conffile infofile
60 EXTRA_PROGRAMS = $(TEST_PROGS)
62 EXTRA_DIST = dumper-krb4.c
66 amindexd_SOURCES = amindexd.c \
67 disk_history.c disk_history.h \
70 amreport_SOURCES = reporter.c
72 amgetconf_SOURCES = getconf.c
74 noinst_HEADERS = amindex.h changer.h \
75 conffile.h diskfile.h driverio.h \
76 holding.h infofile.h logfile.h \
77 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 @list="dumper planner"; \
108 for p in $$list; do \
109 if echo "$(libexec_PROGRAMS)" | grep $$p >/dev/null 2>&1; then \
110 pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
111 echo chown root $$pa; \
113 echo chmod u+s,o-rwx $$pa; \
114 chmod u+s,o-rwx $$pa; \
119 diskfile_SOURCES = diskfile.test.c
120 conffile_SOURCES = conffile.test.c
121 infofile_SOURCES = infofile.test.c
123 %.test.c: $(srcdir)/%.c
124 echo '#define TEST' >$@
125 echo '#include "$<"' >>$@