1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
# Makefile,v
TOP=..
include ../config/Makefile
INCLUDES=-I ../main -I ../boot -I ../lib
OCAMLCFLAGS=$(DEBUG) $(OCAMLC_W_Y) $(WARNERR) $(INCLUDES)
D=o
SRC=../etc/pa_$(D).ml ../etc/pa_$(D)p.ml
COMP_OPT=-strict_parsing
COMP_OPT=-e "Grammar.Entry.obj Pcaml.interf" \
-e "Grammar.Entry.obj Pcaml.implem" \
-e "Grammar.Entry.obj Pcaml.top_phrase" \
-e "Grammar.Entry.obj Pcaml.use_file" \
RM=rm
all: out
out: $(CAMLP5N)$D.fast$(EXE)
opt: $(CAMLP5N)$D.fast.opt$(EXE)
$(CAMLP5N)$D.fast$(EXE): pa_$D_fast.cmo
$(RM) -f $@
cd ../main; $(MAKE) CAMLP5=../compile/$@ CAMLP5M="../compile/pa_$D_fast.cmo ../meta/pr_dump.cmo"
$(CAMLP5N)$D.fast.opt$(EXE): pa_$D_fast.cmx
$(RM) -f $@
cd ../main; $(MAKE) optp5 CAMLP5OPT=../compile/$@ CAMLP5M="../compile/pa_$D_fast.cmx ../meta/pr_dump.cmx"
pa_$D_fast.ml: compile.cmo comp_head.ml.tpl comp_trail.ml.tpl $(SRC)
cat $(SRC) | perl -n -e 'print unless /REMOVE FOR COMPILE/' > tmp.$D_concat.ml
../meta/camlp5r -I ../meta -I ../etc pa_extend.cmo q_MLast.cmo pa_macro.cmo pa_macro_gram.cmo r_keywords.cmo pr_r.cmo pr_ro.cmo pr_extend.cmo tmp.$D_concat.ml > tmp.$D_postprocessed.ml.ppo.TMP && mv tmp.$D_postprocessed.ml.ppo.TMP tmp.$D_postprocessed.ml.ppo
./strip-parser.pl tmp.$D_postprocessed.ml.ppo > $D_stripped.tmp
OCAMLN=$(OCAMLN) CAMLP5N=$(CAMLP5N) EXE=$(EXE) RM=$(RM) ./compile.sh $(COMP_OPT) $(SRC) > $D_fast.ml.tmp
cat comp_head.ml.tpl $D_stripped.tmp $D_fast.ml.tmp comp_trail.ml.tpl > pa_$D_fast.ml
install:
if test -f $(CAMLP5N)o.fast.opt$(EXE); then \
cp $(CAMLP5N)o.fast.opt$(EXE) "$(DESTDIR)$(BINDIR)/$(CAMLP5N)o.opt$(EXE)"; \
fi
if test -f pa_o_fast.cmx; then \
cp pa_o_fast.cmx pa_o_fast.o "$(DESTDIR)$(LIBDIR)/$(CAMLP5N)/."; \
fi
clean::
$(RM) -f *.cm* *.pp[io] *.[oa] *.lib *.obj *.bak .*.bak *.out *.opt
$(RM) -f *.fast tmp.* pa_*_fast.ml *.tmp *.ppo
depend:
cp .depend .depend.bak
> .depend
@export LC_ALL=C; for i in *.ml; do \
../tools/depend.sh $(INCLUDES) -name $(CAMLP5N) $$i \
>> .depend; \
done
include .depend
|