OSDN Git Service

Remove, and subsequently ignore, .hgtags file.
[mingw/mingw-org-wsl.git] / Makefile.in
1 # @configure_input@
2 # $Id$
3 #
4 # Makefile template for MinGW.org composite System Libraries Packages
5
6 PACKAGE_TARNAME := @PACKAGE_TARNAME@
7 PACKAGE_VERSION := @PACKAGE_VERSION@
8
9 # Written by Keith Marshall <keithmarshall@users.sourceforge.net>
10 # Copyright (C) 2016, 2019, MinGW.org Project
11 #
12 #
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:
19 #
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
22 # Software.
23 #
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.
31
32
33 # The default target is "all"; declare it early, to avoid any possible
34 # inadvertent override from any included file.
35 #
36 all:
37
38 # Offer users the opportunity to assign boolean build-time options, from
39 # the command line, in the form 'option=NAME', or 'options="NAME ..."'
40 #
41 $(foreach opt,$(option) $(options),$(eval $(opt) = true))
42
43
44 # Configuration
45 # -------------
46 #
47 srcdir = @srcdir@
48 top_srcdir = @top_srcdir@
49
50 # Keep the configuration in a consistent state.  Note that we assume
51 # that configure has been run initially, (otherwise we wouldn't have
52 # a Makefile to begin with); since this also creates config.status,
53 # we may normally assume that it is already available ...
54 #
55 vpath configure ${top_srcdir}
56 config.status: configure
57         $(SHELL) config.status --recheck
58
59 # ... in which case, updating Makefile should be a simple matter of
60 # running config.status ...
61 #
62 vpath Makefile.in ${top_srcdir}
63 requires_existing = $(if $(wildcard $1),$1,$1.missing)
64 Makefile: Makefile.in configure $(call requires_existing,config.status)
65         $(SHELL) config.status
66
67 .PHONY: config.status.missing
68 # ... but, in the event that this may be missing, (e.g. because it
69 # has been manually removed, or removed by "make distclean"), suggest
70 # running configure, and bail out.
71 #
72 config.status.missing:
73         $(warning *** cannot execute config.status)
74         $(error please run ${top_srcdir}/configure to regenerate it.)
75
76 # If configure itself needs to be updated, we must run autoconf in the
77 # top level source directory.
78 #
79 vpath %.m4 ${top_srcdir}
80 vpath configure.ac ${top_srcdir}
81 configure: configure.ac aclocal.m4 VERSION.m4
82         cd ${top_srcdir}; autoconf
83
84
85 # Rules to Build and Install Both Sub-Packages
86 # --------------------------------------------
87 #
88 all install install-headers install-strip uninstall: %: %-subdirs
89
90 subdirs = @subdirs@
91 %-subdirs:; $(foreach dir,${subdirs},$(MAKE) -C ${dir} $*;)
92
93
94 # Test Suite
95 # ----------
96 #
97 .PHONY: check-recursive
98 check test tests: check-recursive
99 check-recursive: %: %-subdirs
100
101
102 # Distribution
103 # ------------
104 #
105 MKDIR_P = @MKDIR_P@
106 LN = @LN@
107
108 dist-prepare:
109         $(RM) -r $@; $(MKDIR_P) $@
110
111 dist: dist-prepare dist-subdirs dist-extra
112         for file in $(addsuffix /$@/*,${subdirs}); do \
113           test -f $$file && $(LN) $$file $@; done
114
115 LUA = @LUA@
116 LUACMD = $(if $(LUA),$(LUA) -e,false)
117
118 WSL_TMPDIR = $(CURDIR)/dist/var/lib/wsl
119 FEATURES_CFG = wsl-features-$(TODAY)-$(ISSUE)-mingw32-cfg.tar.xz
120
121 TODAY = $(shell date +%Y%m%d)
122 ISSUE = $(if $(wildcard $@),$(shell awk '\
123   { if( $$1 == $(TODAY) ) print $$2 + 1; else print 1; exit; \
124   }' $@),1)
125
126 dist-extra: $(if $(FEATURES),features.stamp)
127 features.unsupported:
128         $(warning Lua does not appear to be installed on your system;)
129         $(warning it is required to support the FEATURES distribution option.)
130
131 vpath features.lua ${srcdir}/var
132 features.stamp: features.$(if $(LUA),lua,unsupported)
133         $(RM) -r dist/var dist/include
134         $(MKDIR_P) dist/include $(WSL_TMPDIR)/include && $(LN) $^ $(WSL_TMPDIR)
135         MINGW32_SYSROOT=$(WSL_TMPDIR) $(LUACMD) '$(FEATURES_H_INITIALIZE)'
136         cd dist && tar cf - var include | xz -c > $(FEATURES_CFG)
137         echo $(TODAY) $(ISSUE) > $@
138         $(RM) -r dist/var dist/include
139
140 FEATURES_H_INITIALIZE = \
141   sysroot = os.getenv( "MINGW32_SYSROOT" ) \
142   if sysroot then \
143      package.path = sysroot.."/?.lua;"..package.path \
144      have_features, config = pcall( require, "features" ) \
145      if have_features then \
146         config.initialize( io.open( config.pathname(), "w" )) \
147      end \
148   end
149
150 # Clean-up Rules
151 # --------------
152 #
153 clean mostlyclean distclean: %: %-subdirs
154 maintainer-clean: maintainer-clean-warning maintainer-clean-local
155
156 maintainer-clean-warning:
157         $(warning $(MAKE) $(@:%-warning=%))
158         $(warning This command should be used by package maintainers only;)
159         $(warning it deletes files which may require special tools to rebuild.)
160
161 maintainer-clean-local: %: %-subdirs
162         $(RM) -r ${srcdir}/autom4te.cache
163
164 # $RCSfile$: end of file