49 lines
1.2 KiB
Makefile
49 lines
1.2 KiB
Makefile
# $Id$
|
|
|
|
include ../config/Makefile
|
|
|
|
INCLUDES=
|
|
OCAMLCFLAGS=-warn-error A $(INCLUDES)
|
|
OBJS=stdpp.cmo token.cmo plexer.cmo gramext.cmo grammar.cmo extfold.cmo extfun.cmo fstream.cmo
|
|
SHELL=/bin/sh
|
|
TARGET=gramlib.cma
|
|
|
|
all: $(TARGET)
|
|
opt: $(TARGET:.cma=.cmxa)
|
|
|
|
$(TARGET): $(OBJS)
|
|
$(OCAMLC) $(OBJS) -a -o $(TARGET)
|
|
|
|
$(TARGET:.cma=.cmxa): $(OBJS:.cmo=.cmx)
|
|
$(OCAMLOPT) $(OBJS:.cmo=.cmx) -a -o $(TARGET:.cma=.cmxa)
|
|
|
|
clean::
|
|
rm -f *.cm[ioax] *.cmxa *.pp[io] *.$(O) *.$(A) *.bak .*.bak $(TARGET)
|
|
|
|
depend:
|
|
cp .depend .depend.bak
|
|
> .depend
|
|
@for i in *.mli *.ml; do \
|
|
../tools/apply.sh pr_depend.cmo -- $(INCLUDES) $$i >> .depend; \
|
|
done
|
|
|
|
promote:
|
|
cp $(OBJS) $(OBJS:.cmo=.cmi) ../boot/.
|
|
|
|
compare:
|
|
@for j in $(OBJS) $(OBJS:.cmo=.cmi); do \
|
|
if cmp $$j ../boot/$$j; then :; else exit 1; fi; \
|
|
done
|
|
|
|
install:
|
|
-$(MKDIR) "$(LIBDIR)/camlp4"
|
|
cp $(TARGET) *.mli "$(LIBDIR)/camlp4/."
|
|
cp *.cmi "$(LIBDIR)/camlp4/."
|
|
if test -f $(TARGET:.cma=.cmxa); then $(MAKE) installopt LIBDIR="$(LIBDIR)"; fi
|
|
|
|
installopt:
|
|
cp $(TARGET:.cma=.cmxa) *.cmx "$(LIBDIR)/camlp4/."
|
|
TARG=`echo "$(TARGET)" | sed -e "s/\.cma\$$/.$(A)/g"` && tar cf - $$TARG | (cd "$(LIBDIR)/camlp4/." && tar xf -)
|
|
|
|
include .depend
|