Merge branch 'ocamlbuild-port' of ssh://git.nguyen.vg/tatoo into ocamlbuild-port
[tatoo.git] / Makefile.in
index 5443f6e..f2df8d4 100644 (file)
@@ -1,26 +1,47 @@
 CAMLP4FLAGS=@CAMLP4FLAGS@
-PPOPTSFLAGS= $($CAMLP4FLAGS:%=ppopt(%))
-OCAMLBUILDFLAGS=-j 0 -use-ocamlfind @OCAMLBUILDFLAGS@
+OCAMLBUILDFLAGS=-j 0 -use-ocamlfind @OCAMLBUILDFLAGS@  $(CAMLP4FLAGS:%=-tag %)
 OCAMLBUILD=@OCAMLBUILD@
+PACKAGE = @PACKAGE_TARNAME@
+NATIVE=$(PACKAGE).native
+BYTE=$(PACKAGE).byte
+TARGETS=$(NATIVE)
 
-TARGETS=tatoo.native
 ifeq ($(BYTE), true)
-       TARGETS += tatoo.byte
+       TARGETS += $(BYTE)
 endif
+
 INLINE=@INLINE@
-TAGS= inline($INLINE)
+TAGS= -tag 'inline($(INLINE))'
 
 
-.PHONY: clean distclean
+.PHONY: clean distclean test test_byte test_native do_test all $(TARGETS)
 
-all: $(TARGETS)
+all:
        @
 
 %:
-       @ $(OCAMLBUILD) $(OCAMLBUILDFLAGS)  $(PPOPTFLAGS:%=-tag %) $@
+       @ $(OCAMLBUILD) $(OCAMLBUILDFLAGS)  $@
 
 clean:
        @ $(OCAMLBUILD) $(OCAMLBUILDFLAGS) -clean
 
 distclean: clean
        @ rm -rf configure config.log config.status autom4te.cache Makefile
+
+
+test:
+       ${MAKE} test_native
+       ${MAKE} test_byte
+
+test_native: PROG=$(NATIVE)
+test_native: $(NATIVE) do_test
+
+test_byte: PROG=$(BYTE)
+test_byte: $(BYTE) do_test
+
+
+do_test:
+               for test in tests/test_*.sh ; \
+               do \
+                       $${test} $(PROG) tests ; \
+               done