1## Run automake on this file to produce Makefile.in
2
3# FIG : Facility for Interactive Generation of figures
4# Copyright (c) 1985-1988 by Supoj Sutanthavibul
5# Parts Copyright (c) 1989-2015 by Brian V. Smith
6# Parts Copyright (c) 1991 by Paul King
7# Parts Copyright (c) 2016-2021 by Thomas Loimer
8#
9# Any party obtaining a copy of these files is granted, free of charge, a
10# full and unrestricted irrevocable, world-wide, paid up, royalty-free,
11# nonexclusive right and license to deal in this software and documentation
12# files (the "Software"), including without limitation the rights to use,
13# copy, modify, merge, publish, distribute, sublicense and/or sell copies
14# of the Software, and to permit persons who receive copies from any such
15# party to do so, with the only requirement being that the above copyright
16# and this permission notice remain intact.
17#
18#
19# Makefile.am
20# Author: Thomas Loimer, 2016-2021
21
22
23SUBDIRS = src doc tests
24
25dist_icon_DATA = xfig.png
26
27appdefault_DATA = app-defaults/Fig
28
29dist_applications_DATA = xfig.desktop
30
31dist_compkeydb_DATA = CompKeyDB
32
33EXTRA_DIST = CHANGES FIGAPPS HACKING update-version_m4			\
34	app-defaults/Fig.in app-defaults/Fig-color.ad			\
35	app-defaults/Fig-color.bisque app-defaults/Fig-color.blue.ad	\
36	app-defaults/Fig-color.classic.ad splash-image/bluemarble.png	\
37	splash-image/NOTES splash-image/spl_bckgnd.fig.in		\
38	splash-image/xfig_splash_logo.png
39
40MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.h.in config.h.in~ configure
41
42# a fragment, to test compilation with different configure-flags
43compile-check: distdir
44	chmod u+w $(distdir)
45	mkdir $(distdir)/_build $(distdir)/_build/sub
46	cd $(distdir)/_build/sub \
47	&& ../../configure --srcdir=../.. --without-xfig-libraries --disable-jpeg \
48	&& $(MAKE) -j $(AM_MAKEFLAGS) \
49	&& $(MAKE) $(AM_MAKEFLAGS) check \
50	&& $(MAKE) $(AM_MAKEFLAGS) clean
51	cd $(distdir)/_build/sub \
52	../../configure --srcdir=../.. --without-xfig-libraries --disable-xpm --enable-xpm-icon \
53	&& $(MAKE) -j $(AM_MAKEFLAGS) \
54	&& $(MAKE) $(AM_MAKEFLAGS) check \
55	&& $(MAKE) $(AM_MAKEFLAGS) clean
56
57xfig_librariesdir = Libraries
58
59if XFIG_LIBRARIES
60EXTRA_DIST += $(xfig_librariesdir)
61
62# do not distribute Maps/USA/assemble and Maps/Canada/assemble
63# See info automake, 14.3 The dist Hook, for an example with chmod u+w.
64dist-hook:
65	test -d "$(distdir)/$(xfig_librariesdir)/Maps" \
66	&& cd "$(distdir)/$(xfig_librariesdir)/Maps" && \
67		for p in USA Canada; do \
68			test -f "$$p/assemble" \
69			&& { test -w "$$p" || chmod u+w "$$p"; } \
70			&& rm -f "$$p/assemble" || :; \
71		done || :
72
73# Libraries might not be distributed - so test, whether the
74# source is there, before trying to copy it to the destination.
75install-data-hook:
76	test -d "$(srcdir)/$(xfig_librariesdir)" && { \
77		$(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" \
78		&& cp -Rp "$(srcdir)/$(xfig_librariesdir)" "$(DESTDIR)$(pkgdatadir)" \
79		&& chmod -R u+rwX "$(DESTDIR)$(pkgdatadir)" || exit 1; } \
80		|| :
81
82uninstall-local:
83	test -d "$(DESTDIR)$(pkgdatadir)/$(xfig_librariesdir)" \
84	&& rm -rf "$(DESTDIR)$(pkgdatadir)/$(xfig_librariesdir)" || :
85endif
86