Commit 56a237dd authored by Raphaël Cauderlier's avatar Raphaël Cauderlier
Browse files

Install target and byte/native switch

parent c22da22d
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
tmp.dk tmp.dk
_build/ _build/
*.native *.native
*.byte
*.glob *.glob
*.vo *.vo
test.dk test.dk
test.v test.v
sigmaid
...@@ -2,8 +2,15 @@ ...@@ -2,8 +2,15 @@
DKS = $(wildcard *.dk) DKS = $(wildcard *.dk)
DKOS = $(DKS:.dk=.dko) DKOS = $(DKS:.dk=.dko)
# Change COMPILE_MODE to byte if you want bytecode
# instead of machine code
COMPILE_MODE = native
# The destination of the install target, without trailing slash
INSTALL_DIR = /usr/local/bin
.PHONY: clean depend .PHONY: clean depend
.SUFFIXES: .dk .dko .ml .native .v .vo .SUFFIXES: .dk .dko .ml .native .byte .v .vo
.dk.dko: .dk.dko:
dkcheck -e -nc $< dkcheck -e -nc $<
...@@ -13,21 +20,31 @@ DKOS = $(DKS:.dk=.dko) ...@@ -13,21 +20,31 @@ DKOS = $(DKS:.dk=.dko)
.ml.native: .ml.native:
ocamlbuild -use-menhir $@ ocamlbuild -use-menhir $@
.ml.byte:
ocamlbuild -use-menhir $@
all: $(DKOS) sigmaid.native all: $(DKOS) sigmaid
depend: .depend depend: .depend
.depend: .depend:
dkdep pts.dk dk_*.dk > .depend dkdep pts.dk dk_*.dk > .depend
clean: clean:
rm -rf *.dko *.vo .depend tmp.dk test.dk sigmaid.native _build rm -rf *.dko *.vo *.glob .depend tmp.dk \
test.dk test.v \
sigmaid sigmaid.native sigmaid.byte _build
sigmaid: sigmaid.$(COMPILE_MODE)
ln -s sigmaid.$(COMPILE_MODE) sigmaid
install: sigmaid
install sigmaid $(INSTALL_DIR)/
test.dk: sigmaid.native test.dk: sigmaid.$(COMPILE_MODE)
./sigmaid.native test.sigma ./sigmaid.$(COMPILE_MODE) test.sigma
test.v: sigmaid.native test.v: sigmaid.$(COMPILE_MODE)
./sigmaid.native test.sigma ./sigmaid.$(COMPILE_MODE) test.sigma
test.dko: test.dk dk_obj_examples.dko test.dko: test.dk dk_obj_examples.dko
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment