Merge pull request #2 from nnesse/develop
Build system improvements for windows
This commit is contained in:
commit
e44aad495c
3
Makefile
3
Makefile
|
@ -1,5 +1,4 @@
|
||||||
PROG = tbftss
|
|
||||||
CC=gcc
|
CC=gcc
|
||||||
CXXFLAGS += -DUNIX
|
EXEEXT=
|
||||||
|
|
||||||
include common.mk
|
include common.mk
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
PROG = tbftss.exe
|
EXEEXT=.exe
|
||||||
CC=x86_64-w64-mingw32-gcc
|
CC=x86_64-w64-mingw32-gcc
|
||||||
|
|
||||||
include common.mk
|
include common.mk
|
||||||
|
|
12
common.mk
12
common.mk
|
@ -1,5 +1,7 @@
|
||||||
PROG = tbftss
|
PROG = tbftss
|
||||||
|
|
||||||
|
TARGET=$(PROG)$(EXEEXT)
|
||||||
|
|
||||||
VERSION = 0.4
|
VERSION = 0.4
|
||||||
REVISION = $(shell date +"%y%m%d")
|
REVISION = $(shell date +"%y%m%d")
|
||||||
DEBUG = 0
|
DEBUG = 0
|
||||||
|
@ -8,7 +10,7 @@ CXXFLAGS += `sdl2-config --cflags` -DVERSION=$(VERSION) -DREVISION=$(REVISION) -
|
||||||
CXXFLAGS += -Wall -ansi -pedantic -Werror -Wstrict-prototypes
|
CXXFLAGS += -Wall -ansi -pedantic -Werror -Wstrict-prototypes
|
||||||
CXXFLAGS += -g -lefence
|
CXXFLAGS += -g -lefence
|
||||||
|
|
||||||
LIBS = `sdl2-config --libs` -lSDL2_mixer -lSDL2_image -lSDL2_ttf -lm
|
LIBS := `sdl2-config --libs` -lSDL2_mixer -lSDL2_image -lSDL2_ttf -lm
|
||||||
|
|
||||||
SEARCHPATH += src/ src/battle src/draw src/game src/galaxy src/json src/system src/test
|
SEARCHPATH += src/ src/battle src/draw src/game src/galaxy src/json src/system src/test
|
||||||
vpath %.c $(SEARCHPATH)
|
vpath %.c $(SEARCHPATH)
|
||||||
|
@ -38,15 +40,15 @@ OBJS += waypoints.o widgets.o
|
||||||
DIST_FILES = data gfx manual music sound src LICENSE makefile README.md CHANGELOG
|
DIST_FILES = data gfx manual music sound src LICENSE makefile README.md CHANGELOG
|
||||||
|
|
||||||
# top-level rule to create the program.
|
# top-level rule to create the program.
|
||||||
all: $(PROG)
|
all: $(TARGET)
|
||||||
|
|
||||||
# compiling other source files.
|
# compiling other source files.
|
||||||
%.o: %.c %.h $(DEPS)
|
%.o: %.c %.h $(DEPS)
|
||||||
$(CC) $(CFLAGS) $(CXXFLAGS) -c $<
|
$(CC) $(CFLAGS) $(CXXFLAGS) -c $<
|
||||||
|
|
||||||
# linking the program.
|
# linking the program.
|
||||||
$(PROG): $(OBJS)
|
$(TARGET): $(OBJS)
|
||||||
$(CC) -o $(PROG) $(OBJS) $(LIBS)
|
$(CC) -o $@ $(OBJS) $(LIBS)
|
||||||
|
|
||||||
# prepare an archive for the program
|
# prepare an archive for the program
|
||||||
dist:
|
dist:
|
||||||
|
@ -62,6 +64,6 @@ dist:
|
||||||
|
|
||||||
# cleaning everything that can be automatically recreated with "make".
|
# cleaning everything that can be automatically recreated with "make".
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(OBJS) $(PROG)
|
$(RM) $(OBJS) $(TARGET)
|
||||||
|
|
||||||
.PHONY: dist
|
.PHONY: dist
|
||||||
|
|
|
@ -20,6 +20,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
#define UNIX 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if UNIX
|
#if UNIX
|
||||||
static void createSaveFolder(void);
|
static void createSaveFolder(void);
|
||||||
|
@ -97,7 +101,7 @@ void initSDL(void)
|
||||||
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Game scale factor: %.2f,%.2f\n", app.scaleX, app.scaleY);
|
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Game scale factor: %.2f,%.2f\n", app.scaleX, app.scaleY);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if UNIX
|
#ifdef UNIX
|
||||||
static void createSaveFolder(void)
|
static void createSaveFolder(void)
|
||||||
{
|
{
|
||||||
char *userHome;
|
char *userHome;
|
||||||
|
|
Loading…
Reference in New Issue