Source

ocaml-indent / OMakefile

.PHONY: all install clean

OCAMLINCLUDES +=

OCAMLFLAGS    += -annot -w Aelz-9
OCAMLCFLAGS   +=
OCAMLOPTFLAGS +=
OCAML_LINK_FLAGS +=
OCAML_BYTE_LINK_FLAGS +=
OCAML_NATIVE_LINK_FLAGS +=

CAMLP4PACKS[]= sexplib

OCAMLPACKS[]= sexplib

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

FILES[] =
    misc
    linenum
    terminfo
    warnings
    location
    pos
    parser
    lexer
    reader
    filter
    main

lexer.cmi: parser.cmi

PROGRAM = indent

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

MyOCamlProgram($(PROGRAM), $(FILES))

.DEFAULT: 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) ./indent
    ./indent $< > $@
  export

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

test: result.diff