shithub: femtolisp

ref: 54d451808fafb72fdc70df17f4b811968b04bbbd
dir: /mkfile/

View raw version
</$objtype/mkfile

BIN=/$objtype/bin
TARG=flisp
CFLAGS=$CFLAGS -p -D__plan9__ -D__${objtype}__ -I3rd -Iplan9
CLEANFILES=plan9/flisp.boot.h plan9/builtin_fns.h

HFILES=\
	equalhash.h\
	flisp.h\

OFILES=\
	3rd/mt19937-64.$O\
	3rd/wcwidth.$O\
	bitreverse.$O\
	bitvector-ops.$O\
	bitvector.$O\
	builtins.$O\
	cvalues.$O\
	dump.$O\
	equal.$O\
	equalhash.$O\
	flisp.$O\
	flmain.$O\
	hashing.$O\
	htable.$O\
	ios.$O\
	iostream.$O\
	main_plan9.$O\
	operators.$O\
	popcount.$O\
	print.$O\
	ptrhash.$O\
	random.$O\
	read.$O\
	sixel_disabled.$O\
	string.$O\
	table.$O\
	time_plan9.$O\
	types.$O\
	utf8.$O\

default:V: all

</sys/src/cmd/mkone

plan9/flisp.boot.h: flisp.boot
	sed 's,\\,\\\\,g;s,",\\",g;s,^,",g;s,$,\\n",g' $prereq >$target

plan9/builtin_fns.h:
	sed -n 's/^BUILTIN[_]?(\(".*)/BUILTIN_FN\1/gp' `{echo $OFILES | sed 's/\.'$O'/.c/g'} | sort >$target

main_plan9.$O: plan9/flisp.boot.h plan9/builtin_fns.h
flisp.$O: maxstack.inc opcodes.h plan9/builtin_fns.h
builtins.$O: plan9/builtin_fns.h

%.$O: %.c
	$CC $CFLAGS -o $target $stem.c

bootstrap:V: $O.out
    ./$O.out gen.lsp && \
	cp flisp.boot flisp.boot.bak && \
	./$O.out mkboot0.lsp system.lsp compiler.lsp > flisp.boot.new && \
	mv flisp.boot.new flisp.boot && \
	./$O.out mkboot1.lsp

nuke:V:
	rm -f *.[$OS] */*.[$OS] [$OS].out *.acid $TARG $CLEANFILES

clean:V:
	rm -f *.[$OS] */*.[$OS] [$OS].out $TARG $CLEANFILES