2001-09-07 00:55:07 -07:00
|
|
|
# $Id$
|
|
|
|
|
|
|
|
include ../config/Makefile
|
|
|
|
|
2002-01-04 06:33:11 -08:00
|
|
|
INCLUDES=-I ../camlp4 -I ../boot -I $(OTOP)/lex
|
2004-11-30 10:57:04 -08:00
|
|
|
OCAMLCFLAGS=-warn-error A $(INCLUDES)
|
2004-07-13 05:19:15 -07:00
|
|
|
OBJS=q_phony.cmo pa_o.cmo pa_op.cmo pa_oop.cmo pa_ru.cmo pa_extfold.cmo pa_extfun.cmo pa_fstream.cmo pa_ifdef.cmo pr_r.cmo pr_rp.cmo pr_o.cmo pr_op.cmo pr_extend.cmo pr_extfun.cmo pr_null.cmo pr_depend.cmo
|
2004-05-12 08:22:48 -07:00
|
|
|
|
2003-07-14 10:59:30 -07:00
|
|
|
OBJSX=$(OBJS:.cmo=.cmx)
|
2001-09-07 00:55:07 -07:00
|
|
|
INTF=pa_o.cmi
|
|
|
|
CAMLP4OM=pa_o.cmo pa_op.cmo ../meta/pr_dump.cmo
|
2003-07-14 10:59:30 -07:00
|
|
|
CAMLP4OMX=$(CAMLP4OM:.cmo=.cmx)
|
2001-09-07 00:55:07 -07:00
|
|
|
SHELL=/bin/sh
|
2004-05-12 22:20:10 -07:00
|
|
|
COUT=$(OBJS) camlp4o$(EXE)
|
2003-07-14 10:59:30 -07:00
|
|
|
COPT=$(OBJSX) camlp4o.opt
|
2001-09-07 00:55:07 -07:00
|
|
|
|
|
|
|
all: $(COUT) mkcamlp4.sh
|
|
|
|
opt: $(COPT)
|
|
|
|
|
2003-07-10 05:28:35 -07:00
|
|
|
pr_rp.cmo: parserify.cmo pr_rp_main.cmo
|
|
|
|
$(OCAMLC) parserify.cmo pr_rp_main.cmo -a -o $@
|
|
|
|
|
|
|
|
pr_op.cmo: parserify.cmo pr_op_main.cmo
|
|
|
|
$(OCAMLC) parserify.cmo pr_op_main.cmo -a -o $@
|
|
|
|
|
2003-10-30 01:52:55 -08:00
|
|
|
pr_rp.cmx: parserify.cmx pr_rp_main.cmx
|
2003-12-30 15:59:10 -08:00
|
|
|
$(OCAMLOPT) parserify.cmx pr_rp_main.cmx -a -o pr_rp.cmxa
|
|
|
|
mv pr_rp.cmxa pr_rp.cmx
|
2004-07-13 05:19:15 -07:00
|
|
|
mv pr_rp.$(A) pr_rp.$(O)
|
2003-10-30 01:52:55 -08:00
|
|
|
|
|
|
|
pr_op.cmx: parserify.cmx pr_op_main.cmx
|
2003-12-30 15:59:10 -08:00
|
|
|
$(OCAMLOPT) parserify.cmx pr_op_main.cmx -a -o pr_op.cmxa
|
|
|
|
mv pr_op.cmxa pr_op.cmx
|
2004-07-13 05:19:15 -07:00
|
|
|
mv pr_op.$(A) pr_op.$(O)
|
2003-10-30 01:52:55 -08:00
|
|
|
|
2001-09-07 00:55:07 -07:00
|
|
|
camlp4o$(EXE): ../camlp4/camlp4$(EXE) $(CAMLP4OM)
|
|
|
|
rm -f camlp4o$(EXE)
|
|
|
|
cd ../camlp4; $(MAKE) CAMLP4=../etc/camlp4o$(EXE) CAMLP4M="-I ../etc $(CAMLP4OM)"
|
|
|
|
|
|
|
|
camlp4o.opt: $(CAMLP4OMX)
|
|
|
|
rm -f camlp4o.opt
|
2001-09-10 02:56:14 -07:00
|
|
|
cd ../camlp4; $(MAKE) optp4 CAMLP4OPT=../etc/camlp4o.opt CAMLP4M="-I ../etc $(CAMLP4OMX)"
|
2001-09-07 00:55:07 -07:00
|
|
|
|
2004-11-26 17:04:19 -08:00
|
|
|
mkcamlp4.sh: mkcamlp4.sh.tpl version.sh
|
|
|
|
sed -e "s!LIBDIR!$(LIBDIR)!g" -e "/define VERSION/r version.sh" \
|
|
|
|
mkcamlp4.sh.tpl > mkcamlp4.sh
|
|
|
|
|
|
|
|
version.sh : $(OTOP)/stdlib/sys.ml
|
|
|
|
sed -n -e 's/;;//' \
|
|
|
|
-e '/let *ocaml_version *= */s//VERSION=/p' \
|
|
|
|
<$(OTOP)/stdlib/sys.ml >version.sh
|
2001-09-07 00:55:07 -07:00
|
|
|
|
2003-07-10 05:28:35 -07:00
|
|
|
bootstrap_l:
|
|
|
|
../boot/camlp4 ./pa_$Lr.cmo ./q_phony.cmo -I ../boot pa_extend.cmo ./pr_r.cmo ./pr_extend.cmo ./pr_rp.cmo pa_$L.ml > tmp
|
|
|
|
mv pa_$Lr.ml pa_$Lr.ml.old
|
|
|
|
sed -e 's/^;; \(.*\)$$/(* \1 *)/' -e 's/^; \(.*\)$$/(* \1 *)/' -e 's|./pa_$Lr.cmo|pa_r.cmo pa_rp.cmo|' -e 's/$$Id.*\$$/File generated by pretty print; do not edit!/' tmp > pa_$Lr.ml
|
|
|
|
rm -f tmp
|
|
|
|
|
|
|
|
compare_l:
|
|
|
|
../boot/camlp4 ./pa_$Lr.cmo ./q_phony.cmo -I ../boot pa_extend.cmo ./pr_r.cmo ./pr_extend.cmo ./pr_rp.cmo pa_$L.ml | sed -e 's/^;; \(.*\)$$/(* \1 *)/' -e 's/^; \(.*\)$$/(* \1 *)/' -e 's|./pa_$Lr.cmo|pa_r.cmo pa_rp.cmo|' -e 's/$$Id.*\$$/File generated by pretty print; do not edit!/' | diff -c pa_$Lr.ml -
|
2001-09-07 00:55:07 -07:00
|
|
|
|
|
|
|
clean::
|
2004-07-13 05:19:15 -07:00
|
|
|
rm -f *.cm* *.pp[io] *.$(O) *.bak .*.bak *.out *.opt
|
2003-07-10 05:28:35 -07:00
|
|
|
rm -f mkcamlp4.sh camlp4o$(EXE) camlp4sch$(EXE)
|
2001-09-07 00:55:07 -07:00
|
|
|
|
|
|
|
depend:
|
|
|
|
cp .depend .depend.bak
|
|
|
|
> .depend
|
|
|
|
@for i in *.mli *.ml; do \
|
2002-02-12 09:25:14 -08:00
|
|
|
../tools/apply.sh pr_depend.cmo -- $(INCLUDES) $$i | \
|
|
|
|
sed -e 's| \.\./\.\.| $$(OTOP)|g' >> .depend; \
|
2001-09-07 00:55:07 -07:00
|
|
|
done
|
|
|
|
|
|
|
|
get_promote:
|
|
|
|
|
|
|
|
install:
|
2003-07-15 02:34:47 -07:00
|
|
|
-$(MKDIR) "$(LIBDIR)/camlp4" "$(BINDIR)"
|
2003-07-10 05:28:35 -07:00
|
|
|
cp $(OBJS) "$(LIBDIR)/camlp4/."
|
|
|
|
cp $(INTF) "$(LIBDIR)/camlp4/."
|
2004-05-12 22:20:10 -07:00
|
|
|
cp camlp4o$(EXE) "$(BINDIR)/."
|
2004-07-13 05:19:15 -07:00
|
|
|
if test -f camlp4o.opt; then \
|
|
|
|
cp camlp4o.opt "$(BINDIR)/camlp4o.opt$(EXE)"; \
|
|
|
|
cp $(OBJSX) "$(LIBDIR)/camlp4/."; \
|
|
|
|
for file in $(OBJSX); do \
|
|
|
|
cp "`echo $$file | sed -e 's/\.cmx$$/.$(O)/'`" "$(LIBDIR)/camlp4/."; \
|
|
|
|
done ; \
|
|
|
|
fi
|
2003-07-10 05:28:35 -07:00
|
|
|
cp mkcamlp4.sh "$(BINDIR)/mkcamlp4"
|
|
|
|
chmod a+x "$(BINDIR)/mkcamlp4"
|
2001-09-07 00:55:07 -07:00
|
|
|
|
|
|
|
pr_extend.cmo: pa_extfun.cmo
|
|
|
|
pr_o.cmo: pa_extfun.cmo
|
|
|
|
pr_op.cmo: pa_extfun.cmo
|
|
|
|
pr_r.cmo: pa_extfun.cmo
|
|
|
|
pr_rp.cmo: pa_extfun.cmo
|
|
|
|
|
|
|
|
include .depend
|