help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Probably another problem with pattern rules (make 3.81beta3).


From: Angel Tsankov
Subject: Probably another problem with pattern rules (make 3.81beta3).
Date: Sat, 2 Jul 2005 19:26:21 +0300

So, here's the case. I made a folder named "make" and a subfolder "SourceFiles" (of course). Then I put a simple cpp file in the SourceFiles folder and created the following makefile in the make folder:

=============================makefile==========================================
.PHONY: build

SourceFiles := $(wildcard SourceFiles/*.cpp)
ObjectFiles := $(patsubst SourceFiles/%.cpp, IntermediateFiles/%.o, 
$(SourceFiles))

build: $(ObjectFiles)

Intermed%Files:
       if [ ! -d $@ ]; then mkdir $@; fi

IntermediateFiles/%.o: SourceFiles/%.cpp | IntermediateFiles
       echo updating $@
===============================================================================

Then I ensured there was no IntermediateFiles folder in the make folder and ran 
make 3.81 beta 3:

=======================output==================================================
/home/angel/Projects/make:make
if [ ! -d IntermediateFiles ]; then mkdir IntermediateFiles; fi
echo updating IntermediateFiles/c.o
updating IntermediateFiles/c.o
rm IntermediateFilesmake: unlink: IntermediateFiles: Is a directory
===============================================================================

How should I interpret the last line?!
And one more thing: if I change the target of the first pattern rule from "Intermed%Files" to "IntermediateFiles" then I get this (which seems to be what is expected):

=======================output==================================================
/home/angel/Projects/make:make
if [ ! -d IntermediateFiles ]; then mkdir IntermediateFiles; fi
echo updating IntermediateFiles/c.o
updating IntermediateFiles/c.o
===============================================================================

I've attached the debug info and internal DB (output of -d -p options) that I 
get from the first run.


Regards,
Angel Tsankov

P.S. Attachment is also available at http://debian.fmi.uni-sofia.bg/~angel/make/debug-info-and-internal-DB.zip

Attachment: debug-info-and-internal-DB.zip
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]