From: Siraaj Khandkar Date: Mon, 30 Apr 2018 16:13:10 +0000 (-0400) Subject: Lay down Tiger build skeleton X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=1c975d0844f1b642646212180f34216af1ca8328;p=tiger.ml.git Lay down Tiger build skeleton --- diff --git a/tiger/.gitignore b/tiger/.gitignore new file mode 100644 index 0000000..02cd8d8 --- /dev/null +++ b/tiger/.gitignore @@ -0,0 +1,2 @@ +_build/ +bin/ diff --git a/tiger/Makefile b/tiger/Makefile new file mode 100644 index 0000000..9917366 --- /dev/null +++ b/tiger/Makefile @@ -0,0 +1,30 @@ +MAKEFLAGS := --no-builtin-rules + +EXE_TYPE := byte # byte | native +EXECUTABLES := tiger +OCAMLBUILD_FLAGS := -I src/exe -I src/lib/tiger +OCAMLBUILD := ocamlbuild $(OCAMLBUILD_FLAGS) + +.PHONY: \ + all \ + build \ + clean \ + test + +all: + $(MAKE) clean + $(MAKE) build + $(MAKE) test + +build: + $(OCAMLBUILD) $(addsuffix _main.$(EXE_TYPE),$(EXECUTABLES)) + mkdir -p bin/exe + $(foreach exe,$(EXECUTABLES),cp _build/src/exe/$(exe)_main.$(EXE_TYPE) bin/exe/$(exe)) + rm $(addsuffix _main.$(EXE_TYPE),$(EXECUTABLES)) + +clean: + $(OCAMLBUILD) -clean + rm -rf ./bin + +test: bin/exe/tiger + ./$< diff --git a/tiger/src/exe/tiger_main.ml b/tiger/src/exe/tiger_main.ml new file mode 100644 index 0000000..bd1a443 --- /dev/null +++ b/tiger/src/exe/tiger_main.ml @@ -0,0 +1,3 @@ +let () = + let bar = String.make 80 '-' in + Printf.printf "%s\nTiger says: %S\n%s\n" bar Tiger.Growl.text bar; diff --git a/tiger/src/exe/tiger_main.mli b/tiger/src/exe/tiger_main.mli new file mode 100644 index 0000000..e69de29 diff --git a/tiger/src/lib/tiger/tiger.ml b/tiger/src/lib/tiger/tiger.ml new file mode 100644 index 0000000..9844f26 --- /dev/null +++ b/tiger/src/lib/tiger/tiger.ml @@ -0,0 +1 @@ +module Growl = struct let text = "Grrrrrrrrr!" end