#71903 - gauauu - Wed Feb 15, 2006 6:46 am
In my makefile, I am wanting to do something like:
Now, where the ..?.. is, I'd like to put set a dependancy that each AUTOGFX file is dependant on the associated .png file (gfx/png/hud.png). I'm not sure how to specify this, though.
A few notes: in the gfx/ directory, there are other C/object files that won't be automatically generated, so I can't use a directory wildcard. I specifically want to define the files manually like I am doing.
I tried something like:
but the $@ only doesn't seem to work in the dependancy section for some reason (unless I'm doing something blatantly stupid?) It's not that it complains of not being able to find the dependant file...it just doesn't seem to know that it needs to rebuild my AUTOGFX files when the png changes.
And if I do something like
Then each C source file will have to be rebuilt every time one of the png's get changed, right?
Also, I know that generally it's bad to put gfx in C files. I'm doing it anyway because of how my converter perl scripts work. The makefile question is the same whether it's C or assembly files.
Thanks!
Code: |
AUTOGFX = gfx/hud.c gfx/stuff.c ... $(AUTOGFX) : ..?.. perl myGfxConverter.pl file=$@ |
Now, where the ..?.. is, I'd like to put set a dependancy that each AUTOGFX file is dependant on the associated .png file (gfx/png/hud.png). I'm not sure how to specify this, though.
A few notes: in the gfx/ directory, there are other C/object files that won't be automatically generated, so I can't use a directory wildcard. I specifically want to define the files manually like I am doing.
I tried something like:
Code: |
$(AUTOGFX) : $(patsubst gfx/%.c,gfx/png/%.png,$@) perl myGfxConverter.pl file=$@ |
but the $@ only doesn't seem to work in the dependancy section for some reason (unless I'm doing something blatantly stupid?) It's not that it complains of not being able to find the dependant file...it just doesn't seem to know that it needs to rebuild my AUTOGFX files when the png changes.
And if I do something like
Code: |
$(AUTOGFX) : $(patsubst gfx/%.c,gfx/png/%.png,$(AUTOGFX)) perl myGfxConverter.pl file=$@ |
Then each C source file will have to be rebuilt every time one of the png's get changed, right?
Also, I know that generally it's bad to put gfx in C files. I'm doing it anyway because of how my converter perl scripts work. The makefile question is the same whether it's C or assembly files.
Thanks!