libk  Diff

Differences From Artifact [121a62ca71]:

To Artifact [c01fcd380e]:


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 $$< >> $$@
	cat def.$$*.i >> $$@
	echo '#endif' >> $$@
endef

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



|

>
>
>
>
>
>
>
>
>
>












<
<
<
<
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
## 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.

# gen-headers = type.h

include ../modmake

## the below code predates the introduction of gpp
## to generate these headers from templates instead
## of trying to write one for everypossible arch 
## tuple. it is left as a monument to a terrible
## and now blissfully forgotten past.
#
# 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





# ${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 $$< >> $$@
# 	cat def.$$*.i >> $$@
# 	echo '#endif' >> $$@
# endef
#
# $(eval $(call arch,x86,32))
# $(eval $(call arch,x86,64))
#