shithub: femtolisp

ref: f5e20c5823337a159618f02c861af69879b0f0e8
dir: /mkfile/

View raw version
</$objtype/mkfile

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

HFILES=\
	equalhash.h\
	flisp.h\

CHFILES=\
	cvalues.c\
	equal.c\
	operators.c\
	print.c\
	read.c\
	types.c\

OFILES=\
	builtins.$O\
	equalhash.$O\
	flisp.$O\
	flmain.$O\
	iostream.$O\
	string.$O\
	table.$O\
	3rd/wcwidth.$O\
	llt/bitvector-ops.$O\
	llt/bitvector.$O\
	llt/dump.$O\
	llt/hashing.$O\
	llt/htable.$O\
	llt/int2str.$O\
	llt/ios.$O\
	llt/lltinit.$O\
	llt/ptrhash.$O\
	llt/random.$O\
	llt/timefuncs.$O\
	llt/utf8.$O\

default:V: all

</sys/src/cmd/mkone

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

builtin_fns.h:
	sed -n 's/^BUILTIN[_]?(\(".*)/BUILTIN_FN\1/gp' *.c >$target

flmain.$O: boot.h

flisp.$O: maxstack.inc opcodes.h builtin_fns.h $CHFILES

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