libk  Diff

Differences From Artifact [f0df06fe05]:

To Artifact [a535931ecd]:





















1




































include ../modmake

















>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
## kcore/makefile
# kcore has to include, among other things, a replacement
# for stddef.h, and that can't be written in portable C,
# so we're generating it at build time.
#
# look, imma just be straight with you. the mechanism we're
# using to generate these headers is unbelievably heinous.
# it's inelegant, it's gross, and it's horrible. in the long
# term this NEEDS to be replaced with a bespoke solution
# instead of makefile gibberish. hopefully tho this will be
# enough in the short term for libk to get going, enough that
# someone more competent than me will someday be interested
# in fixing this horrorshow.
#
# until them: i'm sorry.
# very sincerely yours, lexi hale

gen-headers = type.h

include ../modmake

${OUT}/k/type.h: ${TMP}/type.${TARGET}.i
	cp $< $@

# generating C source in makeā€¦ yaaay
define arch =
${TMP}/type.$(1).%.$(2).i: type.$(1).$(2).i def.%.i ${TMP}
	echo '#ifndef KItype' > $$@
	echo '#define KItype' >> $$@
	cat def.$$*.i >> $$@
	cat $$< >> $$@
	echo '#endif' >> $$@
endef

$(eval $(call arch,x86,32))
$(eval $(call arch,x86,64))