#
# Makefile.in
#
# $Id: /mirror/trunk/languages/jako/config/makefiles/root.in 28688 2008-06-23T00:33:41.905243Z coke  $
#

PERL          = @perl@
RM_F          = @rm_f@
JAKOC         = $(PERL) -I lib jakoc
INTERP        = ../../@test_prog@
BUILD_DIR     = @build_dir@
RECONFIGURE   = $(PERL) @build_dir@/tools/dev/reconfigure.pl
#CONDITIONED_LINE(darwin):
#CONDITIONED_LINE(darwin):# MACOSX_DEPLOYMENT_TARGET must be defined for OS X compilation/linking
#CONDITIONED_LINE(darwin):export MACOSX_DEPLOYMENT_TARGET := @osx_version@

.SUFFIXES: .jako .pir


# default target
all: \
    examples/bench.pir      \
    examples/board.pir      \
    examples/euclid.pir     \
    examples/fact.pir       \
    examples/fib.pir        \
    examples/hello.pir      \
    examples/leibniz.pir    \
    examples/life.pir       \
    examples/mandelbrot.pir \
    examples/mandelzoom.pir \
    examples/mops.pir       \
    examples/nci.pir        \
    examples/primes.pir     \
    examples/queens.pir     \
    examples/sub.pir

help :
	@echo ""
	@echo "Following targets are available for the user:"
	@echo ""
	@echo "  all  :             Compile the example scripts"
	@echo "                     This is the default."
	@echo ""
	@echo "  over:              clean and build again"
	@echo ""
	@echo "  test:              run the test suite"
	@echo ""
	@echo "  clean:             clean up temporary files"
	@echo ""
	@echo "  realclean:         clean up generated files"
	@echo ""
	@echo "  help:              print this help message"


# regenerate the Makefile
Makefile: config/makefiles/root.in
	cd $(BUILD_DIR) && $(RECONFIGURE) --step=gen::languages --languages=jako


# Compilation:
.jako.pir:
	$(JAKOC) $< > $@ || (rm -f $@ && false)

examples/bench.pir:      examples/bench.jako      jakoc
examples/board.pir:      examples/board.jako      jakoc
examples/euclid.pir:     examples/euclid.jako     jakoc
examples/fact.pir:       examples/fact.jako       jakoc
examples/fib.pir:        examples/fib.jako        jakoc
examples/hello.pir:      examples/hello.jako      jakoc
examples/leibniz.pir:    examples/leibniz.jako    jakoc
examples/life.pir:       examples/life.jako       jakoc
examples/mandelbrot.pir: examples/mandelbrot.jako jakoc
examples/mandelzoom.pir: examples/mandelzoom.jako jakoc
examples/mops.pir:       examples/mops.jako       jakoc
examples/nci.pir:        examples/nci.jako        jakoc
examples/primes.pir:     examples/primes.jako     jakoc
examples/queens.pir:     examples/queens.jako     jakoc
examples/sub.pir:        examples/sub.jako        jakoc


# Other targets:

clean:
	$(RM_F) "examples/*.pir" "examples/*.list" "t/*.pir"

realclean: clean
	$(RM_F) Makefile


over:
	@$(MAKE) clean
	@$(MAKE) all

test: all
	$(INTERP) examples/bench.pir
	$(INTERP) examples/board.pir
	$(INTERP) examples/euclid.pir
	$(INTERP) examples/fact.pir
	$(INTERP) examples/fib.pir
	$(INTERP) examples/hello.pir
	$(INTERP) examples/leibniz.pir
	$(INTERP) examples/life.pir
	$(INTERP) examples/mandelbrot.pir
	$(INTERP) examples/mandelzoom.pir
	$(INTERP) examples/mops.pir
	$(INTERP) examples/nci.pir
	$(INTERP) examples/primes.pir
	$(INTERP) examples/queens.pir
	$(INTERP) examples/sub.pir


#
# End of file.
#
