From 70b9977d4c633ee922d1dd5c1125b7c5ce55841e Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sat, 20 Feb 2010 22:15:26 -0500 Subject: [PATCH] reorg wrt make implicit rules and custom versions of --- Makefile | 19 +++++++------------ .../CustomApp.as | 0 .../Snarf.mxml | 0 .../ListApp.as | 0 .../ListControl.mxml | 0 rules.mk | 11 +++++++++++ 6 files changed, 18 insertions(+), 12 deletions(-) rename {00-custom-03d1-datagrid => custom-03d1-datagrid}/CustomApp.as (100%) rename {00-custom-03d1-datagrid => custom-03d1-datagrid}/Snarf.mxml (100%) rename {00-custom-03d3-lists => custom-03d3-lists}/ListApp.as (100%) rename {00-custom-03d3-lists => custom-03d3-lists}/ListControl.mxml (100%) create mode 100644 rules.mk diff --git a/Makefile b/Makefile index 9b0803d..3d658b7 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ # the Adobe Flex "Geting Started" tutorial at: # http://learn.adobe.com/wiki/display/Flex/Getting+Started +include rules.mk # sets mxmlc and compc to their respective basenames # if not overridden in command line like so: @@ -13,23 +14,17 @@ 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)) +SWFS += $(patsubst %.mxml,%.swf,$(wildcard custom-*/*.mxml)) -# define an implicit build rule for any file matching %.swf, -# using the $< (input) and $@ (output) automatic variables -%.swf : %.mxml - $(MXMLC) $< -warnings -l+=$(dir $<) -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 $<)) +# glob up all component files as well, since changes to them +# should also prompt rebuild +COMPONENTS = $(patsubst %.mxml,%.swf,$(wildcard [0-9]*-*/*.as)) +COMPONENTS += $(patsubst %.mxml,%.swf,$(wildcard custom-*/*.as)) # build all expected swf and swc files -all: $(SWFS) +all: $(SWFS) $(COMPONENTS) # remove all swf files in the tree diff --git a/00-custom-03d1-datagrid/CustomApp.as b/custom-03d1-datagrid/CustomApp.as similarity index 100% rename from 00-custom-03d1-datagrid/CustomApp.as rename to custom-03d1-datagrid/CustomApp.as diff --git a/00-custom-03d1-datagrid/Snarf.mxml b/custom-03d1-datagrid/Snarf.mxml similarity index 100% rename from 00-custom-03d1-datagrid/Snarf.mxml rename to custom-03d1-datagrid/Snarf.mxml diff --git a/00-custom-03d3-lists/ListApp.as b/custom-03d3-lists/ListApp.as similarity index 100% rename from 00-custom-03d3-lists/ListApp.as rename to custom-03d3-lists/ListApp.as diff --git a/00-custom-03d3-lists/ListControl.mxml b/custom-03d3-lists/ListControl.mxml similarity index 100% rename from 00-custom-03d3-lists/ListControl.mxml rename to custom-03d3-lists/ListControl.mxml diff --git a/rules.mk b/rules.mk new file mode 100644 index 0000000..091688e --- /dev/null +++ b/rules.mk @@ -0,0 +1,11 @@ +# define an implicit build rule for any file matching %.swf, +# using the $< (input) and $@ (output) automatic variables +%.swf : %.mxml + $(MXMLC) $< -warnings -l+=$(dir $<) -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 $<))