I want to use GNUMake to run a rule-based makefile which builds a set of C files in a directory structure (on a Windows file system).
The root directory, some sub-di
I found a great inspiration at http://www.mail-archive.com/help-make@gnu.org/msg05201.html which got me going. My own test application consists of a directory of WW2-era Jazz FLV files downloaded from YouTube and an audio subdirectory into which I'd like to store the OGA audio versions of each one. And, of course, the file names contain spaces. I would then like to run ffmpeg2theora to
Here is the GNUMake Makefile that I've hacked together to work. Thanks to all of the hints on this site and also the referenced site above!
sq = $(subst $(sp),?,$1)
qs = $(subst ?,$(sp),$1)
e :=
sp := $(e) $(e)
FLVS := $(foreach file,var,$(call sq,$(wildcard *.flv)))
FLVS := $(subst .flv?,.flv ,$(FLVS))
AUDIOS := $(patsubst %.flv,audio/%.oga,$(FLVS))
.PHONY: audios show
audios: $(AUDIOS)
$(AUDIOS) : $(FLVS)
ffmpeg2theora --novideo -o "$(call qs,$@)" "$(call qs,$(notdir $(patsubst %.oga,audio/%.flv,$@)))"
show:
echo $(FLVS)
echo $(AUDIOS)