Debian Codegraph @

Makefile

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 #
2 # Copyright (C) 1993-1999, 2001, 2002, 2004, 2006, 2009,
3 # 2011-2013, 2015-2019 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License as
7 # published by the Free Software Foundation; either version 2, or (at
8 # your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19 dir := .
20 makemode := misc
21
22 DISTFILES := configure
23
24 include ./Makeconf
25
26 ## Subdirectories of this directory should all be mentioned here
27
28 # Hurd libraries
29 lib-subdirs = libshouldbeinlibc libihash libiohelp libports \
30 libpager libfshelp libdiskfs libtrivfs libps \
31 libnetfs libpipe libstore libhurdbugaddr libftpconn libcons \
32 libhurd-slab \
33 libbpf \
34 libmachdev \
35 libirqhelp \
36
37 # Hurd programs
38 prog-subdirs = auth proc exec term \
39 ext2fs isofs tmpfs fatfs \
40 storeio pflocal pfinet defpager mach-defpager \
41 login daemons boot console \
42 hostmux usermux ftpfs trans \
43 console-client utils sutils libfshelp-tests \
44 benchmarks fstests \
45 procfs \
46 startup \
47 init \
48 devnode \
49 eth-multiplexer \
50 shutdown \
51 rtc
52
53 ifeq ($(HAVE_LIBRUMP),yes)
54 prog-subdirs += rumpdisk rumpnet
55 endif
56
57 ifeq ($(HAVE_SUN_RPC),yes)
58 prog-subdirs += nfs nfsd
59 endif
60
61 ifeq ($(HAVE_LIBLWIP),yes)
62 prog-subdirs += lwip
63 endif
64
65 ifeq ($(HAVE_LIBPCIACCESS),yes)
66 prog-subdirs += pci-arbiter
67 endif
68
69 ifeq ($(HAVE_LIBACPICA),yes)
70 prog-subdirs += acpi
71 endif
72
73 # Other directories
74 other-subdirs = hurd doc config release include
75
76 # All the subdirectories together
77 subdirs = $(lib-subdirs) $(prog-subdirs) $(other-subdirs)
78
79 # This allows the creation of a file BROKEN in any of the prog-subdirs;
80 # that will prevent this top level Makefile from attempting to make it.
81 working-prog-subdirs := $(filter-out \
82 $(patsubst %/,%,\
83 $(dir $(wildcard $(prog-subdirs:=/BROKEN)))),\
84 $(prog-subdirs))
85
86
87 $(subdirs): version.h
88
89 ## GNU Coding Standards targets (not all are here yet), and some other
90 ## similar sorts of things
91
92 all: $(lib-subdirs) $(working-prog-subdirs)
93
94 # Create a distribution tar file.
95
96 git_describe := git describe --match '*release*'
97 dist-version := $(shell cd $(top_srcdir)/ && $(git_describe))
98
99 .PHONY: dist
100 ifdef configured
101 dist: $(foreach Z,xz gz,$(dist-version).tar.$(Z))
102 else
103 dist:
104 @echo >&2 'Cannot build a distribution from an unconfigured tree.'
105 false
106 endif
107
108 HEAD.tar: FORCE
109 cd $(top_srcdir)/ && git status --short \
110 | $(AWK) '{ print; rc=1 } END { exit rc }' \
111 || { echo >&2 \
112 'Refusing to build a distribution from dirty sources.' && \
113 false; }
114 (cd $(top_srcdir)/ && git archive --prefix=$(dist-version)/ HEAD) > $@
115
116 ChangeLog.tar: gen-ChangeLog
117 tar -c -f $@ --owner=0 --group=0 \
118 --transform='s%^%$(dist-version)/%' $(ChangeLog_files)
119
120 # See the ChangeLog file.
121 gitlog-to-changelog_rev = \
122 2772f5c6a6a51cf946fd95bf6ffe254273157a21..
123 ChangeLog_files = \
124 $(filter-out :%,$(subst :, :,$(ChangeLog_specs)))
125 ChangeLog_specs = \
126 ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
127 auth/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
128 benchmarks/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
129 boot/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
130 config/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
131 console-client/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
132 console/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
133 daemons/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
134 defpager/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
135 doc/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
136 exec/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
137 ext2fs/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
138 fatfs/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
139 fstests/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
140 ftpfs/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
141 hostmux/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
142 hurd/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
143 include/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
144 init/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
145 isofs/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
146 libcons/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
147 libdirmgt/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
148 libdiskfs/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
149 libfshelp/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
150 libftpconn/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
151 libhurdbugaddr/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
152 libihash/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
153 libiohelp/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
154 libnetfs/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
155 libpager/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
156 libpipe/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
157 libports/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
158 libps/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
159 libshouldbeinlibc/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
160 libstore/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
161 libthreads/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
162 libtrivfs/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
163 login/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
164 mach-defpager/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
165 nfs/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
166 nfsd/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
167 pfinet/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
168 pflocal/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
169 proc/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
170 release/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
171 storeio/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
172 sutils/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
173 term/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
174 tmpfs/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
175 trans/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
176 usermux/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
177 utils/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21
178 # procfs
179 gitlog-to-changelog_rev += \
180 ^aac4aaf42372f61c78061711916c81a9d5bcb42d~1
181 ChangeLog_specs += \
182 procfs/ChangeLog:edb4593c38d421b5d538b221a991b50c36fdba15:ChangeLog
183 # random
184 gitlog-to-changelog_rev += \
185 ^1ba2ed95690396bf081d0af043d878b26b8563c2~1
186 # Specify dummy ChangeLog file, will get overwritten.
187 ChangeLog_specs += \
188 random/ChangeLog:HEAD:ChangeLog
189 .PHONY: gen-ChangeLog
190 gen-ChangeLog:
191 $(AM_V_GEN)if test -d $(top_srcdir)/.git; then \
192 rm -f $(ChangeLog_files) && \
193 (cd $(top_srcdir)/ && \
194 ./gitlog-to-changelog --strip-tab \
195 $(gitlog-to-changelog_rev) && \
196 echo) >> ChangeLog && \
197 (cd $(top_srcdir)/ && \
198 ./gitlog-to-changelog --strip-tab \
199 edb4593c38d421b5d538b221a991b50c36fdba15..aac4aaf42372f61c78061711916c81a9d5bcb42d~1 && \
200 echo) >> procfs/ChangeLog && \
201 rm -f random/ChangeLog-1 && \
202 (cd $(top_srcdir)/ && \
203 ./gitlog-to-changelog --strip-tab \
204 ac38884dc9ad32a11d09f55ba9fe399cd0a48e2f..1ba2ed95690396bf081d0af043d878b26b8563c2~1 && \
205 echo) >> random/ChangeLog-1 && \
206 for cs in $(ChangeLog_specs); do \
207 f=$${cs%%:*} && \
208 s=$${cs#$$f:} && s_f=$$s:$$f && s=$${s_f/*:*:*/$$s} && \
209 (cd $(top_srcdir)/ && \
210 git show $$s) >> $$f \
211 || exit $$?; \
212 done && \
213 rm -f random/ChangeLog_ && \
214 (cd $(top_srcdir)/ && \
215 git ls-tree --name-only \
216 ac38884dc9ad32a11d09f55ba9fe399cd0a48e2f) >> random/ChangeLog_ && \
217 rm -f random/ChangeLog-2 && \
218 perl \
219 -e 'print "2011-08-18 Gaƫl Le Mignot <kilobug\@freesurf.fr>\n\n"; while(<>){s%^%\t* %;s%$$%: New file.%;print;}' \
220 < random/ChangeLog_ > random/ChangeLog-2 && \
221 cat random/ChangeLog-* > random/ChangeLog && \
222 rm random/ChangeLog?* && \
223 sed \
224 -e 's%\* [ ]*%* procfs/%' \
225 -e s%procfs/procfs/%procfs/% \
226 -i procfs/ChangeLog && \
227 sed \
228 -e 's%\* [ ]*%* random/%' \
229 -i random/ChangeLog; \
230 fi
231
232 $(dist-version).tar: HEAD.tar $(addsuffix /dist-hook,hurd/.. $(subdirs)) ChangeLog.tar
233 tar -c -f $@ --files-from=/dev/null
234 # Concatenate the tar files. Have
235 # to do it one by one: <http://savannah.gnu.org/patch/?7757>.
236 for f in HEAD.tar dist.tar */dist.tar ChangeLog.tar; do \
237 tar -v --concatenate -f $@ "$$f"; \
238 done
239
240 clean: $(addsuffix -clean,$(subdirs)) clean-misc
241
242 relink: $(addsuffix -relink,$(lib-subdirs) $(prog-subdirs))
243
244 objs: $(addsuffix -objs,$(lib-subdirs) $(prog-subdirs))
245
246 install: $(addsuffix -install,$(lib-subdirs) $(working-prog-subdirs) \
247 $(other-subdirs))
248
249 install-headers: $(addsuffix -install-headers,$(lib-subdirs) \
250 $(working-prog-subdirs)\
251 $(other-subdirs))
252
253 TAGS: $(addsuffix -TAGS,$(working-prog-subdirs) $(lib-subdirs))
254 etags -o $@ $(patsubst %-TAGS,-i %/TAGS,$^)
255
256 %.xz: %
257 xz < $< > $@
258
259 %.gz: %
260 gzip -9n < $< > $@
261
262 ## Targets used by the main targets above.
263 $(prog-subdirs) $(lib-subdirs): FORCE
264 $(MAKE) -C $@ all
265 FORCE:
266
267 %-clean:
268 $(MAKE) -C $* clean no_deps=t
269
270 %-relink:
271 $(MAKE) -C $* relink no_deps=t
272
273 %-objs:
274 $(MAKE) -C $* objs
275
276 %-install:
277 $(MAKE) -C $* install
278
279 %-install-headers:
280 $(MAKE) -C $* install-headers
281
282 %-TAGS:
283 $(MAKE) -C $* TAGS no_deps=t
284
285 .PHONY: %/dist-hook
286 %/dist-hook:
287 $(MAKE) -C $* dist-hook no_deps=t dist-version=$(dist-version)
288
289 .PHONY: clean-misc distclean
290 clean-misc:
291 rm -f HEAD.tar ChangeLog.tar $(ChangeLog_files)
292
293 distclean: clean
294 rm -f config.make config.log config.status config.cache
295 ifneq (.,${srcdir})
296 rm -f Makefile
297 endif
298
299
300 ## Directory dependencies
301 #
302 # Some directories depend on others, so we need to find out exactly
303 # what they are. This does that for us.
304
305 ifneq ($(no_deps),t)
306 -include $(addsuffix .d,$(subdirs))
307 endif
308
309 # How to build them
310 $(addsuffix .d,$(subdirs)): %.d: $(top_srcdir)/%/Makefile
311 $(MAKE) -C $* directory-depend no_deps=t
312
313
314 ## Build system
315
316 AUTOCONF = autoconf
317 AUTOCONF_FLAGS = -I $(top_srcdir)
318
319 $(top_srcdir)/configure: $(top_srcdir)/configure.ac $(top_srcdir)/aclocal.m4
320 $(AUTOCONF) $(AUTOCONF_FLAGS) $< > $@
321 chmod +x $@
322
323 config.status: $(top_srcdir)/configure
324 $(SHELL) $@ --recheck
325
326 config.make: config.status $(top_srcdir)/config.make.in
327 # No stamp file is used here, as config.make's timestamp changing will not have
328 # any far-reaching consequences.
329 $(SHELL) $< --file=$@
330
331 version.h: stamp-version; @:
332 stamp-version: version.h.in config.make
333 sed -e 's/MASTER_HURD_VERSION/\"$(package-version)\"/' \
334 < $< > version.h.new
335 $(move-if-change) version.h.new version.h
336 touch $@