# Makefile for sockstream

CC = g++
INCDIRS = -I../include
CFLAGS = -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes \
         -fexceptions $(INCDIRS)



SERVER_OBJ = smallsock.o socket.o
STREAMSERVER_OBJ = sockstream_main.o sockstream.o socket.o
DAEMON_OBJ = daemon.o socket.o


all: server streamserver daemon

server: $(SERVER_OBJ)
	g++ -o $@ $(CFLAGS) $(SERVER_OBJ) -lpthread
	ln -fs server client


streamserver: $(STREAMSERVER_OBJ)
	g++ -o $@ $(CFLAGS) $(STREAMSERVER_OBJ) -lpthread
	ln -fs streamserver streamclient


daemon: $(DAEMON_OBJ)
	g++ -o $@ $(CFLAGS) $(DAEMON_OBJ) -lpthread


.cpp.o:
	$(CC) -c $< $(CFLAGS)


clean:
	rm -f *.o server client streamserver streamclient daemon
