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
|
||||
CXXFLAGS += -DUNIX
|
||||
EXEEXT=
|
||||
|
||||
include common.mk
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
PROG = tbftss.exe
|
||||
EXEEXT=.exe
|
||||
CC=x86_64-w64-mingw32-gcc
|
||||
|
||||
include common.mk
|
||||
|
|
12
common.mk
12
common.mk
|
@ -1,5 +1,7 @@
|
|||
PROG = tbftss
|
||||
|
||||
TARGET=$(PROG)$(EXEEXT)
|
||||
|
||||
VERSION = 0.4
|
||||
REVISION = $(shell date +"%y%m%d")
|
||||
DEBUG = 0
|
||||
|
@ -8,7 +10,7 @@ CXXFLAGS += `sdl2-config --cflags` -DVERSION=$(VERSION) -DREVISION=$(REVISION) -
|
|||
CXXFLAGS += -Wall -ansi -pedantic -Werror -Wstrict-prototypes
|
||||
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
|
||||
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
|
||||
|
||||
# top-level rule to create the program.
|
||||
all: $(PROG)
|
||||
all: $(TARGET)
|
||||
|
||||
# compiling other source files.
|
||||
%.o: %.c %.h $(DEPS)
|
||||
$(CC) $(CFLAGS) $(CXXFLAGS) -c $<
|
||||
|
||||
# linking the program.
|
||||
$(PROG): $(OBJS)
|
||||
$(CC) -o $(PROG) $(OBJS) $(LIBS)
|
||||
$(TARGET): $(OBJS)
|
||||
$(CC) -o $@ $(OBJS) $(LIBS)
|
||||
|
||||
# prepare an archive for the program
|
||||
dist:
|
||||
|
@ -62,6 +64,6 @@ dist:
|
|||
|
||||
# cleaning everything that can be automatically recreated with "make".
|
||||
clean:
|
||||
$(RM) $(OBJS) $(PROG)
|
||||
$(RM) $(OBJS) $(TARGET)
|
||||
|
||||
.PHONY: dist
|
||||
|
|
|
@ -20,6 +20,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "init.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
#define UNIX 1
|
||||
#endif
|
||||
|
||||
|
||||
#if UNIX
|
||||
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);
|
||||
}
|
||||
|
||||
#if UNIX
|
||||
#ifdef UNIX
|
||||
static void createSaveFolder(void)
|
||||
{
|
||||
char *userHome;
|
||||
|
|
Loading…
Reference in New Issue