1
## Common definitions for haxe-related make elements
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)
7
AHXSRC=$(shell find $(HXSRCPATH) -name "*.ahx")
8
AHXOUT=$(AHXSRC:.ahx=.hx)
10
SHXSRC=$(shell find $(HXSRCPATH) -name "*.shx")
11
SHXOUT=$(SHXSRC:.shx=.hx)
13
HXSRC=$(shell find $(HXSRCPATH) -name "*.hx") $(MHXOUT) $(AHXOUT) $(SHXOUT)
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
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.
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" )
32
## Use the standard M4-haXe rules
34
M4HX=$(DHLIB_ROOT)/m4/m4haxe.sh $(M4HXOPTS)
36
%.hx : %.mhx $(IHXSRC) $(M4SRC)
37
$(M4HX) --out "$@" "$<"
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 "$<"
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 "$<"
47
############################
48
## Standard definitions for targets
50
## TODO: Turn of debug globally
51
HAXECP=-cp $(DHLIB_ROOT)/lib
53
HAXEFLAGS=$(HAXEDEBUG) $(HAXECP)
55
# The FLASHVERSION can be modified to output a different version
56
# in expectation of a higher version number, since the library doesn't
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
64
# FLASHCOLOR establishes the background color of the flash target
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 $@
73
STDJS=haxe $(HAXEFLAGS) -js $@
74
STDNEKO=haxe $(HAXEFLAGS) -neko $@
75
STDNEASH=$(STDNEKO) -lib neash -lib nme -D neash