Cairo support works, both to draw in the window and to write as a png image in a...
[universe.git] / Makefile
index 1331d46..6fc991d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,11 @@ else
  CXXFLAGS = -fPIC -Wall -g -O3
 endif
 
  CXXFLAGS = -fPIC -Wall -g -O3
 endif
 
-LDFLAGS = -L/usr/X11R6/lib/
+LDFLAGS = -L/usr/X11R6/lib/ -lz -ldl
+
+# 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=.task)
 
 TASK_SRC = dummy.cc move_square.cc hit_shape.cc
 TASK_OBJ = $(TASK_SRC:.cc=.task)
@@ -44,7 +48,7 @@ main:         main.o misc.o \
        manipulator.o \
        approximer.o \
        intelligence.o
        manipulator.o \
        approximer.o \
        intelligence.o
-       $(CXX) -lX11 $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
+       $(CXX) $(CXXFLAGS) $(LDFLAGS) -lX11 -o $@ $^
 
 %.task: %.cc misc.o universe.o polygon.o xfig_tracer.o map.o task.o manipulator.o
        $(CXX) $(CXXFLAGS) -shared -Wl,-soname,$@ -o $@ $^
 
 %.task: %.cc misc.o universe.o polygon.o xfig_tracer.o map.o task.o manipulator.o
        $(CXX) $(CXXFLAGS) -shared -Wl,-soname,$@ -o $@ $^
@@ -53,6 +57,6 @@ Makefile.depend: *.h *.cc Makefile
        $(CC) -M *.cc > Makefile.depend
 
 clean:
        $(CC) -M *.cc > Makefile.depend
 
 clean:
-       \rm main *.o *.task Makefile.depend
+       \rm -f main *.o *.task Makefile.depend
 
 -include Makefile.depend
 
 -include Makefile.depend