Hello,
gcc 4.4.1 C99
I am creating a client server application.
I have a Makefile that compiles all the files. However, I would like 2 create 2 targets (binaries) one called clt and svr. And would like the Makefile to create 2 separate directories for them, called ./client and ./server?
So far I have done this to my Makefile. That only creates the svr. I am not sure how I can add the second target for the client to be created.
Hope you understand my point?
Many thanks for any suggestions,
OBJECT_FILES = server.o client.o cltsvr_ults.o
CFLAGS = -ggdb -Wall -pthread
LIBS = -lpthread
CC = gcc
svr: $(OBJECT_FILES)
$(CC) $(CFLAGS) $(OBJECT_FILES) $(LIBS) -o svr
client.o: client.c cltsvr_ults.h
$(CC) -c client.c
server.o: server.c cltsvr_ults.h
$(CC) -c server.c
cltsvr_ults.o: cltsvr_ults.c
$(CC) -c cltsvr_ults.c
clean:
rm svr *.o *~