Source

ocaml-indent / OMakefile

camlspotter 0a0cf92 








camlspotter 341a5a9 



camlspotter 3ba2216 
camlspotter 341a5a9 





camlspotter c4779f8 
camlspotter 341a5a9 
camlspotter c4779f8 
camlspotter 341a5a9 




camlspotter 4aed057 

camlspotter eceb3b0 
camlspotter 5f6fb4d 
camlspotter 5e412f6 


camlspotter 341a5a9 
camlspotter afae5f4 
camlspotter 341a5a9 





camlspotter 7dbe88b 
camlspotter 341a5a9 
camlspotter afae5f4 
camlspotter 341a5a9 


camlspotter 76df415 



camlspotter 9053664 
camlspotter 76df415 





camlspotter b7aefda 
camlspotter df4cce3 
camlspotter b7aefda 
camlspotter 76df415 


camlspotter 11de61b 
camlspotter 76df415 

camlspotter df4cce3 
camlspotter 1f0ff49 








camlspotter df4cce3 



# How-to-build using OMake
#
# yes no | omake --install # to create OMakeroot for the first time

# If OMakeroot is here, include OMyMakefile
if $(file-exists OMakeroot)
   include OMyMakefile
   export

.PHONY: all install clean

OCAMLINCLUDES +=

OCAMLFLAGS    = -annot -bin-annot -w A-4-9 -warn-error A-4-9-32
OCAMLCFLAGS   +=
OCAMLOPTFLAGS +=
OCAML_LINK_FLAGS +=
OCAML_BYTE_LINK_FLAGS +=
OCAML_NATIVE_LINK_FLAGS +=

CAMLP4PACKS[]= planck compiler-libs.common

OCAMLPACKS[]= planck compiler-libs.common

OCAMLDEPFLAGS= -syntax camlp4o -package sexplib.syntax
OCAMLPPFLAGS= -syntax camlp4o -package sexplib.syntax

FILES[] =
    pos
    reader
    tokenstr
    xparser
    machine2
#    args
#    main

PROGRAM = ocaml-indent

OCAML_LIBS +=
OCAML_CLIBS +=
OCAML_OTHER_LIBS +=
OCAML_LIB_FLAGS +=

MyOCamlInstalledProgram($(PROGRAM), $(FILES))

.DEFAULT: ocaml-indent

clean:
	rm -f *.cm* *.o *output *.sp?t

.PHONY: test


TESTS=$(glob tests/*.ml)
test_out(file) = 
    return $(addprefix tests_out, $(removeprefix tests, $(file)))

TESTS_OUT=$(test_out $(TESTS))

foreach (file, $(TESTS))
  $(test_out $(file)): $(file) ./ocaml-indent
    mkdir_if_not_exists(tests_out)
    ./ocaml-indent $< > $@
  export

result.diff: $(TESTS_OUT)
    diff -x '*~' -c -r tests tests_out > $@

test: result.diff

SELFTESTS=$(glob *.ml *.mli)
selftest_out(file) = 
    return $(addprefix self_tests_out/, $(file))

SELFTESTS_OUT=$(selftest_out $(TESTS))

.PHONY: selftest
selftest: $(SELFTESTS_OUT)

#|ditto.
mkdir_if_not_exists(dir) =
  if $(not $(test -e $(dir))):
    mkdir $(dir) 
  return