abandoning GNU make pattern rules in favor of generated makefile targets

This commit is contained in:
Dan Buch
2010-02-21 00:08:12 -05:00
parent 70b9977d4c
commit 14db585c3b
3 changed files with 236 additions and 10 deletions

View File

@@ -2,8 +2,6 @@
# 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:
# make MXMLC=/path/to/my/mxmlc
@@ -11,20 +9,37 @@ 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))
SWFS += $(patsubst %.mxml,%.swf,$(wildcard custom-*/*.mxml))
# define all dependency mxml paths and their swf path targets
# (which don't yet exist if they've never been built)
MXML = $(wildcard [0-9]*-*/*.mxml) $(wildcard custom-*/*.mxml)
SWFS = $(patsubst %.mxml,%.swf,$(MXML))
# 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))
COMPONENTS = $(wildcard [0-9]*-*/*.as) $(wildcard custom-*/*.as)
export COMPONENTS
# build all expected swf and swc files
all: $(SWFS) $(COMPONENTS)
include rules.mk
all: $(SWFS)
include targets.mk
components:
@echo $(COMPONENTS)
mxml:
@echo $(MXML)
swfs:
@echo $(SWFS)
# remove all swf files in the tree