Mail Archives: djgpp/2002/05/23/11:00:06
Eli Zaretskii wrote:
>
> On 23 May 2002, Manni Heumann wrote:
>
>> > - change the %.o: %.cpp rule to produce *.o files in the
>> > special directory (tweak the "-o $@" part of the rule's
>> > command);
>>
>> Ok, I did that. Sadly, it didn't work. Make did build the *.o
>> files and put them in the subdirectory. But: It would build
>> them every time, whether the were up to date or not, and it
>> couldn't link my exe file. Instead I got a "No such file or
>> directory" error for each of them. It seems like make did not
>> look into my subdirectory at all. I tried both absolute and
>> relative path, no change.
Sorry, this was not quite correct. The *.o files are only produced
when they are not up to date. But the error messge remains.
> Was that before or after you started to use VPATH? If before,
> try adding VPATH and see if it helps. If after, please show
> your Makefile after all the changes.
After! It happened after I added a VPATH statement. Here's my
makefile:
TARGET = rs.exe
CC = gpp
VPATH=objs
OBJECTS = main.o cstring.o config.o data.o
$(TARGET) : $(OBJECTS)
$(CC) $(OBJECTS) $(LDFLAGS) -o $(TARGET)
%.o : %.cpp
$(CC) $< $(WARNINGS) $(CXXFLAGS) -c -o $(VPATH)\$@
Hope I missed something. Thank you,
Manni
- Raw text -