libk  kcore.makefile at tip

File legacy/kcore.makefile from the latest check-in


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

${OUT}/k/type.h: type.h.m ${TMP}/typesize.def
	$(m-comp) $(file < ${TMP}/typesize.def) $< > $@

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