refractoring to use osso-game-startup
[mancala] / src / Makefile
index bb47fb8..ea07efa 100644 (file)
@@ -1,5 +1,6 @@
 # GNU Makefile -- Makefile
 # Kevin Riggle
+# 2009 Reto Zingg
 # http://cmancala.sourceforge.net
 # $Source: /cvsroot/cmancala/mancala/src/Attic/Makefile,v $
 # $Revision: 1.10.2.7 $
 # the LD_LIBRARY_PATH environment variable to include /usr/local/lib in
 # order to compile with SDL_ttf.
 
-#Linux-dependent right now, modify for platform-independency later
+# Linux-dependent right now, modify for platform-independency later
+# is now adapted for maemo (and dh_* scripts)
+
 CC = gcc
 DBG = gdb
 STD = _GNU_SOURCE
-CFLAGS = `sdl-config --cflags` -I/usr/local/include/SDL
-LFLAGS = `sdl-config --static-libs` -lSDL_image -lSDL_ttf
+CFLAGS = `sdl-config --cflags` -I/usr/local/include/SDL `pkg-config hildon-1 --cflags` -I/usr/include/dbus-1.0/ -I/usr/lib/dbus-1.0/include/
+LFLAGS = `sdl-config --static-libs ` -lSDL_image -lSDL_ttf -lSDL_mixer `pkg-config hildon-1 --libs` `pkg-config --libs  libosso` -lhgw
 
-MAIN_OBJ = main.o graphics.o mancala.o
+# MAIN_OBJ = main.o graphics.o mancala.o sounds.o play.o
+MAIN_OBJ = graphics.o mancala.o sounds.o play.o callbacks.o
 TEST_OBJ = ai-test.o mancala.o
 
 NORMAL = ai.o
 RECURSE = ai-init.o ai-recurse.o
 ULTIMATE = ai-init.o ai-ultimate.o
 
+subsystem:
+       $(MAKE) -C launcher
+       $(MAKE) -C plugin 
+
 #'$<' is filename of input, '$@' is filename of output
 .c.o:
        $(CC) -c -g$(DBG) -Wall $(CFLAGS) -D$(STD) $<
@@ -30,6 +38,8 @@ ULTIMATE = ai-init.o ai-ultimate.o
        $(CC) -c -g$(DBG) -Wall $(CFLAGS) -D$(STD) $<
 
 all:           $(MAIN_OBJ) $(NORMAL)
+       $(MAKE) -C launcher all
+       $(MAKE) -C plugin all
        $(CC) $(MAIN_OBJ) $(NORMAL) $(LFLAGS) -o mancala
 
 recurse:       $(MAIN_OBJ) $(RECURSE)
@@ -48,19 +58,29 @@ ai-test-ultimate:   $(TEST_OBJ) $(ULTIMATE)
        $(CC) $(TEST_OBJ) $(ULTIMATE) $(LFLAGS) -o ai-test
 
 install:       all
-       mkdir /usr/share/pixmaps/mancala
-       cp ../res/*.png /usr/share/pixmaps/mancala
-       cp ./mancala /usr/bin
+       mkdir -p $(DESTDIR)/home/opt/mancala/bin/
+       cp ./mancala $(DESTDIR)/home/opt/mancala/bin/
+       mkdir -p $(DESTDIR)/home/opt/mancala/data/
+       cp ../data/*.png $(DESTDIR)/home/opt/mancala/data/
+       cp ../data/*.wav $(DESTDIR)/home/opt/mancala/data/
+       cp ../data/*.ttf $(DESTDIR)/home/opt/mancala/data/
+       $(MAKE) -C launcher install
+       $(MAKE) -C plugin install
+
 
 uninstall:
-       rm -rf /usr/share/pixmaps/mancala
-       rm /usr/bin/mancala
+       rm -rf $(DESTDIR)/home/opt/mancala/
+
 
 clean:
        rm -f *.o *.core *.swp *~ *.log
+       $(MAKE) -C launcher clean
+       $(MAKE) -C plugin clean
 
 clobber:       clean
        rm -f mancala ai-test
+       $(MAKE) -C launcher clobber
+       $(MAKE) -C plugin clobber
 
 distclean:     clobber
        @echo "No configuration files to distclean yet."