Merge branch 'gles'
[neverball] / Makefile
index a22fed1..675a247 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,11 +4,11 @@
 BUILD := $(shell head -n1 BUILD 2> /dev/null || echo release)
 
 ifeq ($(BUILD),release)
-    VERSION := 1.5.4
+    VERSION := 1.5.5
 else
     VERSION := $(shell sh scripts/version.sh)
     ifeq ($(VERSION),unknown)
-        VERSION := 1.5.4-dev
+        VERSION := 1.5.5-dev
     endif
 endif
 
@@ -16,13 +16,12 @@ $(info Will make a "$(BUILD)" build of Neverball $(VERSION).)
 
 #------------------------------------------------------------------------------
 # Provide a target system hint for the Makefile.
+# Recognized PLATFORM values: darwin, mingw.
 
 ifeq ($(shell uname), Darwin)
-    DARWIN := 1
+    PLATFORM := darwin
 endif
 
-# MINGW=1 also supported.
-
 #------------------------------------------------------------------------------
 # Paths (packagers might want to set DATADIR and LOCALEDIR)
 
@@ -30,7 +29,7 @@ USERDIR   := .neverball
 DATADIR   := ./data
 LOCALEDIR := ./locale
 
-ifdef MINGW
+ifeq ($(PLATFORM),mingw)
     USERDIR := Neverball
 endif
 
@@ -54,7 +53,7 @@ endif
 
 # Compiler...
 
-ifeq ($(ENABLE_WII),1)
+ifeq ($(ENABLE_TILT),wii)
     # -std=c99 because we need isnormal and -fms-extensions because
     # libwiimote headers make heavy use of the "unnamed fields" GCC
     # extension.
@@ -83,11 +82,7 @@ else
     ALL_CPPFLAGS += -DENABLE_NLS=1
 endif
 
-ifeq ($(ENABLE_WII),1)
-    ALL_CPPFLAGS += -DENABLE_WII=1
-endif
-
-ifdef DARWIN
+ifeq ($(PLATFORM),darwin)
     ALL_CPPFLAGS += -I/opt/local/include
 endif
 
@@ -98,7 +93,12 @@ ALL_CPPFLAGS += $(CPPFLAGS)
 
 SDL_LIBS := $(shell sdl-config --libs)
 PNG_LIBS := $(shell libpng-config --libs)
+
+ifeq ($(ENABLE_FS),stdio)
+FS_LIBS :=
+else
 FS_LIBS := -lphysfs
+endif
 
 # The  non-conditionalised values  below  are specific  to the  native
 # system. The native system of this Makefile is Linux (or GNU+Linux if
@@ -107,13 +107,17 @@ FS_LIBS := -lphysfs
 
 INTL_LIBS :=
 
-ifeq ($(ENABLE_WII),1)
+ifeq ($(ENABLE_TILT),wii)
     TILT_LIBS := -lcwiimote -lbluetooth
+else
+ifeq ($(ENABLE_TILT),loop)
+    TILT_LIBS := -lusb-1.0 -lfreespace
+endif
 endif
 
 OGL_LIBS := -lGL -lm
 
-ifdef MINGW
+ifeq ($(PLATFORM),mingw)
     ifneq ($(ENABLE_NLS),0)
         INTL_LIBS := -lintl
     endif
@@ -122,7 +126,7 @@ ifdef MINGW
     OGL_LIBS  := -lopengl32 -lm
 endif
 
-ifdef DARWIN
+ifeq ($(PLATFORM),darwin)
     ifneq ($(ENABLE_NLS),0)
         INTL_LIBS := -lintl
     endif
@@ -133,7 +137,7 @@ endif
 
 BASE_LIBS := -ljpeg $(PNG_LIBS) $(FS_LIBS)
 
-ifdef DARWIN
+ifeq ($(PLATFORM),darwin)
     BASE_LIBS += -L/opt/local/lib
 endif
 
@@ -142,7 +146,7 @@ ALL_LIBS := $(SDL_LIBS) $(BASE_LIBS) $(TILT_LIBS) $(INTL_LIBS) -lSDL_ttf \
 
 #------------------------------------------------------------------------------
 
-ifdef MINGW
+ifeq ($(PLATFORM),mingw)
     EXT := .exe
 endif
 
@@ -150,7 +154,7 @@ MAPC_TARG := mapc$(EXT)
 BALL_TARG := neverball$(EXT)
 PUTT_TARG := neverputt$(EXT)
 
-ifdef MINGW
+ifeq ($(PLATFORM),mingw)
     MAPC := $(WINE) ./$(MAPC_TARG)
 else
     MAPC := ./$(MAPC_TARG)
@@ -162,15 +166,16 @@ endif
 MAPC_OBJS := \
        share/vec3.o        \
        share/base_image.o  \
-       share/solid.o       \
+       share/solid_base.o  \
        share/binary.o      \
        share/base_config.o \
        share/common.o      \
-       share/fs.o          \
+       share/fs_common.o   \
        share/fs_png.o      \
        share/fs_jpg.o      \
        share/dir.o         \
        share/array.o       \
+       share/list.o        \
        share/mapc.o
 BALL_OBJS := \
        share/lang.o        \
@@ -178,11 +183,12 @@ BALL_OBJS := \
        share/vec3.o        \
        share/base_image.o  \
        share/image.o       \
-       share/solid.o       \
-       share/solid_gl.o    \
-       share/solid_phys.o  \
+       share/solid_base.o  \
+       share/solid_vary.o  \
+       share/solid_draw.o  \
+       share/solid_cmd.o   \
+       share/solid_all.o   \
        share/part.o        \
-       share/back.o        \
        share/geom.o        \
        share/item.o        \
        share/ball.o        \
@@ -190,11 +196,11 @@ BALL_OBJS := \
        share/base_config.o \
        share/config.o      \
        share/video.o       \
+       share/glext.o       \
        share/binary.o      \
        share/state.o       \
        share/audio.o       \
        share/text.o        \
-       share/tilt.o        \
        share/common.o      \
        share/keynames.o    \
        share/syswm.o       \
@@ -203,16 +209,18 @@ BALL_OBJS := \
        share/cmd.o         \
        share/array.o       \
        share/dir.o         \
-       share/fs.o          \
+       share/fs_common.o   \
        share/fs_png.o      \
        share/fs_jpg.o      \
        share/fs_rwops.o    \
        share/fs_ov.o       \
+       share/sync.o        \
        ball/hud.o          \
        ball/game_common.o  \
        ball/game_client.o  \
        ball/game_server.o  \
        ball/game_proxy.o   \
+       ball/game_draw.o    \
        ball/score.o        \
        ball/level.o        \
        ball/progress.o     \
@@ -220,12 +228,12 @@ BALL_OBJS := \
        ball/demo.o         \
        ball/demo_dir.o     \
        ball/util.o         \
+       ball/speed.o        \
        ball/st_conf.o      \
        ball/st_demo.o      \
        ball/st_save.o      \
        ball/st_goal.o      \
-       ball/st_fall_out.o  \
-       ball/st_time_out.o  \
+       ball/st_fail.o      \
        ball/st_done.o      \
        ball/st_level.o     \
        ball/st_over.o      \
@@ -245,16 +253,18 @@ PUTT_OBJS := \
        share/vec3.o        \
        share/base_image.o  \
        share/image.o       \
-       share/solid.o       \
-       share/solid_gl.o    \
-       share/solid_phys.o  \
+       share/solid_base.o  \
+       share/solid_vary.o  \
+       share/solid_draw.o  \
+       share/solid_cmd.o   \
+       share/solid_all.o   \
        share/part.o        \
        share/geom.o        \
        share/ball.o        \
-       share/back.o        \
        share/base_config.o \
        share/config.o      \
        share/video.o       \
+       share/glext.o       \
        share/binary.o      \
        share/audio.o       \
        share/state.o       \
@@ -263,13 +273,14 @@ PUTT_OBJS := \
        share/common.o      \
        share/syswm.o       \
        share/list.o        \
-       share/fs.o          \
+       share/fs_common.o   \
        share/fs_png.o      \
        share/fs_jpg.o      \
        share/fs_rwops.o    \
        share/fs_ov.o       \
        share/dir.o         \
        share/array.o       \
+       share/sync.o        \
        putt/hud.o          \
        putt/game.o         \
        putt/hole.o         \
@@ -278,7 +289,30 @@ PUTT_OBJS := \
        putt/st_conf.o      \
        putt/main.o
 
-ifdef MINGW
+BALL_OBJS += share/solid_sim_sol.o
+PUTT_OBJS += share/solid_sim_sol.o
+
+ifeq ($(ENABLE_FS),stdio)
+BALL_OBJS += share/fs_stdio.o
+PUTT_OBJS += share/fs_stdio.o
+MAPC_OBJS += share/fs_stdio.o
+else
+BALL_OBJS += share/fs_physfs.o
+PUTT_OBJS += share/fs_physfs.o
+MAPC_OBJS += share/fs_physfs.o
+endif
+
+ifeq ($(ENABLE_TILT),wii)
+BALL_OBJS += share/tilt_wii.o
+else
+ifeq ($(ENABLE_TILT),loop)
+BALL_OBJS += share/tilt_loop.o
+else
+BALL_OBJS += share/tilt_null.o
+endif
+endif
+
+ifeq ($(PLATFORM),mingw)
 BALL_OBJS += neverball.ico.o
 PUTT_OBJS += neverputt.ico.o
 endif
@@ -322,7 +356,7 @@ $(MAPC_TARG) : $(MAPC_OBJS)
 
 # Work around some extremely helpful sdl-config scripts.
 
-ifdef MINGW
+ifeq ($(PLATFORM),mingw)
 $(MAPC_TARG) : ALL_CPPFLAGS := $(ALL_CPPFLAGS) -Umain
 endif
 
@@ -360,7 +394,7 @@ TAGS :
 
 #------------------------------------------------------------------------------
 
-ifdef MINGW
+ifeq ($(PLATFORM),mingw)
 
 #------------------------------------------------------------------------------