~extremepopcorn/dhlib/dhlib_ep

« back to all changes in this revision

Viewing changes to make/haxe-common.makefile

  • Committer: edA-qa mort-ora-y
  • Date: 2010-02-16 05:36:32 UTC
  • Revision ID: eda-qa@disemia.com-20100216053632-60lt7fndfi3fgblw
first

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
## Common definitions for haxe-related make elements
 
2
 
 
3
## Macros which do standard searching of source files, see below for use
 
4
MHXSRC=$(shell find  $(HXSRCPATH) -name "*.mhx")
 
5
MHXOUT=$(MHXSRC:.mhx=.hx)
 
6
 
 
7
AHXSRC=$(shell find $(HXSRCPATH) -name "*.ahx")
 
8
AHXOUT=$(AHXSRC:.ahx=.hx)
 
9
 
 
10
SHXSRC=$(shell find $(HXSRCPATH) -name "*.shx")
 
11
SHXOUT=$(SHXSRC:.shx=.hx)
 
12
 
 
13
HXSRC=$(shell find $(HXSRCPATH) -name "*.hx") $(MHXOUT) $(AHXOUT) $(SHXOUT)
 
14
 
 
15
## Define for the library (note := to do expansion now)
 
16
## Do only library here since other M4 expansions will need to be done with the
 
17
## appropriate relative directory (I'm sitll unclear on something here, but M4
 
18
## was getting confused with multiple Global.ihx files off the root...)
 
19
HXSRCPATH=$(DHLIB_ROOT)/lib
 
20
HXLIBSRC:=$(HXSRC)
 
21
 
 
22
###############################
 
23
## Transforms .mhx files into .hx files
 
24
## We need this extra target since in Haxe we
 
25
## don't directly reference the files, it will
 
26
## look on its own for .hx files.
 
27
 
 
28
## All .ihx here is overkill, but it goes so fast anyways...
 
29
IHXSRC=$(shell find $(DHLIB_ROOT) -name "*.ihx" )
 
30
M4SRC=$(shell find $(DHLIB_ROOT) -name "*.m4" )
 
31
 
 
32
## Use the standard M4-haXe rules
 
33
M4HXOPTS=
 
34
M4HX=$(DHLIB_ROOT)/m4/m4haxe.sh $(M4HXOPTS)
 
35
 
 
36
%.hx : %.mhx $(IHXSRC) $(M4SRC)
 
37
        $(M4HX) --out "$@" "$<"
 
38
 
 
39
## For ACTORs, automatically process the Actor include first
 
40
%.hx : %.ahx $(IHXSRC) $(M4SRC)
 
41
        $(M4HX) --out "$@" --prepend $(DHLIB_ROOT)/lib/ui/anim/ActorDef.ihx "$<"
 
42
 
 
43
## For SHAPEs, automatically process the Shape include first
 
44
%.hx: %.shx  $(IHXSRC) $(M4SRC)
 
45
        $(M4HX) --out "$@" --prepend $(DHLIB_ROOT)/lib/draw/fragments/ShapeDef.ihx "$<"
 
46
 
 
47
############################
 
48
## Standard definitions for targets
 
49
 
 
50
## TODO: Turn of debug globally
 
51
HAXECP=-cp $(DHLIB_ROOT)/lib
 
52
HAXEDEBUG=-debug
 
53
HAXEFLAGS=$(HAXEDEBUG) $(HAXECP)
 
54
 
 
55
# The FLASHVERSION can be modified to output a different version
 
56
# in expectation of a higher version number, since the library doesn't
 
57
# support a lower one
 
58
FLASHVERSION=9
 
59
# The FLASHVERSIONSTR is not likely needing to be changed
 
60
FLASHVERSIONSTR=-swf-version $(FLASHVERSION)
 
61
# FLASHSIZE can be used to specify the size of the flash target, a
 
62
# reasonable default will otherwise be assumed
 
63
FLASHSIZE=800:600
 
64
# FLASHCOLOR establishes the background color of the flash target
 
65
FLASHCOLOR=808080
 
66
# FLASHHEADER is the complete string establishing the flash header output
 
67
FLASHHEADERSTR=-swf-header $(FLASHSIZE):32:$(FLASHCOLOR)
 
68
# STDFLASH is used as a command to compile the current
 
69
# target as a Flash output.  "-main Class" is expected to follow this
 
70
# command to indicate the target.
 
71
STDFLASH=haxe $(HAXEFLAGS) $(FLASHVERSIONSTR) $(FLASHHEADERSTR) -swf $@
 
72
 
 
73
STDJS=haxe $(HAXEFLAGS) -js $@
 
74
STDNEKO=haxe $(HAXEFLAGS) -neko $@
 
75
STDNEASH=$(STDNEKO) -lib neash -lib nme -D neash
 
76