Hello,
gcc 4.4.2 c89
I have written this Makefile. I am wondering is it a good design and easy to maintain?
I thing I am thinking about is that cltsvr_ults.o gets linked with both the SVR_OBJECTS and CLT_OBJECTS. Does this look correct?
Many thanks for any suggestions,
# ------------- SOURCE FILE ------------------------
SVR_OBJECTS = server.o cltsvr_ults.o test_svr.o
CLT_OBJECTS = client.o cltsvr_ults.o test_clt.o
# ------------- COMPILER OPTIONS -------------------
CFLAGS = -ggdb -Wall -pthread -std=c89
CC = gcc
PLATFORM = -DLINUX
LIBS = -lpthread
# ------------- TARGETS ----------------------------
all: svr clt
svr: $(SVR_OBJECTS)
$(CC) $(CFLAGS) $(PLATFORM) $(SVR_OBJECTS) -o svr
clt: $(CLT_OBJECTS)
$(CC) $(CFLAGS) $(PLATFORM) $(CLT_OBJECTS) -o clt
clean:
rm -f clt svr *.o *~
# -------------- DEPENDENCIES ---------------------
server.o: server.h
client.o: client.h
test_svr.o: test_svr.c
test_clt.o: test_clt.c
cltsvr_ults.o: cltsvr_ults.h
svr.o: server.h cltsvr_ults.h test_svr.c
clt.o: client.h cltsvr_ults.h test_clt.c