neater build system

This commit is contained in:
2022-01-20 20:07:42 +11:00
committed by aaron-jack-manning
parent d295103284
commit a8cdd2411f
16 changed files with 157 additions and 83 deletions

View File

@ -1,8 +1,8 @@
STANDARD_FLAGS = -S -O3
STANDARD_FLAGS = -O3
STANDARD_COMPILE = ocamlopt $(STANDARD_FLAGS) -nopervasives -c
LIB_NAME = library
# compiles the entire custom standard library
compile:
build:
# fromStdlib manages things that need to be exposed from the standard library
ocamlopt $(STANDARD_FLAGS) -c fromStdlib.mli fromStdlib.ml
@ -20,7 +20,11 @@ compile:
$(STANDARD_COMPILE) set.mli set.ml
$(STANDARD_COMPILE) tree.mli tree.ml
$(STANDARD_COMPILE) string.mli string.ml
$(STANDARD_COMPILE) char.mli char.ml
$(STANDARD_COMPILE) bool.mli bool.ml
ocamlopt -a fromStdlib.cmx exposed.cmx int.cmx float.cmx option.cmx stack.cmx list.cmx map.cmx queue.cmx set.cmx tree.cmx string.cmx -o $(LIB_NAME).cmxa
# clean removes all except source files. autogenerated mli files are also removed.
clean:
rm -f *.o *.a *.s *.cmi *.cmx *.cmxa *.cmo *.cma
rm -f *.o *.a *.s *.cmi *.cmx *.cmxa *.cmo *.cma