CFLAGS = -g -Wall -Wstrict-prototypes

LDFLAGS = -g

HDRS = \
	daemonize.h \
	init_server.h

SRCS = \
	$(wildcard *.c)

BINS = \
	stream_client \
	stream_server

.PHONY: default
default: $(BINS)

.PHONY: clean
clean:
	rm -f *~ *.o

.PHONY: immaculate
immaculate: clean
	rm -f $(BINS)

%.o: %.c $(HDRS)
	$(CC) -c $(CFLAGS) $<

stream_client: stream_client.o connect_retry.o
	$(CC) $(LDFLAGS) $^ -o $@

stream_server: stream_server.o init_server.o daemonize.o
	$(CC) $(LDFLAGS) $^ -o $@

