3b4ea46d7d864a1eb76e81fa7ba3e84412ce7a31
[universe.git] / Makefile
1
2 #============================================================================#
3 # This program is free software; you can redistribute it and/or              #
4 # modify it under the terms of the GNU General Public License                #
5 # version 2 as published by the Free Software Foundation.                    #
6 #                                                                            #
7 # This program is distributed in the hope that it will be useful, but        #
8 # WITHOUT ANY WARRANTY; without even the implied warranty of                 #
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          #
10 # General Public License for more details.                                   #
11 #                                                                            #
12 # Written and (C) by François Fleuret                                        #
13 # Contact <francois.fleuret@epfl.ch> for comments & bug reports              #
14 #============================================================================#
15
16 # CXX=g++-3.3
17
18 ifeq ($(DEBUG),yes)
19  CXXFLAGS = -Wall -g -DDEBUG
20 else
21  # Optimized compilation
22 #  CXXFLAGS = -Wall -g -O3 -pg --coverage
23  CXXFLAGS = -Wall -g -O3
24 endif
25
26 LDFLAGS = -L/usr/X11R6/lib/
27
28 TASK_SRC = dummy.cc move_square.cc hit_shape.cc
29 TASK_OBJ = $(TASK_SRC:.cc=.task)
30
31 all: main TAGS $(TASK_OBJ)
32
33 TAGS: *.cc *.h
34         etags *.cc *.h
35
36 main:   main.o misc.o \
37         simple_window.o \
38         universe.o \
39         xfig_tracer.o \
40         polygon.o \
41         map.o \
42         task.o \
43         retina.o \
44         manipulator.o \
45         approximer.o \
46         intelligence.o
47         $(CXX) -lX11 $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
48
49 art: art.o misc.o simple_window.o universe.o polygon.o map.o \
50       task.o retina.o manipulator.o approximer.o intelligence.o
51         $(CXX) -lX11 $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
52
53 %.task: %.cc misc.o universe.o polygon.o map.o task.o manipulator.o
54         $(CXX) $(CXXFLAGS) -shared -Wl,-soname,$@ -o $@ $^
55
56 Makefile.depend: *.h *.cc Makefile
57         $(CC) -M *.cc > Makefile.depend
58
59 clean:
60         \rm main *.o *.task Makefile.depend
61
62 -include Makefile.depend