#
# Makefile for MIT CScheme microcode.
#
# $Header: /sw2/sdist/dist-7.1/src/microcode/RCS/Makefile,v 1.12 1991/07/24 02:25:00 cph Exp $
#
CPP = cc -E
MAKE = make  # BSD doesn't have it as a default.

all: xmakefile
	$(MAKE) $(MAKEOVERRIDES) -f xmakefile ${MFLAGS} all
.PHONY: all

scheme: xmakefile
	$(MAKE) $(MAKEOVERRIDES) -f xmakefile ${MFLAGS} scheme
.PHONY: scheme

xscheme: xmakefile
	$(MAKE) $(MAKEOVERRIDES) -f xmakefile ${MFLAGS} xscheme
.PHONY: xscheme

bchscheme: xmakefile
	$(MAKE) $(MAKEOVERRIDES) -f xmakefile ${MFLAGS} bchscheme
.PHONY: bchscheme

Psbtobin: xmakefile
	$(MAKE) $(MAKEOVERRIDES) -f xmakefile ${MFLAGS} Psbtobin
.PHONY: Psbtobin

Bintopsb: xmakefile
	$(MAKE) $(MAKEOVERRIDES) -f xmakefile ${MFLAGS} Bintopsb
.PHONY: Bintopsb

Ppband: xmakefile
	$(MAKE) $(MAKEOVERRIDES) -f xmakefile ${MFLAGS} Ppband
.PHONY: Ppband

install: xmakefile
	$(MAKE) $(MAKEOVERRIDES) -f xmakefile ${MFLAGS} install
.PHONY: install

# If you have a problem with cc -E here, changing
# the definition of CPP above may fix it.
xmakefile: ymakefile ymake.script ymake.local cf.h s.h m.h
	rm -f xmakefile junk.c
	cp ymakefile junk.c
	$(CPP) junk.c | sed -n -f ymake.script > xmakefile
	rm -f junk.c

clean remove:
	rm -f *.o *.touch xmakefile
	rm -f scheme xscheme bchscheme
	rm -f Findprim Bintopsb Psbtobin Breakup Wsize Ppband hard-params
	rm -f usrdef.c limits.h float.h schwraps.c schwraps.h
	rm -f lint.out

tags:
	etags *.[ch] ../runtime/*.scm

locked:
	rlog -L -R RCS/*,v

getpagesize.h : pagesize.h
	rm -f getpagesize.h
	cp pagesize.h getpagesize.h
