#============================================================================# # This program is free software; you can redistribute it and/or # # modify it under the terms of the GNU General Public License # # version 2 as published by the Free Software Foundation. # # # # This program is distributed in the hope that it will be useful, but # # WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # # General Public License for more details. # # # # Written and (C) by François Fleuret # # Contact for comments & bug reports # #============================================================================# ifeq ($(DEBUG),yes) CXXFLAGS = -fPIC -Wall -g -DDEBUG else # Optimized compilation # CXXFLAGS = -Wall -g -O3 -pg --coverage CXXFLAGS = -fPIC -Wall -g -O3 endif LDFLAGS = -lz -ldl # Do we use X11? CXXFLAGS += -DX11_SUPPORT LDFLAGS += -L/usr/X11R6/lib/ # Do we use cairo? CXXFLAGS += -I/usr/include/cairo -DCAIRO_SUPPORT LDFLAGS += -lcairo TASK_SRC = dummy.cc move_square.cc hit_shape.cc TASK_OBJ = $(TASK_SRC:.cc=.so) all: main generate TAGS $(TASK_OBJ) TAGS: *.cc *.h etags *.cc *.h main: main.o misc.o \ simple_window.o \ universe.o \ plotter.o \ polygon.o \ xfig_tracer.o \ canvas.o canvas_cairo.o \ map.o \ task.o \ retina.o \ manipulator.o \ approximer.o \ intelligence.o $(CXX) $(CXXFLAGS) $(LDFLAGS) -lX11 -o $@ $^ generate: generate.o misc.o \ universe.o \ plotter.o \ polygon.o \ canvas.o canvas_cairo.o $(CXX) $(CXXFLAGS) $(LDFLAGS) -lX11 -o $@ $^ %.so: %.cc misc.o universe.o polygon.o xfig_tracer.o map.o task.o manipulator.o $(CXX) $(CXXFLAGS) -shared -Wl,-soname,$@ -o $@ $^ Makefile.depend: *.h *.cc Makefile $(CC) $(CXXFLAGS) -M *.cc > Makefile.depend clean: \rm -f main *.o *.so Makefile.depend -include Makefile.depend