[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
make pattern matching with all.o
From: |
Kelly Mandrake |
Subject: |
make pattern matching with all.o |
Date: |
5 Mar 2005 16:35:45 -0800 |
User-agent: |
G2/0.2 |
I was reading the gnu make manual sec 10.5.1 about pattern matching,
and for some reason it seems make is matching all with the % wildcard,
here is what I have
BIN = LibKomodia.a
OBJS = obj/KomodiaTCPIPLib/AsyncSocket.o
all: $(BIN)
$(BIN): $(OBJS)
$(AR) -rc $(BIN) $(OBJS)
ranlib $(BIN)
%.o: ../src/KomodiaTCPIPLib/AsyncSocket.cpp
$(CPP) -c ../src/KomodiaTCPIPLib/AsyncSocket.cpp -o
obj/KomodiaTCPIPLib/AsyncSocket.o
@echo "$@"
When I run make I get the output as follows:
$ make
ar -rc LibKomodia.a obj/KomodiaTCPIPLib/AsyncSocket.o
ranlib LibKomodia.a
g++ -c ../src/KomodiaTCPIPLib/AsyncSocket.cpp -o
obj/KomodiaTCPIPLib/AsyncSocket.o
all.o
gcc all.o LibKomodia.a -o all
gcc.exe: all.o: No such file or directory
make: *** [all] Error 1
Why would make be trying to build all.o?
The manual stated "A pattern rule need not have any prerequisites that
contain `%', or in fact any prerequisites at all." So the above
makefile should work.
- make pattern matching with all.o,
Kelly Mandrake <=