python - Write a makefile with one rule for many targets? -


it may seem simple question, not find way fix it.

my intention convert every ".ui" file ".py" file invoking pyuic4 command (from pyqt). tried manage short makefile:

%.py: %.ui     pyuic4 $< --output $@ 

that's need @ moment.

the makefile named "makefile" , located in folder "make" invoked from, , ".ui" files. "pyuic4(.bat)" in system's path (windows 7), , unix utilities "make" part of.

when running "make" windows console, says:

make: *** no targets.  stop. 

invoking pyuic4 command line explicit file names works.

i know specify target file own, if possible want avoid this.

any ideas?

as per kasterma's comment, need tell make target build, you've provided pattern rule. can done in following way.

uifiles := $(wildcard *.ui) pyfiles := $(uifiles:.ui=.py)  .phony: all: $(pyfiles)  %.py: %.ui     pyuic4 $< --output $@ 

Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

monitor web browser programmatically in Android? -

c# - Using multiple datasets in RDLC -