|
|
Back to UserFriendly Strip Comments Index
| Makefile question |
by lenmear |
2009-04-10 11:55:17 |
I'm working on a makefile to automate 3D rendering and have run into a problem using phony targets and pattern prerequisites. Here's what I want to do:
#===============================================================
# rules for the shaders
#===============================================================
SHADER_SRC_DIR = shaders\source
SHADER_BIN_DIR = shaders\compiled
vpath %.sl $(SHADER_SRC_DIR)
.PHONY: shaders
shaders: $(SHADER_BIN_DIR)/%.sdl
$(SHADER_BIN_DIR)/%.sdl: %.sl
$(SHADER) $(SHADER_FLAGS) $<
#===============================================================
# end of shader rules
#===============================================================
The output of running "make shaders" is "make: *** No rule to make target `shaders/compiled/%.sdl', needed by `shaders'. Stop."
To make this work, I have to spell out each sdl file in the shaders rule:
#===============================================================
# rules for the shaders
#===============================================================
SHADER_SRC_DIR = shaders\source
SHADER_BIN_DIR = shaders\compiled
vpath %.sl $(SHADER_SRC_DIR)
.PHONY: shaders
shaders: $(SHADER_BIN_DIR)/Turbulence1D.sdl $(SHADER_BIN_DIR)/Turbulence2D.sdl $(SHADER_BIN_DIR)/Turbulence3D.sdl
$(SHADER_BIN_DIR)/%.sdl: %.sl
$(SHADER) $(SHADER_FLAGS) $<
#===============================================================
# end of shader rules
#===============================================================
Is the former option not possible, or am I missing something? I'm running GNU make on Windows, but will also use this with GNU make on Linux. Thanks for any help you can offer! |
|
[ Reply ] |
|
I've always seen it spelled out. | by sgrunt | 2009-04-10 11:58:28 |
|
Dosen't the order matter? | by PeKaJe | 2009-04-10 12:02:40 |
|
Not in this case. I got the same error. (n/t) | by lenmear | 2009-04-10 12:18:22 |
|
Hey wait, just noticed something | by PeKaJe | 2009-04-10 12:34:54 |
|
Apparently not. | by lenmear | 2009-04-10 12:46:51 |
|
Hmm, yes, I can see now why it wouldn't work | by PeKaJe | 2009-04-10 13:08:01 |
|
Bingo! Thanks for the help! (n/t) | by lenmear | 2009-04-10 18:31:19 |
|
|
[Todays Cartoon Discussion]
[News Index]
|
|