Makefile 590 Bytes
#
# Makefile pour generer la bibliotheque de fonctions de communication
#

CC=gcc
CFLAGS=-W -Wall -Wextra
CLIBS=ar -rcs
LIB=libnet.a
LDIR=../libs/
LIBS=$(LDIR)libnet.a $(LDIR)libthrd.a
IDIR=../includes/
LDFLAGS=-lpthread -lpcap



all: $(LIB)

$(LIB): sender.o sniffer.o tcpserver.o
	rm -f $@
	$(CLIBS) $(LDIR)$@ $^
	ranlib $(LDIR)$@
	rm -f *.o	


tcpserver.o: tcpserver.c
	$(CC) -o $@ -c $^ -I$(IDIR) $(CFLAGS) 

sniffer.o: sniffer.c
	$(CC) -o $@ -c $^ $(CFLAGS)

sender.o: sender.c
	$(CC) -o $@ -c $^ $(CFLAGS)


#
# La cible de nettoyage
#

clean: 
	rm -f *.o $(LDIR)$(LIB) ../bin/test