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