Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
58 lines (41 sloc) 1.73 KB
NAME = cass
PA_FILES = cass_ast cass_lexer cass_parser cass_printer cass_quotations
LIB_FILES = css
INCLS = \
$(shell ocamlfind query xmlm -predicates byte -r -format "-I %d %a") \
$(shell ocamlfind query str -predicates byte -r -format "-I %d %a") \
##########################################################
NAME_FILES = _build/pa_lib/pa_$(NAME).cmxa \
_build/pa_lib/pa_$(NAME).cma \
_build/lib/$(NAME).cma \
_build/lib/$(NAME).cmxa
_PA_FILES = $(addprefix _build/pa_lib/,$(PA_FILES))
__PA_FILES = $(addsuffix .cmi,$(_PA_FILES)) \
$(addsuffix .cmo,$(_PA_FILES)) \
$(addsuffix .cmx,$(_PA_FILES)) \
$(addsuffix .o,$(_PA_FILES))
_LIB_FILES = $(addprefix _build/lib/,$(LIB_FILES))
__LIB_FILES = $(addsuffix .cmi,$(_LIB_FILES)) \
$(addsuffix .cmo,$(_LIB_FILES)) \
$(addsuffix .cmx,$(_LIB_FILES)) \
$(addsuffix .o,$(_LIB_FILES))
FILES = $(NAME_FILES) $(__PA_FILES) $(__LIB_FILES)
all:
ocamlbuild pa_$(NAME).cma pa_$(NAME).cmxa
ocamlbuild -pp "camlp4o $(INCLS) pa_lib/pa_$(NAME).cma" $(NAME).cmxa $(NAME).cma
install:
ocamlfind install $(NAME) META $(FILES)
uninstall:
ocamlfind remove $(NAME)
clean:
ocamlbuild -clean
rm -rf test_exp.ml test.cmo test.cmx test.cmi test.o test_exp *~
.PHONY: test
test: all
ocamlbuild -pp "camlp4o $(INCLS) pa_lib/pa_$(NAME).cma" test.byte --
.PHONY: test_exp
test_exp: lib_test/test.ml
camlp4orf $(INCLS) _build/pa_lib/pa_$(NAME).cma lib_test/test.ml -printer o > _build/test_exp.ml
ocamlc -g -I +camlp4 dynlink.cma camlp4lib.cma $(INCLS) -annot -I _build/lib $(NAME).cma _build/test_exp.ml -o _build/test_exp
debug: all
camlp4orf $(INCLS) _build/pa_lib/pa_$(NAME).cma test.ml