I have a directory called "project". It contains two sub-directories called "client" and "server" and a makefile called "Makefile". client and server have got source files called "client.c" and "server.c" respectively. I dont have any separate makefiles in the subdirectories for sources belonging to that directory. All making is done by a single makefile Makefile code is
FLAGS = -W -Wall -g -pthread
SERV =./server/server.c #My server code
CLI =./client/client.c #My client code
build:svr cnt
svr: $(SERV)
cc $(FLAGS) $(SERV) -o ./server/server.out
cnt: $(CLI)
cc $(FLAGS) $(CLI) -o ./client/client.out
Now I ran "make cnt" and it replied
cc -W -Wall -g -pthread ./client/client.c -o ./client/client.out
The problem is all the subsequent "make cnt" commands end up compiling it again and outputting the above text even though Im not changing
./client/client.c
Im stuck here. Dont know what to do. Thanks for help.