shithub: femtolisp

ref: 252c5221c6eb32fa05b69f8683b01b5c9f832bcb
dir: /mkfile/

View raw version
</$objtype/mkfile

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

HFILES=\
	equalhash.h\
	flisp.h\
	plan9/platform.h\

OFILES=\
	3rd/mt19937-64.$O\
	3rd/wcwidth.$O\
	3rd/spooky.$O\
	bitvector.$O\
	builtins.$O\
	cvalues.$O\
	equal.$O\
	equalhash.$O\
	flisp.$O\
	flisp.boot.$O\
	flmain.$O\
	hashing.$O\
	htable.$O\
	ios.$O\
	iostream.$O\
	main_plan9.$O\
	operators.$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/builtin_fns.h:D:
	sed -n 's/^BUILTIN[_]?(\(".*)/BUILTIN_FN\1/gp' \
		`{ls `{echo $OFILES | sed 's/\.'$O'/.c/g'} >[2]/dev/null} | sort >$target

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

plan9/flisp.boot.s:D: flisp.boot
	aux/data2s boot <flisp.boot >$target

flisp.boot.$O: plan9/flisp.boot.s
	$AS -o $target plan9/flisp.boot.s

%.$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