2 ## Prepare for SWIGging
5 include $(top_srcdir)/config/automake/vars.am
6 include $(top_srcdir)/config/automake/scripts.am
8 # add the SWIG symbol to avoid conflicts with perl definitions.
9 # $AMANDA_WARNING_CFLAGS is omitted because SWIG-generated files tend
13 # Appropriate INCLUDES depends on which components (server or client) are
16 -I$(top_builddir)/common-src \
17 -I$(top_srcdir)/common-src \
18 -I$(top_srcdir)/amandad-src \
19 -I$(top_srcdir)/amar-src \
20 -I$(top_srcdir)/xfer-src \
21 -I$(top_srcdir)/perl/amglue \
22 -I$(top_srcdir)/gnulib \
26 INCLUDES += -I$(top_srcdir)/device-src \
27 -I$(top_srcdir)/server-src
31 INCLUDES += -I$(top_srcdir)/client-src
35 INCLUDES += -I$(top_srcdir)/restore-src
39 INCLUDES += -I$(top_srcdir)/recover-src
42 # (amplot has a conditional, but doesn't have any header files)
45 ## libamglue -- helper functions for gluing amanda to perl
48 amlib_LTLIBRARIES = libamglue.la
49 libamglue_la_SOURCES = \
54 libamglue_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
55 EXTRA_DIST += $(libamglue_la_SOURCES)
61 # This isn't a very robust implementation, as it's only meant to make the HTML
62 # available online as part of the automated compilation process. It assumes
63 # that all perl modules were built (not just server or client), and that the
64 # build directory does not contain any "junk".
66 # HTML_SOURCE_FILES should contain the .pm files from which the HTML should
67 # be geneated. This is just the concatenation of foo_DATA for all $(foodir)
68 # into which perl modules are installed.
70 html: make_html amperl.css $(HTML_SOURCE_FILES)
71 rm -rf html-tmp/ && mkdir html-tmp/
72 cp amperl.css html-tmp/
73 $(PERL) make_html html-tmp/ $(HTML_SOURCE_FILES)
74 cd html-tmp/ && tar -zcf $(abs_builddir)/html.tar.gz .
77 ## SWIG-generated packages
80 # Tell libtool to not bother versioning the libs we build, since perl won't
81 # pay attention to such things, anyway.
82 PERL_EXT_LDFLAGS = -avoid-version
84 # And add any flags the user has requested; on FreeBSD, this pulls in the
86 PERL_EXT_LDFLAGS += $(PERLEXTLIBS)
88 # list our SWIG libraries.
89 AMGLUE_SWG = amglue/amglue.swg \
91 amglue/constants.swg \
92 amglue/dumpspecs.swg \
96 EXTRA_DIST += $(AMGLUE_SWG)
99 # -perl5 -proxy: generate perl code, with proxy (shadow) classes
100 # -DSWIG_TYPE_TABLE: the name for the global type table; customized
101 # to minimize type collisions with other SWIG-generated modules
102 # -I$(srcdir) use include files relative to this directory
103 SWIG_OPTIONS=-perl5 -proxy -DSWIG_TYPE_TABLE=SWIG_TYPES_Amanda -I$(srcdir)
105 # Suffix rules. These are parallel-build compatible, but may cause
106 # strange behavior if there are other .c files in this directory. The
107 # 'rm -f $@' is needed because SWIG sometimes fails to remove its output
108 # file in the event of a syntax error. .i files are pre-processor output;
109 # they are only used during development.
110 %.c : %.swg $(AMGLUE_SWG)
111 $(mkdir_p) `dirname $@`
112 $(SWIG) $(SWIG_OPTIONS) -o $@ $(top_srcdir)/perl/$< || { rm -f $@; false; }
114 @echo "$@ was produced as a side-effect of creating $<"
115 %.i : %.swg $(AMGLUE_SWG)
116 $(SWIG) $(SWIG_OPTIONS) -E $(top_srcdir)/perl/$< >$@
118 Amandadir=$(amperldir)/Amanda
120 HTML_SOURCE_FILES += $(Amanda_DATA)
122 # PACKAGE: Amanda::Archive
123 libArchivedir = $(amperldir)/auto/Amanda/Archive
124 libArchive_LTLIBRARIES = libArchive.la
125 libArchive_la_SOURCES = Amanda/Archive.c $(AMGLUE_SWG)
126 libArchive_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
127 libArchive_la_LIBADD = libamglue.la \
128 $(top_builddir)/amar-src/libamar.la \
129 $(top_builddir)/common-src/libamanda.la
130 Amanda_DATA += Amanda/Archive.pm
131 EXTRA_DIST += Amanda/Archive.swg Amanda/Archive.pm
132 MAINTAINERCLEANFILES += Amanda/Archive.c Amanda/Archive.pm
135 # PACKAGE: Amanda::Device
136 libDevicedir = $(amperldir)/auto/Amanda/Device
137 libDevice_LTLIBRARIES = libDevice.la
138 libDevice_la_SOURCES = Amanda/Device.c $(AMGLUE_SWG)
139 libDevice_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
140 libDevice_la_LIBADD = libamglue.la \
141 $(top_builddir)/device-src/libamdevice.la \
142 $(top_builddir)/common-src/libamanda.la
143 Amanda_DATA += Amanda/Device.pm
144 MAINTAINERCLEANFILES += Amanda/Device.c Amanda/Device.pm
146 EXTRA_DIST += Amanda/Device.swg Amanda/Device.pm
149 # PACKAGE: Amanda::Logfile
150 libLogfiledir = $(amperldir)/auto/Amanda/Logfile
151 libLogfile_LTLIBRARIES = libLogfile.la
152 libLogfile_la_SOURCES = Amanda/Logfile.c $(AMGLUE_SWG)
153 libLogfile_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
154 libLogfile_la_LIBADD = libamglue.la \
155 $(top_builddir)/server-src/libamserver.la \
156 $(top_builddir)/common-src/libamanda.la
157 Amanda_DATA += Amanda/Logfile.pm
158 MAINTAINERCLEANFILES += Amanda/Logfile.c Amanda/Logfile.pm
160 EXTRA_DIST += Amanda/Logfile.swg Amanda/Logfile.pm
163 # PACKAGE: Amanda::Cmdline
164 libCmdlinedir = $(amperldir)/auto/Amanda/Cmdline
165 libCmdline_LTLIBRARIES = libCmdline.la
166 libCmdline_la_SOURCES = Amanda/Cmdline.c $(AMGLUE_SWG)
167 libCmdline_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
168 libCmdline_la_LIBADD = libamglue.la \
169 $(top_builddir)/server-src/libamserver.la \
170 $(top_builddir)/common-src/libamanda.la
171 Amanda_DATA += Amanda/Cmdline.pm
172 MAINTAINERCLEANFILES += Amanda/Cmdline.c Amanda/Cmdline.pm
174 EXTRA_DIST += Amanda/Cmdline.swg Amanda/Cmdline.pm
177 # PACKAGE: Amanda::Tapelist
178 libTapelistdir = $(amperldir)/auto/Amanda/Tapelist
179 libTapelist_LTLIBRARIES = libTapelist.la
180 libTapelist_la_SOURCES = Amanda/Tapelist.c $(AMGLUE_SWG)
181 libTapelist_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
182 libTapelist_la_LIBADD = libamglue.la \
183 $(top_builddir)/server-src/libamserver.la \
184 $(top_builddir)/common-src/libamanda.la
185 Amanda_DATA += Amanda/Tapelist.pm
186 MAINTAINERCLEANFILES += Amanda/Tapelist.c Amanda/Tapelist.pm
188 EXTRA_DIST += Amanda/Tapelist.swg Amanda/Tapelist.pm
191 # PACKAGE: Amanda::Changer
192 Amanda_DATA += Amanda/Changer.pm
194 EXTRA_DIST += Amanda/Changer.pm
197 # PACKAGE: Amanda::Changer::*
198 AmandaChangerdir = $(amperldir)/Amanda/Changer
199 AmandaChanger_DATA = \
200 Amanda/Changer/disk.pm \
201 Amanda/Changer/compat.pm \
202 Amanda/Changer/single.pm
203 HTML_SOURCE_FILES += $(AmandaChanger_DATA)
205 EXTRA_DIST += $(AmandaChanger_DATA)
207 # PACKAGE: Amanda::Process
209 Amanda_DATA += Amanda/Process.pm
211 EXTRA_DIST += Amanda/Process.pm
214 # PACKAGE: Amanda::DB::*
215 Amanda_DBdir = $(Amandadir)/DB
217 HTML_SOURCE_FILES += $(Amanda_DB_DATA)
221 # PACKAGE: Amanda::DB::Catalog
222 Amanda_DB_DATA += Amanda/DB/Catalog.pm
224 EXTRA_DIST += Amanda/DB/Catalog.pm
227 # PACKAGE: Amanda::Xfer
228 libXferdir = $(amperldir)/auto/Amanda/Xfer
229 libXfer_LTLIBRARIES = libXfer.la
230 libXfer_la_SOURCES = Amanda/Xfer.c $(AMGLUE_SWG)
231 libXfer_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
232 libXfer_la_LIBADD = libamglue.la \
233 $(top_builddir)/xfer-src/libamxfer.la \
234 $(top_builddir)/common-src/libamanda.la
235 Amanda_DATA += Amanda/Xfer.pm
236 MAINTAINERCLEANFILES += Amanda/Xfer.c Amanda/Xfer.pm
238 EXTRA_DIST += Amanda/Xfer.swg Amanda/Xfer.pm
240 # PACKAGE: Amanda::BigIntCompat
241 Amanda_DATA += Amanda/BigIntCompat.pm
242 EXTRA_DIST += Amanda/BigIntCompat.pm
244 # PACKAGE: Amanda::Debug
245 libDebugdir = $(amperldir)/auto/Amanda/Debug
246 libDebug_LTLIBRARIES = libDebug.la
247 libDebug_la_SOURCES = Amanda/Debug.c $(AMGLUE_SWG)
248 libDebug_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
249 libDebug_la_LIBADD = libamglue.la \
250 $(top_builddir)/common-src/libamanda.la
251 Amanda_DATA += Amanda/Debug.pm
252 EXTRA_DIST += Amanda/Debug.swg Amanda/Debug.pm
253 MAINTAINERCLEANFILES += Amanda/Debug.c Amanda/Debug.pm
255 # PACKAGE: Amanda::Config
256 libConfigdir = $(amperldir)/auto/Amanda/Config
257 libConfig_LTLIBRARIES = libConfig.la
258 libConfig_la_SOURCES = Amanda/Config.c $(AMGLUE_SWG)
259 libConfig_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
260 libConfig_la_LIBADD = libamglue.la \
261 $(top_builddir)/common-src/libamanda.la
262 Amanda_DATA += Amanda/Config.pm
263 EXTRA_DIST += Amanda/Config.swg Amanda/Config.pm
264 MAINTAINERCLEANFILES += Amanda/Config.c Amanda/Config.pm
266 # PACKAGE: Amanda::Util
267 libUtildir = $(amperldir)/auto/Amanda/Util
268 libUtil_LTLIBRARIES = libUtil.la
269 libUtil_la_SOURCES = Amanda/Util.c $(AMGLUE_SWG)
270 libUtil_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
271 libUtil_la_LIBADD = libamglue.la \
272 $(top_builddir)/common-src/libamanda.la
273 Amanda_DATA += Amanda/Util.pm
274 EXTRA_DIST += Amanda/Util.swg Amanda/Util.pm
275 MAINTAINERCLEANFILES += Amanda/Util.c Amanda/Util.pm
277 # PACKAGE: Amanda::Types
278 libTypesdir = $(amperldir)/auto/Amanda/Types
279 libTypes_LTLIBRARIES = libTypes.la
280 libTypes_la_SOURCES = Amanda/Types.c $(AMGLUE_SWG)
281 libTypes_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
282 libTypes_la_LIBADD = libamglue.la \
283 $(top_builddir)/common-src/libamanda.la
284 Amanda_DATA += Amanda/Types.pm
285 EXTRA_DIST += Amanda/Types.swg Amanda/Types.pm
286 MAINTAINERCLEANFILES += Amanda/Types.c Amanda/Types.pm
288 # PACKAGE: Amanda::Tests
289 libTestsdir = $(amperldir)/auto/Amanda/Tests
290 libTests_LTLIBRARIES = libTests.la
291 libTests_la_SOURCES = Amanda/Tests.c $(AMGLUE_SWG)
292 libTests_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
293 libTests_la_LIBADD = libamglue.la \
294 $(top_builddir)/common-src/libamanda.la
295 Amanda_DATA += Amanda/Tests.pm
296 EXTRA_DIST += Amanda/Tests.swg Amanda/Tests.pm
297 MAINTAINERCLEANFILES += Amanda/Tests.c Amanda/Tests.pm
299 # PACKAGE: Amanda::MainLoop
300 libMainLoopdir = $(amperldir)/auto/Amanda/MainLoop
301 libMainLoop_LTLIBRARIES = libMainLoop.la
302 libMainLoop_la_SOURCES = Amanda/MainLoop.c $(AMGLUE_SWG)
303 libMainLoop_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
304 libMainLoop_la_LIBADD = libamglue.la \
305 $(top_builddir)/common-src/libamanda.la
306 Amanda_DATA += Amanda/MainLoop.pm
307 EXTRA_DIST += Amanda/MainLoop.swg Amanda/MainLoop.pm
308 MAINTAINERCLEANFILES += Amanda/MainLoop.c Amanda/MainLoop.pm
310 # PACKAGE: Amanda::Paths
311 Amanda_DATA += Amanda/Paths.pm
312 EXTRA_DIST += Amanda/Paths.pm.in
313 DISTCLEANFILES += Amanda/Paths.pm
315 # PACKAGE: Amanda::Constants
316 Amanda_DATA += Amanda/Constants.pm
317 EXTRA_DIST += Amanda/Constants.pm.in
318 DISTCLEANFILES += Amanda/Constants.pm
320 # PACKAGE: Amanda::Script_App
321 Amanda_DATA += Amanda/Script_App.pm
322 EXTRA_DIST += Amanda/Script_App.pm
325 # PACKAGE: Amanda::Application
326 libApplicationdir = $(amperldir)/auto/Amanda/Application
327 libApplication_LTLIBRARIES = libApplication.la
328 libApplication_la_SOURCES = Amanda/Application.c $(AMGLUE_SWG)
329 libApplication_la_LDFLAGS = $(PERL_EXT_LDFLAGS)
330 libApplication_la_LIBADD = libamglue.la \
331 $(top_builddir)/client-src/libamclient.la
332 Amanda_DATA += Amanda/Application.pm
333 MAINTAINERCLEANFILES += Amanda/Application.c Amanda/Application.pm
335 EXTRA_DIST += Amanda/Application.swg Amanda/Application.pm
337 # PACKAGE: Amanda::Script
338 Amanda_DATA += Amanda/Script.pm
339 EXTRA_DIST += Amanda/Script.pm
342 # PACKAGE: Amanda::Application::*
343 AmandaApplicationdir = $(amperldir)/Amanda/Application
344 AmandaApplication_DATA = Amanda/Application/Zfs.pm
345 HTML_SOURCE_FILES += $(AmandaApplication_DATA)
347 EXTRA_DIST += Amanda/Application/Zfs.pm
349 # perl doesn't use the cyg prefix and it doesn't search in the bin
350 # directory, dll must be copied to their modules directories.
351 if WANT_CYGWIN_COPY_PERL_DLL
352 amperldirauto="$(DESTDIR)$(amperldir)/auto/Amanda"
354 @for cygdll in $(amperldirauto)/bin/cyg*.dll; do \
355 destfname=`echo $$cygdll|sed 's!/bin/cyg\([^.]*\).dll!/\1/\1.dll!'`; \
356 cp "$$cygdll" "$$destfname"; \
361 @MODULES_TO_CHECK="$(Amanda_DATA) $(Amanda_DB_DATA) $(AmandaChanger_DATA) $(AmandaApplication_DATA)"; \
362 if test -f $(top_builddir)/perl/.libs/libConfig.so -o -f $(top_builddir)/perl/libConfig.so; then \
363 if test -n "$(PERL)"; then \
364 for perlobj in $$MODULES_TO_CHECK; do \
365 if test -f $$perlobj; then \
366 $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -T $$perlobj || exit 1; \
368 $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -T $(top_srcdir)/perl/$$perlobj || exit 1; \