X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=Makefile;h=de2a853ac3c500c364f65acd871e6f2dbf6f8a02;hb=e8485694b9c8088212078223bf656504e763d733;hp=cf9e0a9718208da515fe5947f74e06204a9624d6;hpb=18fe5ede947fe8bc5cdc2cfa787182c3d3812686;p=neverball diff --git a/Makefile b/Makefile index cf9e0a9..de2a853 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ -#------------------------------------------------------------------------------- + +#------------------------------------------------------------------------------ VERSION := $(shell sh scripts/version.sh) ifeq ($(VERSION),unknown) @@ -14,8 +15,13 @@ endif #------------------------------------------------------------------------------ # Optional flags (CFLAGS, CPPFLAGS, ...) -#CFLAGS := -Wall -g -ansi -pedantic -CFLAGS := -Wall -O2 -ansi -pedantic +ifeq ($(ENABLE_WII),1) + # libwiimote is NOT ANSI compliant + CFLAGS := -O2 +else + #CFLAGS := -Wall -g -ansi -pedantic + CFLAGS := -Wall -O2 -ansi -pedantic +endif #------------------------------------------------------------------------------ # Mandatory flags @@ -38,6 +44,10 @@ else ALL_CPPFLAGS += -DENABLE_NLS=1 endif +ifeq ($(ENABLE_WII),1) + ALL_CPPFLAGS += -DENABLE_WII=1 +endif + ifdef DARWIN ALL_CPPFLAGS += -I/opt/local/include endif @@ -50,16 +60,35 @@ ALL_CPPFLAGS += $(CPPFLAGS) SDL_LIBS := $(shell sdl-config --libs) PNG_LIBS := $(shell libpng-config --libs) +# The non-conditionalised values below are specific to the native +# system. The native system of this Makefile is Linux (or GNU+Linux if +# you prefer). Please be sure to override ALL of them for each target +# system in the conditional parts below. + +INTL_LIBS := + +ifeq ($(ENABLE_WII),1) + TILT_LIBS := -lcwiimote -lbluetooth +endif + +OGL_LIBS := -lGL -lm + ifdef MINGW - OGL_LIBS := -lopengl32 -lm -else ifdef DARWIN - OGL_LIBS := -framework OpenGL -else - OGL_LIBS := -lGL -lm + ifneq ($(ENABLE_NLS),0) + INTL_LIBS := -lintl -liconv + endif + + TILT_LIBS := + OGL_LIBS := -lopengl32 -lm endif -ifneq ($(ENABLE_NLS),0) - INTL_LIBS := -lintl -liconv +ifdef DARWIN + ifneq ($(ENABLE_NLS),0) + INTL_LIBS := -lintl -liconv + endif + + TILT_LIBS := + OGL_LIBS := -framework OpenGL endif BASE_LIBS := -ljpeg $(PNG_LIBS) @@ -68,21 +97,26 @@ ifdef DARWIN BASE_LIBS += -L/opt/local/lib endif -ALL_LIBS := $(SDL_LIBS) $(BASE_LIBS) $(INTL_LIBS) -lSDL_ttf -lvorbisfile $(OGL_LIBS) +ALL_LIBS := $(SDL_LIBS) $(BASE_LIBS) $(TILT_LIBS) $(INTL_LIBS) -lSDL_ttf \ + -lvorbisfile $(OGL_LIBS) #------------------------------------------------------------------------------ ifdef MINGW - EXT := .exe - WINE := wine + EXT := .exe endif -#------------------------------------------------------------------------------ - MAPC_TARG := mapc$(EXT) BALL_TARG := neverball$(EXT) PUTT_TARG := neverputt$(EXT) +ifdef MINGW + MAPC := $(WINE) ./$(MAPC_TARG) +else + MAPC := ./$(MAPC_TARG) +endif + + #------------------------------------------------------------------------------ MAPC_OBJS := \ @@ -103,6 +137,7 @@ BALL_OBJS := \ share/part.o \ share/back.o \ share/geom.o \ + share/ball.o \ share/gui.o \ share/base_config.o \ share/config.o \ @@ -110,6 +145,9 @@ BALL_OBJS := \ share/state.o \ share/audio.o \ share/text.o \ + share/sync.o \ + share/tilt.o \ + share/common.o \ ball/hud.o \ ball/mode.o \ ball/game.o \ @@ -147,6 +185,7 @@ PUTT_OBJS := \ share/solid_gl.o \ share/part.o \ share/geom.o \ + share/ball.o \ share/back.o \ share/base_config.o \ share/config.o \ @@ -155,6 +194,7 @@ PUTT_OBJS := \ share/state.o \ share/gui.o \ share/text.o \ + share/sync.o \ putt/hud.o \ putt/game.o \ putt/hole.o \ @@ -177,7 +217,7 @@ SOLS := $(MAPS:%.map=%.sol) $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) -o $@ -c $< %.sol : %.map $(MAPC_TARG) - $(WINE) ./$(MAPC_TARG) $< data + $(MAPC) $< data #------------------------------------------------------------------------------ @@ -192,6 +232,12 @@ $(PUTT_TARG) : $(PUTT_OBJS) $(MAPC_TARG) : $(MAPC_OBJS) $(CC) $(ALL_CFLAGS) -o $(MAPC_TARG) $(MAPC_OBJS) $(LDFLAGS) $(BASE_LIBS) +# Work around some extremely helpful sdl-config scripts. + +ifdef MINGW +$(MAPC_TARG) : ALL_CPPFLAGS := $(ALL_CPPFLAGS) -Umain +endif + sols : $(SOLS) locales : @@ -242,7 +288,7 @@ TEXT_DOCS := \ TXT_DOCS := $(TEXT_DOCS:%=%.txt) -#----------------------------------------------------------------------------- +#------------------------------------------------------------------------------ .PHONY: setup setup: $(INSTALLER) @@ -258,7 +304,7 @@ clean-setup: clean find data -name "*.txt" -exec $(FROMDOS) {} \; $(MAKE) -C tools EXT=$(EXT) clean -#----------------------------------------------------------------------------- +#------------------------------------------------------------------------------ .PHONY: install-dlls install-dlls: install-dlls.sh @@ -275,7 +321,7 @@ install-dlls.sh: @echo -------------------------------------------------------- @exit 1 -#----------------------------------------------------------------------------- +#------------------------------------------------------------------------------ .PHONY: convert-text-files convert-text-files: $(TXT_DOCS) @@ -285,7 +331,7 @@ convert-text-files: $(TXT_DOCS) $(CP) $< $@ $(TODOS) $@ -#----------------------------------------------------------------------------- +#------------------------------------------------------------------------------ .PHONY: tools tools: