Skip to content

Instantly share code, notes, and snippets.

@sgrove
Created March 20, 2015 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgrove/f9f78c2a4347bb6ea9c7 to your computer and use it in GitHub Desktop.
Save sgrove/f9f78c2a4347bb6ea9c7 to your computer and use it in GitHub Desktop.
manual reloadlib target
.PHONY: all clean tower test
DIRTY_FLAG=$(shell git diff-index --quiet HEAD || echo "dirty")
ifeq ($(DIRTY_FLAG),dirty)
DIRTY=true
else
DIRTY=false
endif
all: tower
tower.native: towerVersion.ml
ocamlbuild -use-ocamlfind -cflags -w,@f@p@u@y -Is cli,lib tower.native
tower: tower.native
mv tower.native tower
towerVersion.ml:
printf "let git_rev = \"" > towerVersion.ml
git rev-parse HEAD | tr -d '\n' >> towerVersion.ml
printf "\"\nlet git_dirty = $(DIRTY)\n" >> towerVersion.ml
test:
$(MAKE)
$(MAKE) -C test
reloadlib:
ocamlfind ocamlc -package xmlm -c -o xmlRope.cmi lib/xmlRope.mli
ocamlfind ocamlc -package xmlm -c -o xmlRope.cmo lib/xmlRope.ml
ocamlfind ocamlc -package xmlm -c -o blueprint.cmi lib/blueprint.mli
ocamlfind ocamlc -package xmlm -c -o blueprint.cmo lib/blueprint.ml
clean:
ocamlbuild -clean
rm -f towerVersion.ml tower
$(MAKE) -C test clean
rm *.cmi
rm *.cmo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment