
#########################
# Options du compilateur
#########################

CC = cc

CFLAGS= -g -I. \
	     -I /usr/include \
	     -I /usr/local/include
             
#########################
# Repertoires
#########################


#########################
# Options du linker
#########################

LDFLAGS = -L/usr/local/lib \
	  -L/usr/lib 


#########################
# Librairies
#########################

LIBS_solaris5.5 = -lsocket -lnsl
LIBS_irix6.2 = -lsocket -lnsl
LIBS_irix5.3 = 
LIBS_linux = 

#--------------------------------------------------------------------------
# Compilation


SRC_C_E = SocketToolbox.c ServeurTCP.c 
SRC_C_R = SocketToolbox.c ClientTCP.c

OBJ_E = ${SRC_C_E:.c=.o}
OBJ_R = ${SRC_C_R:.c=.o}


all: solaris5.5

solaris5.5: $(OBJ_E) $(OBJ_R)
	${CC} ${CFLAGS} -o PapotServ $(OBJ_E) $(LDFLAGS) $(LIBS_solaris5.5)
	${CC} ${CFLAGS} -o PapotClient $(OBJ_R) $(LDFLAGS) $(LIBS_solaris5.5)
	
irix6.2: $(OBJ_E) $(OBJ_R)
	${CC} ${CFLAGS} -o PapotServ $(OBJ_E) $(LDFLAGS) $(LIBS_irix6.2)
	${CC} ${CFLAGS} -o PapotClient $(OBJ_R) $(LDFLAGS) $(LIBS_irix6.2)
	
irix5.3: $(OBJ_E) $(OBJ_R)
	${CC} ${CFLAGS} -o PapotServ $(OBJ_E) $(LDFLAGS) $(LIBS_irix5.3)
	${CC} ${CFLAGS} -o PapotClient $(OBJ_R) $(LDFLAGS) $(LIBS_irix5.3)
	
linux: $(OBJ_E) $(OBJ_R)
	${CC} ${CFLAGS} -o PapotServ $(OBJ_E) $(LDFLAGS) $(LIBS_linux)
	${CC} ${CFLAGS} -o PapotClient $(OBJ_R) $(LDFLAGS) $(LIBS_linux)

.C.o:
	${CC} -c $*.c ${CFLAGS}
	
clean: 
	rm *.o PapotServ PapotClient

