Permalink
Browse files

Fixed conditionnal API compilation.

  • Loading branch information...
sagotch committed Sep 5, 2018
1 parent 16fe41a commit fcfaae8679ce65be886fedd115e6cc99dd35f126
View
@@ -134,13 +134,25 @@ internal/compilation.ml:
.PHONY:internal/compilation.ml
%/dune: %/dune.in
sed -E "s/%%%API%%%/$(API)/g" $< > $@
sed -e "s/%%%API%%%/$(API)/g" -e "s/%%%API_DEP%%%/$(API_DEP)/g" $< > $@
###### [End] Generated files section
GENERATED_FILES_DEP = internal/gwlib.ml $(CAMLP5_FILES:=.ml) lib/dune internal/dune internal/compilation.ml
geneweb.install: $(GENERATED_FILES_DEP)
ifdef API
piqi:
$(foreach p, $(wildcard lib/*.proto), \
piqi of-proto --normalize $(p) ; \
piqic-ocaml -C lib/ --ext $(p).piqi ; \
)
$(RM) lib/*.piqi
else
piqi:
endif
.PHONY: piqi
geneweb.install:
dune build @install
.PHONY: geneweb.install
@@ -154,15 +166,7 @@ everything-exe:
dune build $(EVERYTHING_EXE:=.exe)
.DEFAULT_GOAL = exe
install-exe distrib-exe exe everything-exe: $(GENERATED_FILES_DEP)
piqi:
$(foreach p, $(wildcard lib/*.proto), \
piqi of-proto --normalize $(p) ; \
piqic-ocaml -C lib/ --ext $(p).piqi ; \
)
$(RM) lib/*.piqi
.PHONY: piqi
geneweb.install install-exe distrib-exe exe everything-exe: $(GENERATED_FILES_DEP) piqi
###### [BEGIN] Installation / Distribution section
@@ -237,7 +241,7 @@ distrib: distrib-exe
###### [END] Installation / Distribution section
clean:
$(RM) $(GENERATED_FILES_DEP)
$(RM)r distribution
$(RM) $(GENERATED_FILES_DEP) lib/*_piqi*.ml
$(RM) -r distribution
dune clean
.PHONY: clean
View
@@ -13,10 +13,12 @@ EXE=
OS_TYPE=
API=
API_DEP=
while [[ $# -ne 0 ]]; do
case $1 in
--api)
API_DEP="piqirun.ext redis-sync yojson curl";
API="-D API" ;;
*)
echo -e "\\x1b[33m[WARNING]\\x1b[0m Option $1 unknown and ignored.";;
@@ -84,6 +86,7 @@ print_tools() {
print_vars() {
echo "API=${API}"
echo "API_DEP=${API_DEP}"
}
print_makefile() {
Oops, something went wrong.

0 comments on commit fcfaae8

Please sign in to comment.