forked from Unicorn-Dynamics/hurd
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
417 lines (346 loc) · 14.1 KB
/
Makefile
File metadata and controls
417 lines (346 loc) · 14.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
#
# Copyright (C) 1993-1999, 2001, 2002, 2004, 2006, 2009,
# 2011-2013, 2015-2019 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
dir := .
makemode := misc
DISTFILES := configure
include ./Makeconf
## Subdirectories of this directory should all be mentioned here
# Cognitive Kernel - Self-evolving scaffolding for GNU Hurd
cognitive-subdirs = cogkernel
# Hurd libraries
lib-subdirs = libshouldbeinlibc libihash libiohelp libports \
libpager libfshelp libdiskfs libtrivfs libps \
libnetfs libpipe libstore libhurdbugaddr libftpconn libcons \
libhurd-slab \
libbpf \
libmachdev \
libirqhelp \
# Hurd programs
prog-subdirs = auth proc exec term \
ext2fs isofs tmpfs fatfs \
storeio pflocal pfinet defpager mach-defpager \
login daemons boot console \
hostmux usermux ftpfs trans \
console-client utils sutils libfshelp-tests \
benchmarks fstests \
procfs \
startup \
init \
devnode \
eth-multiplexer \
shutdown \
rtc
ifeq ($(HAVE_LIBRUMP),yes)
prog-subdirs += rumpdisk
endif
ifeq ($(HAVE_SUN_RPC),yes)
prog-subdirs += nfs nfsd
endif
ifeq ($(HAVE_LIBLWIP),yes)
prog-subdirs += lwip
endif
ifeq ($(HAVE_LIBPCIACCESS),yes)
prog-subdirs += pci-arbiter
endif
ifeq ($(HAVE_LIBACPICA),yes)
prog-subdirs += acpi
endif
# Other directories
other-subdirs = hurd doc config release include
# All the subdirectories together
subdirs = $(cognitive-subdirs) $(lib-subdirs) $(prog-subdirs) $(other-subdirs)
# This allows the creation of a file BROKEN in any of the prog-subdirs;
# that will prevent this top level Makefile from attempting to make it.
working-prog-subdirs := $(filter-out \
$(patsubst %/,%,\
$(dir $(wildcard $(prog-subdirs:=/BROKEN)))),\
$(prog-subdirs))
$(subdirs): version.h
## GNU Coding Standards targets (not all are here yet), and some other
## similar sorts of things
all: $(lib-subdirs) $(working-prog-subdirs)
# Create a distribution tar file.
git_describe := git describe --match '*release*'
dist-version := $(shell cd $(top_srcdir)/ && $(git_describe))
.PHONY: dist
ifdef configured
dist: $(foreach Z,xz gz,$(dist-version).tar.$(Z))
else
dist:
@echo >&2 'Cannot build a distribution from an unconfigured tree.'
false
endif
HEAD.tar: FORCE
cd $(top_srcdir)/ && git status --short \
| $(AWK) '{ print; rc=1 } END { exit rc }' \
|| { echo >&2 \
'Refusing to build a distribution from dirty sources.' && \
false; }
(cd $(top_srcdir)/ && git archive --prefix=$(dist-version)/ HEAD) > $@
ChangeLog.tar: gen-ChangeLog
tar -c -f $@ --owner=0 --group=0 \
--transform='s%^%$(dist-version)/%' $(ChangeLog_files)
# See the ChangeLog file.
gitlog-to-changelog_rev = \
2772f5c6a6a51cf946fd95bf6ffe254273157a21..
ChangeLog_files = \
$(filter-out :%,$(subst :, :,$(ChangeLog_specs)))
ChangeLog_specs = \
ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
auth/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
benchmarks/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
boot/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
config/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
console-client/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
console/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
daemons/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
defpager/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
doc/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
exec/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
ext2fs/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
fatfs/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
fstests/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
ftpfs/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
hostmux/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
hurd/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
include/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
init/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
isofs/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
libcons/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
libdirmgt/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
libdiskfs/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
libfshelp/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
libftpconn/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
libhurdbugaddr/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
libihash/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
libiohelp/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
libnetfs/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
libpager/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
libpipe/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
libports/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
libps/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
libshouldbeinlibc/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
libstore/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
libthreads/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
libtrivfs/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
login/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
mach-defpager/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
nfs/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
nfsd/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
pfinet/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
pflocal/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
proc/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
release/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
storeio/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
sutils/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
term/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
tmpfs/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
trans/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
usermux/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21 \
utils/ChangeLog:2772f5c6a6a51cf946fd95bf6ffe254273157a21
# procfs
gitlog-to-changelog_rev += \
^aac4aaf42372f61c78061711916c81a9d5bcb42d~1
ChangeLog_specs += \
procfs/ChangeLog:edb4593c38d421b5d538b221a991b50c36fdba15:ChangeLog
# random
gitlog-to-changelog_rev += \
^1ba2ed95690396bf081d0af043d878b26b8563c2~1
# Specify dummy ChangeLog file, will get overwritten.
ChangeLog_specs += \
random/ChangeLog:HEAD:ChangeLog
.PHONY: gen-ChangeLog
gen-ChangeLog:
$(AM_V_GEN)if test -d $(top_srcdir)/.git; then \
rm -f $(ChangeLog_files) && \
(cd $(top_srcdir)/ && \
./gitlog-to-changelog --strip-tab \
$(gitlog-to-changelog_rev) && \
echo) >> ChangeLog && \
(cd $(top_srcdir)/ && \
./gitlog-to-changelog --strip-tab \
edb4593c38d421b5d538b221a991b50c36fdba15..aac4aaf42372f61c78061711916c81a9d5bcb42d~1 && \
echo) >> procfs/ChangeLog && \
rm -f random/ChangeLog-1 && \
(cd $(top_srcdir)/ && \
./gitlog-to-changelog --strip-tab \
ac38884dc9ad32a11d09f55ba9fe399cd0a48e2f..1ba2ed95690396bf081d0af043d878b26b8563c2~1 && \
echo) >> random/ChangeLog-1 && \
for cs in $(ChangeLog_specs); do \
f=$${cs%%:*} && \
s=$${cs#$$f:} && s_f=$$s:$$f && s=$${s_f/*:*:*/$$s} && \
(cd $(top_srcdir)/ && \
git show $$s) >> $$f \
|| exit $$?; \
done && \
rm -f random/ChangeLog_ && \
(cd $(top_srcdir)/ && \
git ls-tree --name-only \
ac38884dc9ad32a11d09f55ba9fe399cd0a48e2f) >> random/ChangeLog_ && \
rm -f random/ChangeLog-2 && \
perl \
-e 'print "2011-08-18 Gaël Le Mignot <kilobug\@freesurf.fr>\n\n"; while(<>){s%^%\t* %;s%$$%: New file.%;print;}' \
< random/ChangeLog_ > random/ChangeLog-2 && \
cat random/ChangeLog-* > random/ChangeLog && \
rm random/ChangeLog?* && \
sed \
-e 's%\* [ ]*%* procfs/%' \
-e s%procfs/procfs/%procfs/% \
-i procfs/ChangeLog && \
sed \
-e 's%\* [ ]*%* random/%' \
-i random/ChangeLog; \
fi
$(dist-version).tar: HEAD.tar $(addsuffix /dist-hook,hurd/.. $(subdirs)) ChangeLog.tar
tar -c -f $@ --files-from=/dev/null
# Concatenate the tar files. Have
# to do it one by one: <http://savannah.gnu.org/patch/?7757>.
for f in HEAD.tar dist.tar */dist.tar ChangeLog.tar; do \
tar -v --concatenate -f $@ "$$f"; \
done
clean: $(addsuffix -clean,$(subdirs)) clean-misc
relink: $(addsuffix -relink,$(lib-subdirs) $(prog-subdirs))
objs: $(addsuffix -objs,$(lib-subdirs) $(prog-subdirs))
install: $(addsuffix -install,$(lib-subdirs) $(working-prog-subdirs) \
$(other-subdirs))
install-headers: $(addsuffix -install-headers,$(lib-subdirs) \
$(working-prog-subdirs)\
$(other-subdirs))
TAGS: $(addsuffix -TAGS,$(working-prog-subdirs) $(lib-subdirs))
etags -o $@ $(patsubst %-TAGS,-i %/TAGS,$^)
%.xz: %
xz < $< > $@
%.gz: %
gzip -9n < $< > $@
## Targets used by the main targets above.
$(prog-subdirs) $(lib-subdirs): FORCE
$(MAKE) -C $@ all
FORCE:
%-clean:
$(MAKE) -C $* clean no_deps=t
%-relink:
$(MAKE) -C $* relink no_deps=t
%-objs:
$(MAKE) -C $* objs
%-install:
$(MAKE) -C $* install
%-install-headers:
$(MAKE) -C $* install-headers
%-TAGS:
$(MAKE) -C $* TAGS no_deps=t
.PHONY: %/dist-hook
%/dist-hook:
$(MAKE) -C $* dist-hook no_deps=t dist-version=$(dist-version)
.PHONY: clean-misc distclean
clean-misc:
rm -f HEAD.tar ChangeLog.tar $(ChangeLog_files)
distclean: clean
rm -f config.make config.log config.status config.cache
ifneq (.,${srcdir})
rm -f Makefile
endif
## Directory dependencies
#
# Some directories depend on others, so we need to find out exactly
# what they are. This does that for us.
ifneq ($(no_deps),t)
-include $(addsuffix .d,$(subdirs))
endif
# How to build them
$(addsuffix .d,$(subdirs)): %.d: $(top_srcdir)/%/Makefile
$(MAKE) -C $* directory-depend no_deps=t
## Build system
AUTOCONF = autoconf
AUTOCONF_FLAGS = -I $(top_srcdir)
$(top_srcdir)/configure: $(top_srcdir)/configure.ac $(top_srcdir)/aclocal.m4
$(AUTOCONF) $(AUTOCONF_FLAGS) $< > $@
chmod +x $@
config.status: $(top_srcdir)/configure
$(SHELL) $@ --recheck
config.make: config.status $(top_srcdir)/config.make.in
# No stamp file is used here, as config.make's timestamp changing will not have
# any far-reaching consequences.
$(SHELL) $< --file=$@
version.h: stamp-version; @:
stamp-version: version.h.in config.make
sed -e 's/MASTER_HURD_VERSION/\"$(package-version)\"/' \
< $< > version.h.new
$(move-if-change) version.h.new version.h
touch $@
## HurdCog Cognitive Architecture Targets
## Implementing "The Hand Principle" for GNU Hurd
# HurdCog minimal bootstrap - Phase 1 implementation
hurdcog-bootstrap:
@echo "🧠 === HurdCog Minimal Bootstrap - Spin Cycle 1 === 🧠"
@echo "Implementing 'The Hand Principle' for GNU Hurd"
$(MAKE) -C cogkernel minimal-bootstrap
# Cognitive kernel demo
cognitive-demo:
@echo "🤖 === Cognitive Kernel Demo === 🤖"
$(MAKE) -C cogkernel demo
# Complete cognitive system test
cognitive-test: cognitive-demo hurdcog-bootstrap
@echo "✅ Cognitive architecture integration complete"
@echo "The computational hand now grips the GNU Hurd ecosystem!"
# Phase 2 Core Services - Spin Cycle 2 implementation
hurdcog-phase2:
@echo "🧠 === HurdCog Phase 2: Core Services - Spin Cycle 2 === 🧠"
@echo "Implementing TruthKernel, DarwinCore, and SchedSpace"
$(MAKE) -C cogkernel phase2-test
# Individual Phase 2 component tests
test-truthkernel:
@echo "🧠 === Testing TruthKernel === 🧠"
$(MAKE) -C cogkernel test-truthkernel
test-darwincore:
@echo "🧬 === Testing DarwinCore === 🧬"
$(MAKE) -C cogkernel test-darwincore
test-schedspace:
@echo "⚡ === Testing SchedSpace === ⚡"
$(MAKE) -C cogkernel test-schedspace
# Complete Phase 2 integration test
cognitive-phase2-test: hurdcog-phase2
@echo "✅ Phase 2 Core Services integration complete"
@echo "TruthKernel, DarwinCore, and SchedSpace operational!"
# Phase 3 Full Integration - Spin Cycle 3 implementation
hurdcog-phase3:
@echo "🚀 === HurdCog Phase 3: Full Integration - Spin Cycle 3 === 🚀"
@echo "Implementing 9P Hypergraph, Limbo Grammar, and Enhanced SchedSpace"
$(MAKE) -C cogkernel phase3-test
# Individual Phase 3 component tests
test-9p-hypergraph:
@echo "🌐 === Testing 9P Hypergraph Integration === 🌐"
$(MAKE) -C cogkernel test-9p-hypergraph
test-limbo-grammar:
@echo "🧠 === Testing Limbo Cognitive Grammar === 🧠"
$(MAKE) -C cogkernel test-limbo-grammar
test-distributed-scheduling:
@echo "🌍 === Testing Distributed Scheduling === 🌍"
$(MAKE) -C cogkernel test-distributed-scheduling
# Complete Phase 3 integration test
cognitive-phase3-test: hurdcog-phase3
@echo "🎉 Phase 3 Full Integration complete"
@echo "9P Hypergraph, Limbo Grammar, and Distributed Operations operational!"
# Complete cognitive system test (all phases)
cognitive-complete-test: cognitive-test cognitive-phase2-test cognitive-phase3-test
@echo "🌟 === COMPLETE HURDCOG COGNITIVE ARCHITECTURE === 🌟"
@echo "All three phases successfully integrated:"
@echo " ✅ Phase 1: Minimal Bootstrap"
@echo " ✅ Phase 2: Core Services"
@echo " ✅ Phase 3: Full Integration"
@echo "🤝 The cognitive hand has achieved COMPLETE grip on reality!"
.PHONY: hurdcog-bootstrap cognitive-demo cognitive-test hurdcog-phase2 test-truthkernel test-darwincore test-schedspace cognitive-phase2-test hurdcog-phase3 test-9p-hypergraph test-limbo-grammar test-distributed-scheduling cognitive-phase3-test cognitive-complete-test