4 # Makefile template for MinGW.org composite System Libraries Packages
6 PACKAGE_TARNAME := @PACKAGE_TARNAME@
7 PACKAGE_VERSION := @PACKAGE_VERSION@
9 # Written by Keith Marshall <keithmarshall@users.sourceforge.net>
10 # Copyright (C) 2016, MinGW.org Project
13 # Permission is hereby granted, free of charge, to any person obtaining a
14 # copy of this software and associated documentation files (the "Software"),
15 # to deal in the Software without restriction, including without limitation
16 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 # and/or sell copies of the Software, and to permit persons to whom the
18 # Software is furnished to do so, subject to the following conditions:
20 # The above copyright notice and this permission notice (including the next
21 # paragraph) shall be included in all copies or substantial portions of the
24 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27 # AUTHORS OR THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 # DEALINGS IN THE SOFTWARE.
33 # The default target is "all"; declare it early, to avoid any possible
34 # inadvertent override from any included file.
42 top_srcdir = @top_srcdir@
44 # Keep the configuration in a consistent state. Note that we assume
45 # that configure has been run initially, (otherwise we wouldn't have
46 # a Makefile to begin with); since this also creates config.status,
47 # we may normally assume that it is already available ...
49 vpath configure ${top_srcdir}
50 config.status: configure
51 $(SHELL) config.status --recheck
53 # ... in which case, updating Makefile should be a simple matter of
54 # running config.status ...
56 vpath Makefile.in ${top_srcdir}
57 requires_existing = $(if $(wildcard $1),$1,$1.missing)
58 Makefile: Makefile.in configure $(call requires_existing,config.status)
59 $(SHELL) config.status
61 .PHONY: config.status.missing
62 # ... but, in the event that this may be missing, (e.g. because it
63 # has been manually removed, or removed by "make distclean"), suggest
64 # running configure, and bail out.
66 config.status.missing:
67 $(warning *** cannot execute config.status)
68 $(error please run ${top_srcdir}/configure to regenerate it.)
70 # If configure itself needs to be updated, we must run autoconf in the
71 # top level source directory.
73 vpath %.m4 ${top_srcdir}
74 vpath configure.ac ${top_srcdir}
75 configure: configure.ac aclocal.m4 VERSION.m4
76 cd ${top_srcdir}; autoconf
79 # Rules to Build and Install Both Sub-Packages
80 # --------------------------------------------
82 all install install-headers install-strip uninstall: %: %-subdirs
85 %-subdirs:; $(foreach dir,${subdirs},$(MAKE) -C ${dir} $*;)
91 .PHONY: check-recursive
92 check test tests: check-recursive
93 check-recursive: %: %-subdirs
103 $(RM) -r $@; $(MKDIR_P) $@
104 for file in $(addsuffix /$@/*,${subdirs}); do \
105 test -f $$file && $(LN) $$file $@; done
111 clean mostlyclean distclean: %: %-subdirs
112 maintainer-clean: maintainer-clean-warning maintainer-clean-local
114 maintainer-clean-warning:
115 $(warning $(MAKE) $(@:%-warning=%))
116 $(warning This command should be used by package maintainers only;)
117 $(warning it deletes files which may require special tools to rebuild.)
119 maintainer-clean-local: %: %-subdirs
120 $(RM) -r ${srcdir}/autom4te.cache
122 # $RCSfile$: end of file