Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 629b5db569
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 79 lines (54 sloc) 1.705 kb
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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
include ../config.mk

IPROG=install -m 755
OCAMLLEX = ocamllex

OBJS = sExpr sExprLexer sExprParser sExpr_TS
INTF = $(foreach obj, $(OBJS),$(obj).cmi)
LIBS = sexpr.cma sexpr.cmxa

PROGRAMS = sexprpp

all: $(INTF) $(LIBS)

bins: $(PROGRAMS)

libs: $(LIBS)

sexprpp: sexprpp.ml all
$(OCAMLOPT) -I ../stdext stdext.cmxa sexpr.cmxa -linkpkg -o $@ $<

sexpr.cmxa: $(foreach obj,$(OBJS),$(obj).cmx)
$(OCAMLOPT) $(OCAMLOPTFLAGS) -a -o $@ $(foreach obj,$(OBJS),$(obj).cmx)

sexpr.cma: $(foreach obj,$(OBJS),$(obj).cmo)
$(OCAMLC) -a -o $@ $(foreach obj,$(OBJS),$(obj).cmo)

sExprLexer.ml: sExprLexer.mll
$(OCAMLLEX) $<

sExprLexer.mli: sExprParser.cmo sExprLexer.ml
$(OCAMLC) -i $^ > $@

sExprParser.ml: sExprParser.mly
$(OCAMLYACC) $<

sExprParser.mli: sExprParser.ml
$(OCAMLC) -i $< > $@

%.cmo: %.ml %.cmi
$(OCAMLC) -I ../stdext -c -o $@ $<

%.cmi: %.mli
$(OCAMLC) -c -o $@ $<

%.cmx: %.ml
$(OCAMLOPT) $(OCAMLOPTFLAGS) -I ../stdext -c -o $@ $<

%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<

META: META.in
sed 's/@VERSION@/$(VERSION)/g' < $< > $@

.PHONY: install
install: $(LIBS) META
mkdir -p $(OCAMLDESTDIR)
ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore sexpr META $(INTF) $(LIBS) *.a *.cmx $(SPOT)

.PHONY: bininstall
bininstall: path = $(DESTDIR)$(LIBEXEC)
bininstall: all
mkdir -p $(path)
$(IPROG) $(PROGRAMS) $(path)

.PHONY: uninstall
uninstall:
ocamlfind remove sexpr

.PHONY: binuninstall
binuninstall:
rm -f $(DESTDIR)$(LIBEXEC)$(PROGRAMS)

.PHONY: doc
doc: $(INTF)
python ../doc/doc.py $(DOCDIR) "sexpr" "package" "$(OBJS)" "." "stdext" ""

clean:
rm -f META *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(SPOT) sExprLexer.ml{,i} sExprParser.ml{,i} $(LIBS) $(PROGRAMS)
Something went wrong with that request. Please try again.