# Copyright (C) 2003 Mikolaj Konarski
#
# This file is part of the Dule compiler.
# The Dule compiler is released under the GNU General Public License (GPL).
# Please see the file Dule-LICENSE for license information.
#
# $Id: Makefile,v 1.30 2003/11/26 21:49:46 mikon Exp $

SOURCES := \
tools.ml error_rep.ml\
\
core_back.ml core_middle.ml core_front.ml \
\
middle_middle.ml \
\
mod_back.ml mod_middle.ml mod_front.ml \
\
main_common.ml parser.mly lexer.mll main.ml

all: nc #bcnl #nc #pnc
RESULT := dule

#OCAMLFLAGS := -noassert
OCAMLNCFLAGS := -inline 100

OCAMLC := ocamlc.opt
OCAMLOPT := ocamlopt.opt

.PHONY: test
test: 
	bash -c "time ./dule --no-prelude --composition --debugging \
	../test/strange_commented.dul"

.PHONY: test-good
test-good: 
	bash -c "time ./dule -c ../test/core.dul \
	--composition ../test/strange_commented.dul \
	../test/regression_short.dul \
	--no-composition ../test/tutorial_modules.dul"

.PHONY: test-all
test-all: 
	bash -c "time ./dule -c ../test/core.dul \
	--composition ../test/strange_commented.dul \
	../test/regression_short.dul \
	../test/regression_long.dul \
	--no-composition ../test/tutorial_modules.dul \
	../test/compiler.dul "

.PHONY: tests-all
tests-all: 
	bash -c "time { ./dule -c ../test/core.dul && \
	./dule --no-prelude --composition ../test/strange_commented.dul && \
	./dule --no-prelude --composition ../test/regression_short.dul && \
	./dule --no-prelude --composition ../test/regression_long.dul && \
	./dule ../test/tutorial_modules.dul && \
	./dule ../test/compiler.dul; }"

.PHONY: test-core
test-core: 
	bash -c "time ./dule -c ../test/core.dul"

.PHONY: test-strange
test-strange: 
	bash -c "time ./dule --no-prelude --composition \
	../test/strange_commented.dul"

.PHONY: test-short
test-short: 
	bash -c "time ./dule --no-prelude --composition \
	../test/regression_short.dul"

.PHONY: test-long
test-long: 
	bash -c "time ./dule --no-prelude --composition \
	../test/regression_long.dul"

.PHONY: test-tutorial
test-tutorial: 
	bash -c "time ./dule ../test/tutorial_modules.dul"

.PHONY: test-compiler
test-compiler: 
	bash -c "time ./dule ../test/compiler.dul"

.PHONY: test-errors
test-errors: 
	for i in ../test/error_reporting/*.dul; do \
          if echo; ./dule --no-prelude --composition $$i; \
		then echo; echo "The file "; echo $$i; \
                     echo " is not erroneous! Aborting!"; \
                     break; fi \
	done

ll:     top
	$(OCAMLC) -I +camlp4 -pp "camlp4o pa_extend.cmo q_MLast.cmo" \
	-c ll_parser.ml


OCAMLMAKEFILE := OCamlMakefile
-include $(OCAMLMAKEFILE)
