Lay down Tiger build skeleton
authorSiraaj Khandkar <siraaj@khandkar.net>
Mon, 30 Apr 2018 16:13:10 +0000 (12:13 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Mon, 30 Apr 2018 16:13:10 +0000 (12:13 -0400)
tiger/.gitignore [new file with mode: 0644]
tiger/Makefile [new file with mode: 0644]
tiger/src/exe/tiger_main.ml [new file with mode: 0644]
tiger/src/exe/tiger_main.mli [new file with mode: 0644]
tiger/src/lib/tiger/tiger.ml [new file with mode: 0644]

diff --git a/tiger/.gitignore b/tiger/.gitignore
new file mode 100644 (file)
index 0000000..02cd8d8
--- /dev/null
@@ -0,0 +1,2 @@
+_build/
+bin/
diff --git a/tiger/Makefile b/tiger/Makefile
new file mode 100644 (file)
index 0000000..9917366
--- /dev/null
@@ -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 (file)
index 0000000..bd1a443
--- /dev/null
@@ -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 (file)
index 0000000..e69de29
diff --git a/tiger/src/lib/tiger/tiger.ml b/tiger/src/lib/tiger/tiger.ml
new file mode 100644 (file)
index 0000000..9844f26
--- /dev/null
@@ -0,0 +1 @@
+module Growl = struct let text = "Grrrrrrrrr!" end
This page took 0.036561 seconds and 4 git commands to generate.