diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2018-02-12 15:22:56 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2018-02-12 15:22:56 +0100 |
commit | 5f94836f4d1adca31c502706831b9ac600c3f41f (patch) | |
tree | 4e00c09f198667bfb88965d8c9535e23dc70bbf1 /Makefile | |
parent | bb48738c4111f5f4e2faa40fe67ae1b8b9d7c2eb (diff) |
Update licence, add opam script
Diffstat (limited to 'Makefile')
-rwxr-xr-x | Makefile | 43 |
1 files changed, 28 insertions, 15 deletions
@@ -1,6 +1,9 @@ -OCAMLBUILD ?= ocamlbuild
+PREFIX=/usr/local
+BINDIR=$(PREFIX)/bin
PACKAGES=dynlink,curses,camlzip,xmlm,text,str,menhirLib,zarith,base
PATHS=src,src/odf,src/tree,src/expressions
+TARGET=licht
+OCB=ocamlbuild -pkgs $(PACKAGES) $(STUB_OPTIONS) $(MENHIR) -Is $(PATHS)
MENHIR=-use-menhir
@@ -10,41 +13,51 @@ LIB_STUB = $(LIB)_stub STUB_OPTIONS=-lflags -ccopt,-L.,-cclib,-l$(LIB_STUB)
BYTE_STUB_OPTIONS=$(STUB_OPTIONS)#,-dllib,-l$(LIB_STUB)
-.PHONY: stub
+.PHONY: stub clean
-all: native
+all: $(TARGET)
stub:
$(MAKE) -C stub LIB=$(LIB)
deps:
- opam install ocamlbuild curses camlzip xmlm ounit text menhir zarith base
+ opam install ocamlfind ocamlbuild curses camlzip xmlm ounit text menhir zarith base
byte: stub
- $(OCAMLBUILD) -pkgs $(PACKAGES) $(STUB_OPTIONS) $(MENHIR) -Is $(PATHS) main.byte
+ $(OCB) main.byte
-native: stub
- $(OCAMLBUILD) -tags optimize\(3\) -pkgs $(PACKAGES) $(STUB_OPTIONS) $(MENHIR) -Is $(PATHS) main.native
+$(TARGET): stub
+ $(OCB) -tags optimize\(3\) main.native
+ cp -L main.native $(TARGET)
doc:
- $(OCAMLBUILD) -pkgs $(PACKAGES) -menhir -Is $(PATHS) licht.docdir/index.html
+ $(OCB) licht.docdir/index.html
-test.byte: stub
- $(OCAMLBUILD) -pkgs $(PACKAGES),oUnit -cflag -g -lflag -g $(STUB_OPTIONS) $(MENHIR) -Is $(PATHS),tests,tests/odf,tests/tree $@
+install: $(TARGET)
+ mkdir -p $(BINDIR)
+ install $(TARGET) $(BINDIR)
+
+uninstall:
+ rm -rf $(BINDIR)/$(TARGET)
%.cmxs: stub
- $(OCAMLBUILD) -use-ocamlfind -tags optimize\(3\) -pkgs $(PACKAGES) $(MENHIR) -Is $(PATHS) $@
+ $(OCB) -use-ocamlfind -tags optimize\(3\) -Is $(PATHS) $@
test: test.byte
./test.byte
+test.byte: stub
+ $(OCB) -pkg oUnit -cflag -g -lflag -g -Is tests,tests/odf,tests/tree $@
+
relink: stub
- rm -f _build/main.native
- rm -f _build/main.byte
- rm -f _build/tests.byte
+ rm -f _build/*.native
+ rm -f _build/*.byte
make
clean:
+ rm -f licht
+ rm -f *.native
+ rm -f *.byte
make -C stub clean
- $(OCAMLBUILD) -clean
+ $(OCB) -clean
|