Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have tried to simplify this makefile to the bare minimum, but cannot get it to use an executable to convert one type of file to another if the timestamps have changed. I'm sure there is a stupidly simple answer but cannot find it:

%.pvr : %.bmp
        $(toolpath) -i"$<" -fOGLPVRTC4 -r2 -x512 -y512 -m -o$@

all : 01.pvr

01.pvr : 01.bmp

I am attempting to convert all .bmp files specified to .pvr

01.pvr does not exist. 01.bmp does exist. However i always get

make: Nothing to be done for `all'.

Edit: ok, this was not the exact makefile I was using, in fact the files were not called 01.pvr and 01.bmp, they were foo.pvr and bar.bmp This seems to make a difference. What could that be?

share|improve this question
2  
I just tried your makefile, replacing your $(toolpath) command with 'cp $< $@'. It worked fine. It copied my 01.bmp to 01.pvr. You might want to try make -d to see whats going on. –  Anil Mar 2 '12 at 15:59
    
Ah, so my files were actually foo.bmp and bar.pvr does this make a difference? –  yuumei Mar 2 '12 at 16:08
add comment

1 Answer

up vote 1 down vote accepted

In %.X : %.Y kind of rules, % acts like a indicator of common substring. Your makefile can tell make how to make foo.pvr from foo.bmp, but not how to make bar.pvr from foo.bmp. You can find more details in the Pattern Match section of gmake manual.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.