Windows makefile fixes

This commit is contained in:
Timothy Warren 2015-04-28 09:55:43 -04:00
parent e7bc307805
commit de0a51cf05

View File

@ -31,6 +31,7 @@ ifeq ($(OS),Linux)
CXX += -std=c++11 CXX += -std=c++11
endif endif
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
CXXFLAGS = -DNDEBUG -DSTATIC_BUILD
CXX += -I/include -DWIN32 CXX += -I/include -DWIN32
LDLIBS += -L/lib -lwsock32 LDLIBS += -L/lib -lwsock32
endif endif
@ -51,32 +52,37 @@ json_wrapper_build:
build: build:
@mkdir -p build @mkdir -p build
$(TYRO_LIB): $(OBJECTS) $(TYRO_LIB): build $(OBJECTS)
ar rcs $@ $(OBJECTS) ar rcs $@ $(OBJECTS)
ranlib $@ ranlib $@
$(PROGRAM): CXXFLAGS += $(WX_CXXFLAGS) $(TYRO_LIB) $(PROGRAM): CXXFLAGS += $(WX_CXXFLAGS) $(TYRO_LIB)
$(PROGRAM): $(PROGRAM):
$(CXX) $(CXXFLAGS) $(PROGRAM_SRC) $(TYRO_LIB) $(WX_LDLIBS) -o $(PROGRAM) $(CXX) $(CXXFLAGS) $(PROGRAM_SRC) $(TYRO_LIB) $(WX_LDLIBS) $(LDLIBS) -o $(PROGRAM)
lib: $(OBJECTS) $(TYRO_LIB)
run: run:
./build/Tyro ./build/Tyro
run-grind: run-grind:
valgrind ./build/Tryo valgrind $(PROGRAM)
# Make optimized and striped executable # Make optimized and striped executable
release: all release:
strip -SXx $(PROGRAM)
ifeq ($(OS),Darwin) ifeq ($(OS),Darwin)
strip -SXx $(PROGRAM)
make Tyro.app make Tyro.app
endif endif
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
make exe make exe
endif endif
ifeq ($(OS),Linux)
make all
strip -SXx $(PROGRAM)
endif
# Windows resource linking # Windows resource linking
@ -84,7 +90,8 @@ msw_resource:
$(WX_RES) resources/platform/msw/resource.rc -O coff -o resource.res $(WX_RES) resources/platform/msw/resource.rc -O coff -o resource.res
exe: LDLIBS += resource.res exe: LDLIBS += resource.res
exe: msw_resource all exe: json_wrapper_build json_wrapper $(TYRO_LIB)
exe: msw_resource $(PROGRAM)
# OS X application bundle # OS X application bundle
Tyro.app: all resources/platform/osx/Info.plist Tyro.app: all resources/platform/osx/Info.plist