CC = gcc
CXX = g++
LD = g++
# FIXME - The debian package doesn't include all the includes.
INCLUDES = -I/tmp/jack/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
CXXFLAGS = -Wall -Winline $(INCLUDES) #-DDEBUG
CFLAGS = $(CXXXFLAGS)
LIBS = -ldl -ljack
LDFLAGS = -L/tmp/jack/lib
OBJ = chain.o myipaddr.o master_callbacks.o echoserver.o masterclient.o #slave_driver.o

###########################################################

# A simple pattern rule; every ".o" file depends on a
# ".hh" file of the same name if it exists.
%.o: %.hh

all: $(OBJ)
	$(LD) $(LDFLAGS) -o echoserver echoserver.o myipaddr.o
	$(LD) $(LDFLAGS) $(LIBS) -o masterclient masterclient.o myipaddr.o chain.o master_callbacks.o
	$(CXX) $(CXXFLAGS) $(LDFLAGS) $(LIBS) -lfltk -o fltk_client fltk_client.c 

$(OBJ): %.o : %.cc myipaddr.hh mysocket.hh
	$(CXX) $(CXXFLAGS) -c $<

clean:
	rm -f *.o *~ echoserver masterclient fltk_client

.PHONY: clean all
