box-o-sand/Makefile

43 lines
1.2 KiB
Makefile

# Makefile for building flex apps associated with
# the Adobe Flex "Geting Started" tutorial at:
# http://learn.adobe.com/wiki/display/Flex/Getting+Started
# sets mxmlc and compc to their respective basenames
# if not overridden in command line like so:
# make MXMLC=/path/to/my/mxmlc
MXMLC ?= mxmlc
COMPC ?= compc
# define all target swf paths (which don't yet exist if
# they've never been built)
SWFS = $(patsubst %.mxml,%.swf,$(wildcard [0-9]*-*/*.mxml))
# define all target swc paths (same as with swf paths above)
SWCS = $(patsubst %.as,%.swc,$(wildcard com/ag/*.as))
# define an implicit build rule for any file matching %.swf,
# using the $< (input) and $@ (output) automatic variables
%.swf : %.mxml
$(MXMLC) $< -warnings -l+=./com/ag -output $@
# define an implicit build rule for any file matching %.swc,
# using the $< (input) and $@ (output) automatic variables
# just like with the %.swf implicit rule above
%.swc : %.as
$(COMPC) -sp+=./ -output $@ -include-classes $(subst /,.,$(basename $<))
# build all expected swf and swc files
all: $(SWCS) $(SWFS)
# remove all swf files in the tree
clean:
find -name \*.swf -exec rm {} \; ; \
find -name \*.swc -exec rm {} \;