The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

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 sgrunt2009-04-10 11:58:28
  Dosen't the order matter? by PeKaJe2009-04-10 12:02:40
    Not in this case. I got the same error. (n/t) by lenmear2009-04-10 12:18:22
      Hey wait, just noticed something by PeKaJe2009-04-10 12:34:54
        Apparently not. by lenmear2009-04-10 12:46:51
          Hmm, yes, I can see now why it wouldn't work by PeKaJe2009-04-10 13:08:01
            Bingo! Thanks for the help! (n/t) by lenmear2009-04-10 18:31:19

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)