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.

_______________________________________________
help-gnu-utils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gnu-utils

Reply via email to