+#-------------------------------------------------------------------------------
+
+#VERSION=1.5.0
+VERSION= $(shell sh scripts/version.sh)
+
+ifeq ($(VERSION),)
+ $(error Failed to obtain version for this build.)
+endif
+
#------------------------------------------------------------------------------
# Maybe you need one of these. Maybe you don't.
OGL_LIBS= -lGL -lm
#OGL_LIBS= -lm # Think Different
-#------------------------------------------------------------------------------
-# Configuration constants
-#------------------------------------------------------------------------------
-
CFLAGS= -Wall -g -O3 -ansi -pedantic $(shell sdl-config --cflags)
#CFLAGS= -Wall -g -O1 -ansi -pedantic $(shell sdl-config --cflags)
#CFLAGS= -Wall -pg -ansi $(shell sdl-config --cflags)
+CPPFLAGS := -DVERSION=\"$(VERSION)\" -Ishare $(CPPFLAGS)
+
SDL_LIBS= $(shell sdl-config --libs)
-FT2_LIBS= $(shell freetype-config --libs)
+PNG_LIBS= $(shell libpng-config --libs)
+
+MAPC_TARG= mapc$(EXT)
+BALL_TARG= neverball$(EXT)
+PUTT_TARG= neverputt$(EXT)
-MAPC_TARG= mapc
-MAPC_EXEC = ./$(MAPC_TARG)
-BALL_TARG= neverball
-PUTT_TARG= neverputt
+MAPC_EXEC= ./$(MAPC_TARG)
LOCALEDIR= locale
LOCALEDOM= neverball
MAPC_DEPS= $(MAPC_OBJS:.o=.d)
BASE_LIBS= $(SDL_LIBS) -lSDL_image
-LIBS= $(X11_PATH) $(BASE_LIBS) -lSDL_ttf -lSDL_mixer $(FT2_LIBS) $(OGL_LIBS)
+LIBS= $(X11_PATH) $(BASE_LIBS) $(PNG_LIBS) -lSDL_ttf -lSDL_mixer $(OGL_LIBS)
MESSAGEPART= /LC_MESSAGES/$(LOCALEDOM).mo
MESSAGES= $(LINGUAS:%=$(LOCALEDIR)/%$(MESSAGEPART))
#------------------------------------------------------------------------------
%.d : %.c
- $(CC) $(CFLAGS) -Ishare -MM -MF $@ $<
- sed -i 's+^[^:]*:+$*.o $@ :+' $@
+ $(CC) $(CFLAGS) $(CPPFLAGS) -MM -MF $@ -MT '$*.o $@' $<
%.o : %.c
- $(CC) $(CFLAGS) -Ishare -o $@ -c $<
+ $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
%.sol : %.map $(MAPC_TARG)
$(MAPC_EXEC) $< data
test : all
./neverball
+tools :
+ cd tools && $(MAKE)
+
+mingw-%:
+ $(MAKE) -f Makefile.mingw $*
+
#------------------------------------------------------------------------------
# PO update rules
#------------------------------------------------------------------------------
touch $@
po-update-extract :
- bash extractpo.sh $(POTFILE) $(LOCALEDOM)
+ sh scripts/extractpo.sh $(POTFILE) $(LOCALEDOM)
po-update-merge : $(POS)
#------------------------------------------------------------------------------
.PHONY : all sols locales clean-src clean test \
- po-update-extract po-update-merge po-update
+ po-update-extract po-update-merge po-update \
+ tools
-include $(BALL_DEPS) $(PUTT_DEPS) $(MAPC_DEPS)