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 @@
tmp.dk
_build/
*.native
*.byte
*.glob
*.vo
test.dk
test.v
sigmaid
......@@ -2,8 +2,15 @@
DKS = $(wildcard *.dk)
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
.SUFFIXES: .dk .dko .ml .native .v .vo
.SUFFIXES: .dk .dko .ml .native .byte .v .vo
.dk.dko:
dkcheck -e -nc $<
......@@ -13,21 +20,31 @@ DKOS = $(DKS:.dk=.dko)
.ml.native:
ocamlbuild -use-menhir $@
.ml.byte:
ocamlbuild -use-menhir $@
all: $(DKOS) sigmaid.native
all: $(DKOS) sigmaid
depend: .depend
.depend:
dkdep pts.dk dk_*.dk > .depend
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
./sigmaid.native test.sigma
test.dk: sigmaid.$(COMPILE_MODE)
./sigmaid.$(COMPILE_MODE) test.sigma
test.v: sigmaid.native
./sigmaid.native test.sigma
test.v: sigmaid.$(COMPILE_MODE)
./sigmaid.$(COMPILE_MODE) test.sigma
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