# $Id: /mirror/trunk/config/gen/makefiles/languages.in 35746 2009-01-18T12:14:08.707508Z bernhard  $

# setup of commands
@make_set_make@
PERL          = @perl@
MAKE          = @make_c@
RM_F          = @rm_f@
BUILD_DIR     = @build_dir@
RECONFIGURE   = $(PERL) @build_dir@/tools/dev/reconfigure.pl
GIT           = git
SVN           = svn

# List of languages that are currently managed in the Parrot svn repository
# When adding or removing languages, please update the list
LANGUAGES = \
    abc APL \
    BASIC befunge bf \
    c99 cardinal chitchat cola \
    dotnet \
    ecmascript \
    forth \
    jako json \
    lazy-k lisp lolcode lua \
    markdown \
    ook \
    parrot_compiler perl6 pheme PIR pipp punie pynie \
    regex \
    scheme squaak \
    unlambda urm \
    WMLScript \
    Zcode

# the default target
all: $(LANGUAGES)

# This is a listing of all targets, that are meant to be called by users
help:
	@echo ""
	@echo "Following targets are available for the user:"
	@echo ""
	@echo "  all:           Make a lot of language implementations."
	@echo "                 This is the default."
	@echo ""
	@echo "  test:          Same as test-unified."
	@echo ""
	@echo "  test-unified:  Unified test suite for a lot of languages."
	@echo ""
	@echo "  test-separate: Run 'make test' in the individual lang dirs."
	@echo ""
	@echo "  clean:         Clean up a lot of languages."
	@echo ""
	@echo "  help:          Print this help message."
	@echo ""
	@echo "Following languages are available in Parrot's svn repository:"
	@echo "  $(LANGUAGES)"
	@echo ""
	@echo "A particular language <lang> can be built, tested and cleand up"
	@echo "  make <lang>"
	@echo "  make <lang>.test"
	@echo "  make <lang>.clean"
	@echo "  make <lang>.realclean"
	@echo ""
	@echo "For the status of individual languages see"
	@echo "https://trac.parrot.org/parrot/wiki/Languages."
	@echo ""
	@echo "Some languages are managed in other repositories."
	@echo "Here are some helpers for checking these languages out."
	@echo "Note that these commands don't guarantee that commits are possible."
	@echo ""
	@echo "  co-all:        Try to fetch externally managed languages"
	@echo ""
	@echo "  co-eclectus:   Try to fetch eclectus"
	@echo ""
	@echo "  co-gil:        Try to fetch gil"
	@echo ""
	@echo "  co-hq9plus:    Try to fetch HQ9+"
	@echo ""
	@echo "  co-m4:         Try to fetch Parrot m4"
	@echo ""
	@echo "  co-pjs:        Try to fetch PJS"
	@echo ""
	@echo "  co-primitivearc: Try to fetch primitivearc"
	@echo ""
	@echo "  co-tcl:        Try to fetch Partcl"
	@echo ""

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

test:   test-unified

test-unified: all
	$(PERL) t/harness

test-separate: all \
    abc.test APL.test \
    befunge.test bf.test \
    c99.test cardinal.test chitchat.test cola.test \
    dotnet.test \
    ecmascript.test \
    forth.test \
    jako.test json.test \
    lazy-k.test lisp.test lolcode.test lua.test \
    ook.test \
    parrot_compiler.test perl6.test pheme.test PIR.test pipp.test punie.test pynie.test \
    regex.test \
    scheme.test squaak.test \
    urm.test unlambda.test \
    WMLScript.test \
    Zcode.test

clean: \
    abc.clean APL.clean \
    BASIC.clean befunge.clean bf.clean \
    c99.clean cardinal.clean chitchat.clean cola.clean \
    dotnet.clean \
    ecmascript.clean \
    forth.clean \
    jako.clean json.clean \
    lisp.clean \
    lolcode.clean lua.clean \
    markdown.clean \
    ook.clean \
    parrot_compiler.clean perl6.clean pheme.clean PIR.clean pipp.clean punie.clean pynie.clean \
    regex.clean \
    scheme.clean squaak.clean \
    urm.clean \
    WMLScript.clean \
    Zcode.clean

realclean: \
    abc.realclean APL.realclean \
    befunge.realclean bf.realclean \
    c99.realclean cardinal.realclean chitchat.realclean cola.realclean \
    dotnet.realclean \
    ecmascript.realclean \
    forth.realclean \
    jako.realclean json.realclean \
    lazy-k.realclean lisp.realclean lolcode.realclean lua.realclean \
    markdown.realclean \
    ook.realclean \
    parrot_compiler.realclean perl6.realclean pheme.realclean PIR.realclean pipp.realclean punie.realclean pynie.realclean \
    regex.realclean \
    scheme.realclean squaak.realclean \
    urm.realclean unlambda.realclean \
    WMLScript.realclean \
    Zcode.realclean


#
# Language specific targets
#

# The *.dummy targets are a replacement for the target .PHONY in 'GNU make'

abc : abc.dummy
abc.dummy:
	- $(MAKE) abc
abc.test:
	- $(MAKE) abc test
abc.clean:
	- $(MAKE) abc clean
abc.realclean:
	- $(MAKE) abc realclean

APL : APL.dummy
APL.dummy:
	- $(MAKE) APL
APL.test:
	- $(MAKE) APL test
APL.clean:
	- $(MAKE) APL clean
APL.realclean:
	- $(MAKE) APL realclean

BASIC : BASIC.dummy
BASIC.dummy:
# don't know how to build BASIC
BASIC.test:
# Don't know how to test BASIC
BASIC.clean:
# Don't know how to clean BASIC

befunge : befunge.dummy
befunge.dummy:
	- $(MAKE) befunge
befunge.test:
	- $(MAKE) befunge test
befunge.clean:
	- $(MAKE) befunge clean
befunge.realclean:
	- $(MAKE) befunge realclean

bf : bf.dummy
bf.dummy:
	- $(MAKE) bf
bf.test:
	- $(MAKE) bf test
bf.clean:
	- $(MAKE) bf clean
bf.realclean:
	- $(MAKE) bf realclean

c99 : c99.dummy
c99.dummy:
	- $(MAKE) c99
c99.test:
	- $(MAKE) c99 test
c99.clean:
	- $(MAKE) c99 clean
c99.realclean:
	- $(MAKE) c99 realclean

cardinal : cardinal.dummy
cardinal.dummy:
	- $(MAKE) cardinal
cardinal.test:
	- $(MAKE) cardinal test
cardinal.clean:
	- $(MAKE) cardinal clean
cardinal.realclean:
	- $(MAKE) cardinal realclean

chitchat : chitchat.dummy
chitchat.dummy:
	- $(MAKE) chitchat
chitchat.test:
	- $(MAKE) chitchat test
chitchat.clean:
	- $(MAKE) chitchat clean
chitchat.realclean:
	- $(MAKE) chitchat realclean

cola : cola.dummy
cola.dummy:
	- $(MAKE) cola
cola.test:
	- $(MAKE) cola test
cola.clean:
	- $(MAKE) cola clean
cola.realclean:
	- $(MAKE) cola realclean

dotnet : dotnet.dummy
dotnet.dummy:
	cd dotnet && $(PERL) Configure.pl
	- $(MAKE) dotnet
dotnet.test:
	- $(MAKE) dotnet test
dotnet.clean:
	- $(MAKE) dotnet clean
dotnet.realclean:
	- $(MAKE) dotnet realclean

ecmascript : ecmascript.dummy
ecmascript.dummy:
	- $(MAKE) ecmascript
ecmascript.test:
	- $(MAKE) ecmascript test
ecmascript.clean:
	- $(MAKE) ecmascript clean
ecmascript.realclean:
	- $(MAKE) ecmascript realclean

forth : forth.dummy
forth.dummy:
	- $(MAKE) forth
forth.test:
	- $(MAKE) forth test
forth.clean:
	- $(MAKE) forth clean
forth.realclean:
	- $(MAKE) forth realclean

jako: jako.dummy
jako.dummy:
	- $(MAKE) jako
jako.test:
	- $(MAKE) jako test
jako.clean:
	- $(MAKE) jako clean
jako.realclean:
	- $(MAKE) jako realclean

json: json.dummy
json.dummy:
	- $(MAKE) json
json.test:
	- $(MAKE) json test
json.clean:
	- $(MAKE) json clean
json.realclean:
	- $(MAKE) json realclean

lazy-k: lazy-k.dummy
lazy-k.dummy:
	- $(MAKE) lazy-k
lazy-k.test:
	- $(MAKE) lazy-k test
lazy-k.clean:
	- $(MAKE) lazy-k clean
lazy-k.realclean:
	- $(MAKE) lazy-k realclean

lisp: lisp.dummy
lisp.dummy:
	- $(MAKE) lisp
lisp.test:
	- $(MAKE) lisp test
lisp.clean:
	- $(MAKE) lisp clean
lisp.realclean:
	- $(MAKE) lisp realclean

lolcode: lolcode.dummy
lolcode.dummy:
	- $(MAKE) lolcode
lolcode.test:
	- $(MAKE) lolcode test
lolcode.clean:
	- $(MAKE) lolcode clean
lolcode.realclean:
	- $(MAKE) lolcode realclean

lua: lua.dummy
lua.dummy:
	- $(MAKE) lua
lua.test:
	- $(MAKE) lua test
lua.clean:
	- $(MAKE) lua clean
lua.realclean:
	- $(MAKE) lua realclean

markdown: markdown.dummy
markdown.dummy:
	- $(MAKE) markdown
markdown.test:
	- $(MAKE) markdown test
markdown.clean:
	- $(MAKE) markdown clean
markdown.realclean:
	- $(MAKE) markdown realclean

ook : ook.dummy
ook.dummy:
	- $(MAKE) ook
ook.test:
	- $(MAKE) ook test
ook.clean:
	- $(MAKE) ook clean
ook.realclean:
	- $(MAKE) ook realclean

parrot_compiler: parrot_compiler.dummy
parrot_compiler.dummy:
	- $(MAKE) parrot_compiler
parrot_compiler.test:
	- $(MAKE) parrot_compiler test
parrot_compiler.clean:
	- $(MAKE) parrot_compiler clean
parrot_compiler.realclean:
	- $(MAKE) parrot_compiler realclean

perl6 : perl6.dummy
perl6.dummy:
	- $(MAKE) perl6
perl6.test:
	- $(MAKE) perl6 test
perl6.clean:
	- $(MAKE) perl6 clean
perl6.realclean:
	- $(MAKE) perl6 realclean

pheme : pheme.dummy
pheme.dummy:
	- $(MAKE) pheme
pheme.test:
	- $(MAKE) pheme test
pheme.clean:
	- $(MAKE) pheme clean
pheme.realclean:
	- $(MAKE) pheme realclean

pipp : pipp.dummy
pipp.dummy:
	- $(MAKE) pipp
pipp.test:
	- $(MAKE) pipp test
pipp.clean:
	- $(MAKE) pipp clean
pipp.realclean:
	- $(MAKE) pipp realclean

PIR: PIR.dummy
PIR.dummy:
	- $(MAKE) PIR
PIR.test:
	- $(MAKE) PIR test
PIR.clean:
	- $(MAKE) PIR clean
PIR.realclean:
	- $(MAKE) PIR realclean

punie : punie.dummy
punie.dummy:
	- $(MAKE) punie
punie.test:
	- $(MAKE) punie test
punie.clean:
	- $(MAKE) punie clean
punie.realclean:
	- $(MAKE) punie realclean

pynie : pynie.dummy
pynie.dummy:
	- $(MAKE) pynie
pynie.test:
	- $(MAKE) pynie test
pynie.clean:
	- $(MAKE) pynie clean
pynie.realclean:
	- $(MAKE) pynie realclean

regex: regex.dummy
regex.dummy:
	- $(MAKE) regex
regex.test :
	- $(MAKE) regex test
regex.clean :
	- $(MAKE) regex clean
regex.realclean :
	- $(MAKE) regex realclean

scheme: scheme.dummy
scheme.dummy:
	@echo "SKIPPED: scheme: (nothing to make, but should not default to make test)"
scheme.test :
	- $(MAKE) scheme test
scheme.clean :
	- $(MAKE) scheme clean
scheme.realclean :
	- $(MAKE) scheme realclean

squaak: squaak.dummy
squaak.dummy:
	- $(MAKE) squaak
squaak.test:
	- $(MAKE) squaak test
squaak.clean:
	- $(MAKE) squaak clean
squaak.realclean:
	- $(MAKE) squaak realclean

unlambda: unlambda.dummy
unlambda.dummy:
	- $(MAKE) unlambda
unlambda.test :
	- $(MAKE) unlambda test
unlambda.clean :
	- $(MAKE) unlambda clean
unlambda.realclean :
	- $(MAKE) unlambda realclean

urm: urm.dummy
urm.dummy:
	- $(MAKE) urm
urm.test:
	- $(MAKE) urm test
urm.clean:
	- $(MAKE) urm clean
urm.realclean:
	- $(MAKE) urm realclean

WMLScript: WMLScript.dummy
WMLScript.dummy:
	- $(MAKE) WMLScript
WMLScript.test:
	- $(MAKE) WMLScript test
WMLScript.clean:
	- $(MAKE) WMLScript clean
WMLScript.realclean:
	- $(MAKE) WMLScript realclean

Zcode : Zcode.dummy
Zcode.dummy:
# Do nothing. make Zcode requires an Inform compiler
Zcode.test:
	- $(MAKE) Zcode test
Zcode.clean:
	- $(MAKE) Zcode clean
Zcode.realclean:
	- $(MAKE) Zcode realclean

# helpers for checking out externally managed languages

# check out all known externally managed languages
co-all: co-eclectus co-gil co-hq9plus co-m4 co-pjs co-primitivearc co-tcl

co-eclectus:
	- $(GIT) clone 'git:////github.com/bschmalhofer/eclectus.git'

co-gil:
	- $(GIT) clone 'git:////github.com/tene/gil.git'

co-hq9plus:
	- $(GIT) clone 'git:////github.com/bschmalhofer/hq9plus.git'

co-m4:
	- $(GIT) clone 'git:////github.com/bschmalhofer/m4.git'

co-pjs:
	- $(SVN) checkout 'http:////parrotjs.googlecode.com/svn/trunk/' parrotjs-read-only

co-primitivearc:
	- $(GIT) clone 'git:////github.com/stefano/primitivearc.git'

co-tcl:
	- $(SVN) checkout 'http:////partcl.googlecode.com/svn/trunk' tcl

