1 # Makefile for Amanda restore programs.
3 INCLUDES = -I$(top_builddir)/common-src \
4 -I$(top_srcdir)/common-src \
5 -I$(top_srcdir)/tape-src \
6 -I$(top_srcdir)/server-src \
7 -I$(top_srcdir)/amandad-src
10 LINTFLAGS=@AMLINTFLAGS@
12 lib_LTLIBRARIES = librestore.la
15 sbin_PROGRAMS = amrestore amfetchdump
17 libexec_PROGRAMS = amidxtaped
20 # Because libamanda includes routines (e.g. regex) provided by some system
21 # libraries, and because of the way libtool sets up the command line, we
22 # need to list libamanda twice here, first to override the system library
23 # routines, and second to pick up any references in the other libraries.
26 LDADD = librestore.$(LIB_EXTENSION) \
27 ../common-src/libamanda.$(LIB_EXTENSION) \
30 amidxtaped_LDADD = $(LDADD) ../amandad-src/libamandad.$(LIB_EXTENSION)
31 amidxtaped_SOURCES = amidxtaped.c
33 amfetchdump_SOURCES = amfetchdump.c
35 librestore_la_SOURCES = restore.c
36 librestore_la_LDFLAGS = -release $(VERSION)
37 librestore_la_LIBADD = ../common-src/libamanda.$(LIB_EXTENSION) \
38 ../tape-src/libamtape.$(LIB_EXTENSION) \
39 ../server-src/libamserver.$(LIB_EXTENSION)
41 noinst_HEADERS = restore.h
44 @list="$(sbin_PROGRAMS)"; \
46 pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
47 echo chown $(BINARY_OWNER) $$pa; \
48 chown $(BINARY_OWNER) $$pa; \
49 echo chgrp $(SETUID_GROUP) $$pa; \
50 chgrp $(SETUID_GROUP) $$pa; \
52 @list="$(libexec_PROGRAMS)"; \
54 pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
55 echo chown $(BINARY_OWNER) $$pa; \
56 chown $(BINARY_OWNER) $$pa; \
57 echo chgrp $(SETUID_GROUP) $$pa; \
58 chgrp $(SETUID_GROUP) $$pa; \
62 @ for p in $(libexec_PROGRAMS) $(sbin_PROGRAMS); do \
63 f="$$p.c $(librestore_la_SOURCES)"; \
64 (cd ../common-src; make listlibsrc); \
65 f="$$f "`cat ../common-src/listlibsrc.output`; \
66 (cd ../server-src; make listlibsrc); \
67 f="$$f "`cat ../server-src/listlibsrc.output`; \
68 (cd ../tape-src; make listlibsrc); \
69 f="$$f "`cat ../tape-src/listlibsrc.output`; \
71 $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config \
73 if [ $$? -ne 0 ]; then \