1995-07-02 09:47:24 -07:00
|
|
|
include ../Makefile.config
|
|
|
|
|
1995-11-02 06:09:42 -08:00
|
|
|
CAMLC=../boot/cslrun ../boot/cslc -I ../boot
|
1995-07-02 09:47:24 -07:00
|
|
|
COMPFLAGS=$(INCLUDES)
|
|
|
|
LINKFLAGS=
|
1995-11-02 06:09:42 -08:00
|
|
|
CAMLYACC=../boot/cslyacc
|
1995-07-02 09:47:24 -07:00
|
|
|
YACCFLAGS=
|
1995-11-02 06:09:42 -08:00
|
|
|
CAMLLEX=../boot/cslrun ../boot/csllex
|
|
|
|
CAMLDEP=../boot/cslrun ../tools/csldep
|
1995-07-02 09:47:24 -07:00
|
|
|
DEPFLAGS=$(INCLUDES)
|
1995-11-02 06:09:42 -08:00
|
|
|
CAMLRUN=../boot/cslrun
|
1995-07-02 09:47:24 -07:00
|
|
|
|
|
|
|
CODEGEN=./codegen
|
1995-11-28 06:43:16 -08:00
|
|
|
CC=$(NATIVECC)
|
1995-06-15 09:09:45 -07:00
|
|
|
CFLAGS=-g
|
|
|
|
|
1995-11-21 12:27:50 -08:00
|
|
|
PROGS=fib.out tak.out quicksort.out quicksort2.out soli.out integr.out \
|
1995-12-05 01:18:22 -08:00
|
|
|
arith.out checkbound.out
|
1995-06-15 09:09:45 -07:00
|
|
|
|
1995-07-02 09:47:24 -07:00
|
|
|
all: codegen $(PROGS)
|
|
|
|
|
|
|
|
INCLUDES=-I ../utils -I ../typing -I ../asmcomp
|
|
|
|
|
|
|
|
OTHEROBJS=../utils/misc.cmo ../utils/tbl.cmo \
|
|
|
|
../utils/clflags.cmo ../utils/config.cmo \
|
1995-07-17 09:11:32 -07:00
|
|
|
../parsing/location.cmo \
|
1995-07-02 09:47:24 -07:00
|
|
|
../typing/ident.cmo ../typing/path.cmo ../typing/subst.cmo \
|
1995-11-01 10:11:36 -08:00
|
|
|
../typing/primitive.cmo ../typing/predef.cmo ../typing/printtyp.cmo \
|
|
|
|
../typing/datarepr.cmo ../typing/env.cmo \
|
1995-07-02 09:47:24 -07:00
|
|
|
../bytecomp/lambda.cmo \
|
|
|
|
../asmcomp/arch.cmo ../asmcomp/cmm.cmo ../asmcomp/printcmm.cmo \
|
|
|
|
../asmcomp/clambda.cmo ../asmcomp/compilenv.cmo \
|
|
|
|
../asmcomp/reg.cmo ../asmcomp/mach.cmo ../asmcomp/proc.cmo \
|
1995-08-09 07:55:10 -07:00
|
|
|
../asmcomp/closure.cmo ../asmcomp/cmmgen.cmo \
|
1995-08-24 06:24:18 -07:00
|
|
|
../asmcomp/printmach.cmo ../asmcomp/selection.cmo ../asmcomp/liveness.cmo \
|
1995-08-24 08:12:05 -07:00
|
|
|
../asmcomp/spill.cmo ../asmcomp/split.cmo \
|
1995-07-02 09:47:24 -07:00
|
|
|
../asmcomp/interf.cmo ../asmcomp/coloring.cmo ../asmcomp/reload.cmo \
|
1995-08-13 02:31:50 -07:00
|
|
|
../asmcomp/linearize.cmo ../asmcomp/scheduling.cmo \
|
|
|
|
../asmcomp/printlinear.cmo ../asmcomp/emitaux.cmo \
|
1995-07-02 09:47:24 -07:00
|
|
|
../asmcomp/emit.cmo ../asmcomp/asmgen.cmo
|
|
|
|
|
|
|
|
OBJS=parsecmmaux.cmo parsecmm.cmo lexcmm.cmo main.cmo
|
|
|
|
|
|
|
|
codegen: $(OTHEROBJS) $(OBJS)
|
|
|
|
$(CAMLC) $(LINKFLAGS) -o codegen $(OTHEROBJS) $(OBJS)
|
|
|
|
clean::
|
|
|
|
rm -f codegen
|
|
|
|
|
|
|
|
# The parser
|
|
|
|
|
|
|
|
parsecmm.mli parsecmm.ml: parsecmm.mly
|
|
|
|
$(CAMLYACC) $(YACCFLAGS) parsecmm.mly
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f parsecmm.mli parsecmm.ml parsecmm.output
|
|
|
|
|
|
|
|
beforedepend:: parsecmm.mli parsecmm.ml
|
|
|
|
|
|
|
|
# The lexer
|
|
|
|
|
|
|
|
lexcmm.ml: lexcmm.mll
|
|
|
|
$(CAMLLEX) lexcmm.mll
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f lexcmm.ml
|
|
|
|
|
|
|
|
beforedepend:: lexcmm.ml
|
|
|
|
|
|
|
|
# The test programs
|
1995-06-15 09:09:45 -07:00
|
|
|
|
1995-11-28 06:26:41 -08:00
|
|
|
$(PROGS:.out=.o): codegen
|
|
|
|
|
1995-07-24 05:48:07 -07:00
|
|
|
fib.out: main.c fib.o $(ARCH).o
|
|
|
|
$(CC) $(CFLAGS) -o fib.out -DINT_INT -DFUN=fib main.c fib.o $(ARCH).o
|
1995-06-15 09:09:45 -07:00
|
|
|
|
1995-07-24 05:48:07 -07:00
|
|
|
tak.out: main.c tak.o $(ARCH).o
|
|
|
|
$(CC) $(CFLAGS) -o tak.out -DUNIT_INT -DFUN=takmain main.c tak.o $(ARCH).o
|
1995-06-15 09:09:45 -07:00
|
|
|
|
1995-07-24 05:48:07 -07:00
|
|
|
quicksort.out: main.c quicksort.o $(ARCH).o
|
|
|
|
$(CC) $(CFLAGS) -o quicksort.out -DSORT -DFUN=quicksort main.c quicksort.o $(ARCH).o
|
1995-06-15 09:09:45 -07:00
|
|
|
|
1995-07-24 05:48:07 -07:00
|
|
|
quicksort2.out: main.c quicksort2.o $(ARCH).o
|
|
|
|
$(CC) $(CFLAGS) -o quicksort2.out -DSORT -DFUN=quicksort main.c quicksort2.o $(ARCH).o
|
1995-06-15 09:09:45 -07:00
|
|
|
|
1995-07-24 05:48:07 -07:00
|
|
|
soli.out: main.c soli.o $(ARCH).o
|
|
|
|
$(CC) $(CFLAGS) -o soli.out -DUNIT_INT -DFUN=solitaire main.c soli.o $(ARCH).o
|
1995-06-15 09:09:45 -07:00
|
|
|
|
1995-07-24 05:48:07 -07:00
|
|
|
integr.out: main.c integr.o $(ARCH).o
|
|
|
|
$(CC) $(CFLAGS) -o integr.out -DINT_FLOAT -DFUN=test main.c integr.o $(ARCH).o
|
1995-06-15 09:09:45 -07:00
|
|
|
|
1995-07-24 05:48:07 -07:00
|
|
|
tagged-fib.out: main.c tagged-fib.o $(ARCH).o
|
|
|
|
$(CC) $(CFLAGS) -o tagged-fib.out -DINT_INT -DFUN=fib main.c tagged-fib.o $(ARCH).o
|
1995-06-22 03:11:18 -07:00
|
|
|
|
1995-07-24 05:48:07 -07:00
|
|
|
tagged-tak.out: main.c tagged-tak.o $(ARCH).o
|
|
|
|
$(CC) $(CFLAGS) -o tagged-tak.out -DUNIT_INT -DFUN=takmain main.c tagged-tak.o $(ARCH).o
|
1995-06-22 03:11:18 -07:00
|
|
|
|
1995-07-24 05:48:07 -07:00
|
|
|
tagged-quicksort.out: main.c tagged-quicksort.o $(ARCH).o
|
|
|
|
$(CC) $(CFLAGS) -o tagged-quicksort.out -DSORT -DFUN=quicksort main.c tagged-quicksort.o $(ARCH).o
|
1995-06-22 03:11:18 -07:00
|
|
|
|
1995-07-24 05:48:07 -07:00
|
|
|
tagged-integr.out: main.c tagged-integr.o $(ARCH).o
|
|
|
|
$(CC) $(CFLAGS) -o tagged-integr.out -DINT_FLOAT -DFUN=test main.c tagged-integr.o $(ARCH).o
|
1995-06-22 03:11:18 -07:00
|
|
|
|
1995-11-21 12:27:50 -08:00
|
|
|
arith.out: mainarith.c arith.o $(ARCH).o
|
|
|
|
$(CC) $(CFLAGS) -o arith.out mainarith.c arith.o $(ARCH).o
|
|
|
|
|
1995-12-05 01:16:53 -08:00
|
|
|
checkbound.out: main.c checkbound.o $(ARCH).o
|
|
|
|
$(CC) $(CFLAGS) -o checkbound.out -DCHECKBOUND main.c checkbound.o $(ARCH).o
|
|
|
|
|
1995-06-15 09:09:45 -07:00
|
|
|
.SUFFIXES:
|
1995-11-01 10:11:36 -08:00
|
|
|
.SUFFIXES: .cmm .c .o .asm .S .ml .mli .cmo .cmi
|
1995-07-02 09:47:24 -07:00
|
|
|
|
|
|
|
.ml.cmo:
|
|
|
|
$(CAMLC) $(COMPFLAGS) -c $<
|
|
|
|
|
|
|
|
.mli.cmi:
|
|
|
|
$(CAMLC) $(COMPFLAGS) -c $<
|
1995-06-15 09:09:45 -07:00
|
|
|
|
|
|
|
.cmm.o:
|
1995-07-02 09:47:24 -07:00
|
|
|
$(CAMLRUN) $(CODEGEN) $*.cmm > $*.s
|
1995-06-15 09:09:45 -07:00
|
|
|
$(AS) $(ASFLAGS) -o $*.o $*.s
|
|
|
|
|
|
|
|
.asm.o:
|
|
|
|
$(AS) $(ASFLAGS) -o $*.o $*.asm
|
|
|
|
|
1995-11-01 10:11:36 -08:00
|
|
|
.S.o:
|
|
|
|
$(CC) -c $(ASFLAGS) $*.S
|
|
|
|
|
1995-07-02 09:47:24 -07:00
|
|
|
clean::
|
1995-07-24 05:48:07 -07:00
|
|
|
rm -f *.out *.cm[io] *.s *.o *~
|
1995-06-15 09:09:45 -07:00
|
|
|
|
1995-12-05 01:18:22 -08:00
|
|
|
$(PROGS:.out=.o): $(CODEGEN)
|
1995-07-02 09:47:24 -07:00
|
|
|
|
|
|
|
depend: beforedepend
|
|
|
|
$(CAMLDEP) $(DEPFLAGS) *.mli *.ml > .depend
|
|
|
|
|
|
|
|
include .depend
|