# # The compiler and the flags it will use. # CC = cc OPTIMIZE= -O CFLAGS = $(OPTIMIZE) -I$ROOT/include LDFLAGS = $(OPTIMIZE) LIBS = -L$(ROOT)/lib -L/usr/local/lib32 -lpthread -lrt # # Source files. Place all your .c files, but not your main program or .h files here. #SRCS = sockets.c #OBJS = $(SRCS:.c=.o) #MAINSRC = server.c # # TARGET is the name of the program to be created # #TARGET = server # # This rule tells how to change a generic .c file into a .o file; # the $< token is expanded into whatever .c file is working on. # .c.o: $(CC) $(CFLAGS) $(MFLAGS) -c $< all: client server client: client.c sockets.c sockets.o $(CC) $(CFLAGS) $(MFLAGS) sockets.o -o client client.c $(LIBS) server: server.c sockets.c sockets.o $(CC) $(CFLAGS) $(MFLAGS) sockets.o -o server server.c $(LIBS) #$(TARGET): $(OBJS) # $(CC) $(CFLAGS) $(MFLAGS) $(OBJS) -o $@ $(MAINSRC) $(LIBS) clean: -rm -f $(OBJS) core a.out *~ *.bak client server *.o