#
# Opciones para el compilador.
-CXXFLAGS=-ansi -pedantic -Wall -g
-LDFLAGS=-lsocket++
+CXXFLAGS=-ansi -pedantic -Wall `pkg-config --cflags glibmm-2.0` `pkg-config --cflags gthread-2.0`
+CXXFLAGS+=-g -DDEBUG
+#CXXFLAGS+=-g
+#CXXFLAGS+=-O3
+LDFLAGS=-lsocket++ `pkg-config --libs glibmm-2.0` `pkg-config --libs gthread-2.0`
TARGETS=connection.o controlclient.o controlserver.o receiver.o transmitter.o \
server.o
+TESTS=server_test
+
# Regla por defecto.
-all: $(TARGETS)
+all: $(TARGETS) $(TESTS)
runnable_h=runnable.h
+objects+=runnable.o
+runnable.o: $(runnable_h) runnable.cpp
connection_h=$(runnable_h) connection.h
-connection.o: $(connection_h)
+objects+=connection.o
+connection.o: $(connection_h) connection.cpp
controlclient_h=$(connection_h) controlclient.h
-controlclient.o: $(controlclient_h)
+objects+=controlclient.o
+controlclient.o: $(controlclient_h) controlclient.cpp
controlserver_h=$(connection_h) controlserver.h
-controlserver.o: $(controlserver_h)
+objects+=controlserver.o
+controlserver.o: $(controlserver_h) controlserver.cpp
receiver_h=$(connection_h) receiver.h
-receiver.o: $(receiver_h)
+objects+=receiver.o
+receiver.o: $(receiver_h) receiver.cpp
transmitter_h=$(connection_h) transmitter.h
-transmitter.o: $(transmitter_h)
+objects+=transmitter.o
+transmitter.o: $(transmitter_h) transmitter.cpp
+
+server_h=$(controlserver_h) $(transmitter_h) server.h
+objects+=server.o
+server.o: $(server_h) server.cpp
+
+# Tests
+server_test: $(objects) server_test.cpp
clean:
- rm -f $(TARGETS) *.o
+ rm -f $(TARGETS) $(TESTS) *.o