ocaml/camlp4/etc/Makefile

98 lines
3.2 KiB
Makefile

# $Id$
include ../config/Makefile
INCLUDES=-I ../camlp4 -I ../boot -I $(OTOP)/lex
OCAMLCFLAGS=-warn-error A $(INCLUDES)
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
OBJSX=$(OBJS:.cmo=.cmx)
INTF=pa_o.cmi
CAMLP4OM=pa_o.cmo pa_op.cmo ../meta/pr_dump.cmo
CAMLP4OMX=$(CAMLP4OM:.cmo=.cmx)
SHELL=/bin/sh
COUT=$(OBJS) camlp4o$(EXE)
COPT=$(OBJSX) camlp4o.opt
all: $(COUT) mkcamlp4.sh
opt: $(COPT)
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 $@
pr_rp.cmx: parserify.cmx pr_rp_main.cmx
$(OCAMLOPT) parserify.cmx pr_rp_main.cmx -a -o pr_rp.cmxa
mv pr_rp.cmxa pr_rp.cmx
mv pr_rp.$(A) pr_rp.$(O)
pr_op.cmx: parserify.cmx pr_op_main.cmx
$(OCAMLOPT) parserify.cmx pr_op_main.cmx -a -o pr_op.cmxa
mv pr_op.cmxa pr_op.cmx
mv pr_op.$(A) pr_op.$(O)
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
cd ../camlp4; $(MAKE) optp4 CAMLP4OPT=../etc/camlp4o.opt CAMLP4M="-I ../etc $(CAMLP4OMX)"
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
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 -
clean::
rm -f *.cm* *.pp[io] *.$(O) *.bak .*.bak *.out *.opt
rm -f mkcamlp4.sh camlp4o$(EXE) camlp4sch$(EXE)
depend:
cp .depend .depend.bak
> .depend
@for i in *.mli *.ml; do \
../tools/apply.sh pr_depend.cmo -- $(INCLUDES) $$i | \
sed -e 's| \.\./\.\.| $$(OTOP)|g' >> .depend; \
done
get_promote:
install:
-$(MKDIR) "$(LIBDIR)/camlp4" "$(BINDIR)"
cp $(OBJS) "$(LIBDIR)/camlp4/."
cp $(INTF) "$(LIBDIR)/camlp4/."
cp camlp4o$(EXE) "$(BINDIR)/."
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
cp mkcamlp4.sh "$(BINDIR)/mkcamlp4"
chmod a+x "$(BINDIR)/mkcamlp4"
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