Source

ocaml-indent / OMakefile

The default branch has multiple heads

camlspotter 0a0cf92 








camlspotter 341a5a9 



camlspotter 2cf610a 
camlspotter 341a5a9 





camlspotter 5f6fb4d 
camlspotter 341a5a9 
camlspotter 5f6fb4d 
camlspotter 341a5a9 




camlspotter 4aed057 

camlspotter eceb3b0 
camlspotter 5f6fb4d 
camlspotter e0b335b 
camlspotter 69ca6e2 
camlspotter 341a5a9 

camlspotter afae5f4 
camlspotter 341a5a9 





camlspotter 7ac7568 
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 




camlspotter 1c0b04e 
# 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 -w A-4-9 -warn-error A-4-9-32
OCAMLCFLAGS   +=
OCAMLOPTFLAGS +=
OCAML_LINK_FLAGS +=
OCAML_BYTE_LINK_FLAGS +=
OCAML_NATIVE_LINK_FLAGS +=

CAMLP4PACKS[]= sexplib compiler-libs.common

OCAMLPACKS[]= sexplib compiler-libs.common

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

FILES[] =
    pos
    reader
    tokenstr
    xparser
    machine
    args
    main

PROGRAM = ocaml-indent

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

MyOCamlProgram($(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

WithOCamlVeryClean()