-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: build mingw version of SporeModManager & SporeModLoader
- Loading branch information
1 parent
028dad3
commit 85e6618
Showing
7 changed files
with
201 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,25 @@ | ||
# | ||
# SporeModManager Makefile | ||
# | ||
THIRDPARTY_DIR := 3rdParty | ||
BINARY_DIR := bin | ||
SOURCE_DIR := SporeModManager | ||
EXE_FILE := SporeModManager | ||
VERBOSE := 0 | ||
SOURCE_DIR := $(CURDIR) | ||
THIRDPARTY_DIR := $(SOURCE_DIR)/3rdParty | ||
|
||
PKG_CONFIG := pkg-config | ||
CC := gcc | ||
CXX := g++ | ||
CFLAGS := \ | ||
-I$(THIRDPARTY_DIR)/zlib \ | ||
-I$(THIRDPARTY_DIR)/zlib/contrib/minizip | ||
CXXFLAGS := -std=c++17 \ | ||
-I$(SOURCE_DIR) \ | ||
-I$(THIRDPARTY_DIR)/tinyxml2 \ | ||
-I$(THIRDPARTY_DIR)/zlib \ | ||
-I$(THIRDPARTY_DIR)/zlib/contrib/minizip | ||
OPTFLAGS := -Os -flto | ||
LDFLAGS := -flto -s | ||
export THIRDPARTY_DIR | ||
|
||
OBJECT_FILES := \ | ||
$(SOURCE_DIR)/SporeModManagerHelpers/FileVersion.o \ | ||
$(SOURCE_DIR)/SporeModManagerHelpers/Path.o \ | ||
$(SOURCE_DIR)/SporeModManagerHelpers/SporeMod.o \ | ||
$(SOURCE_DIR)/SporeModManagerHelpers/SporeModXml.o \ | ||
$(SOURCE_DIR)/SporeModManagerHelpers/String.o \ | ||
$(SOURCE_DIR)/SporeModManagerHelpers/UI.o \ | ||
$(SOURCE_DIR)/SporeModManagerHelpers/Zip.o \ | ||
$(SOURCE_DIR)/SporeModManager.o \ | ||
$(SOURCE_DIR)/main.o | ||
all: SporeModLoader SporeModManager SporeModManager.exe | ||
|
||
HEADER_FILES := \ | ||
$(SOURCE_DIR)/SporeModManager.hpp \ | ||
$(SOURCE_DIR)/SporeModManagerHelpers.hpp | ||
|
||
|
||
THIRDPARTY_OBJECT_FILES := \ | ||
$(THIRDPARTY_DIR)/tinyxml2/tinyxml2.o \ | ||
$(THIRDPARTY_DIR)/zlib/adler32.o \ | ||
$(THIRDPARTY_DIR)/zlib/crc32.o \ | ||
$(THIRDPARTY_DIR)/zlib/inflate.o \ | ||
$(THIRDPARTY_DIR)/zlib/inffast.o \ | ||
$(THIRDPARTY_DIR)/zlib/inftrees.o \ | ||
$(THIRDPARTY_DIR)/zlib/zutil.o \ | ||
$(THIRDPARTY_DIR)/zlib/contrib/minizip/unzip.o \ | ||
$(THIRDPARTY_DIR)/zlib/contrib/minizip/ioapi.o | ||
|
||
THIRDPARTY_HEADER_FILES := \ | ||
$(THIRDPARTY_DIR)/zlib/zconf.h | ||
|
||
|
||
ifeq ($(VERBOSE), 0) | ||
QUIET := @ | ||
else | ||
QUIET := | ||
endif | ||
|
||
%.o: %.c $(THIRDPARTY_HEADER_FILES) | ||
@echo "CC $<" | ||
$(QUIET)$(CC) -c $< -o $@ $(OPTFLAGS) $(CFLAGS) | ||
|
||
%.o: %.cpp $(HEADER_FILES) $(THIRDPARTY_HEADER_FILES) | ||
@echo "CXX $<" | ||
$(QUIET)$(CXX) -c $< -o $@ $(OPTFLAGS) $(CXXFLAGS) | ||
|
||
all: $(BINARY_DIR)/$(EXE_FILE) | ||
|
||
$(BINARY_DIR): | ||
$(QUIET)mkdir -p $@ | ||
clean: | ||
$(MAKE) -C SporeModLoader clean | ||
$(MAKE) -C SporeModManager clean | ||
$(MAKE) -C SporeModManager clean MINGW=1 | ||
|
||
$(THIRDPARTY_DIR)/zlib/zconf.h: | ||
@echo "GEN $@" | ||
$(QUIET)cp $@.in $@ | ||
SporeModLoader: | ||
$(MAKE) -C $@ SOURCE_DIR=$(SOURCE_DIR)/$@ BINARY_DIR=$(SOURCE_DIR)/bin/SporebinEP1 | ||
|
||
$(BINARY_DIR)/$(EXE_FILE): $(BINARY_DIR) $(THIRDPARTY_OBJECT_FILES) $(OBJECT_FILES) | ||
@echo "LD $@" | ||
$(QUIET)$(CXX) $(OBJECT_FILES) $(THIRDPARTY_OBJECT_FILES) -o $@ $(LDFLAGS) | ||
SporeModManager: | ||
$(MAKE) -C $@ SOURCE_DIR=$(SOURCE_DIR)/$@ BINARY_DIR=$(SOURCE_DIR)/bin/SporeModLoader/SporeModManager | ||
|
||
clean: | ||
rm -f $(BINARY_DIR)/$(EXE_FILE) $(OBJECT_FILES) $(THIRDPARTY_OBJECT_FILES) $(THIRDPARTY_HEADER_FILES) | ||
SporeModManager.exe: | ||
$(MAKE) -C $(basename $@) SOURCE_DIR=$(SOURCE_DIR)/$(basename $@) BINARY_DIR=$(SOURCE_DIR)/bin/SporeModLoader/SporeModManager MINGW=1 | ||
|
||
.PHONY: all clean | ||
.PHONY: SporeModLoader SporeModManager SporeModManager.exe all clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# | ||
# SporeModLoader Makefile | ||
# | ||
THIRDPARTY_DIR ?= ../3rdParty | ||
BINARY_DIR ?= bin | ||
SOURCE_DIR ?= . | ||
DLL_FILE ?= dinput8.dll | ||
VERBOSE ?= 0 | ||
|
||
MINGW_CXX := i686-w64-mingw32-g++ | ||
MINGW_WINDRES := i686-w64-mingw32-windres | ||
CXXFLAGS := -std=c++17 \ | ||
-I$(SOURCE_DIR) \ | ||
-I$(THIRDPARTY_DIR)/Detours/src \ | ||
-Wno-attributes -Wp,-w | ||
OPTFLAGS := -Os -flto | ||
LDFLAGS := -s -flto | ||
|
||
OBJECT_FILES := \ | ||
$(SOURCE_DIR)/SporeModLoaderHelpers.obj \ | ||
$(SOURCE_DIR)/SporeModLoader.obj \ | ||
$(SOURCE_DIR)/dllmain.obj | ||
|
||
HEADER_FILES := \ | ||
$(SOURCE_DIR)/SporeModLoaderHelpers.hpp \ | ||
$(SOURCE_DIR)/SporeModLoader.hpp | ||
|
||
THIRDPARTY_OBJECT_FILES := \ | ||
$(THIRDPARTY_DIR)/Detours/src/detours.obj \ | ||
$(THIRDPARTY_DIR)/Detours/src/modules.obj \ | ||
$(THIRDPARTY_DIR)/Detours/src/disasm.obj \ | ||
$(THIRDPARTY_DIR)/Detours/src/image.obj \ | ||
$(THIRDPARTY_DIR)/Detours/src/creatwth.obj \ | ||
$(THIRDPARTY_DIR)/Detours/src/disolx86.obj | ||
|
||
ifeq ($(VERBOSE), 0) | ||
QUIET := @ | ||
else | ||
QUIET := | ||
endif | ||
|
||
%.obj: %.cpp $(HEADER_FILES) | ||
@echo "CXX $<" | ||
$(QUIET)$(MINGW_CXX) -c $< -o $@ $(OPTFLAGS) $(CXXFLAGS) | ||
|
||
all: $(BINARY_DIR)/$(DLL_FILE) | ||
|
||
$(BINARY_DIR): | ||
$(QUIET)mkdir -p $@ | ||
|
||
$(BINARY_DIR)/$(DLL_FILE): $(BINARY_DIR) $(THIRDPARTY_OBJECT_FILES) $(OBJECT_FILES) | ||
@echo "LD $@" | ||
$(QUIET)$(MINGW_CXX) $(THIRDPARTY_OBJECT_FILES) $(OBJECT_FILES) -static -shared $(SOURCE_DIR)/dllmain.def -o $@ $(LDFLAGS) | ||
|
||
clean: | ||
rm -f $(BINARY_DIR)/$(DLL_FILE) $(OBJECT_FILES) $(THIRDPARTY_OBJECT_FILES) $(THIRDPARTY_HEADER_FILES) | ||
|
||
.PHONY: all clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# | ||
# SporeModManager Makefile | ||
# | ||
THIRDPARTY_DIR ?= ../3rdParty | ||
BINARY_DIR ?= bin | ||
SOURCE_DIR ?= . | ||
EXE_FILE ?= SporeModManager | ||
VERBOSE ?= 0 | ||
MINGW ?= 0 | ||
|
||
ifeq ($(MINGW), 0) | ||
CC := gcc | ||
CXX := g++ | ||
LDFLAGS := -flto -s | ||
OPTFLAGS := -Os -flto | ||
OBJ := o | ||
EXE_EXT := | ||
else | ||
CC := i686-w64-mingw32-gcc | ||
CXX := i686-w64-mingw32-g++ | ||
LDFLAGS := -s -municode | ||
OPTFLAGS := -Os | ||
OBJ := obj | ||
EXE_EXT := .exe | ||
endif | ||
CFLAGS := \ | ||
-I$(THIRDPARTY_DIR)/zlib \ | ||
-I$(THIRDPARTY_DIR)/zlib/contrib/minizip | ||
CXXFLAGS := -std=c++17 \ | ||
-I$(SOURCE_DIR) \ | ||
-I$(THIRDPARTY_DIR)/tinyxml2 \ | ||
-I$(THIRDPARTY_DIR)/zlib \ | ||
-I$(THIRDPARTY_DIR)/zlib/contrib/minizip | ||
|
||
OBJECT_FILES := \ | ||
$(SOURCE_DIR)/SporeModManagerHelpers/FileVersion.$(OBJ) \ | ||
$(SOURCE_DIR)/SporeModManagerHelpers/Path.$(OBJ) \ | ||
$(SOURCE_DIR)/SporeModManagerHelpers/SporeMod.$(OBJ) \ | ||
$(SOURCE_DIR)/SporeModManagerHelpers/SporeModXml.$(OBJ) \ | ||
$(SOURCE_DIR)/SporeModManagerHelpers/String.$(OBJ) \ | ||
$(SOURCE_DIR)/SporeModManagerHelpers/UI.$(OBJ) \ | ||
$(SOURCE_DIR)/SporeModManagerHelpers/Zip.$(OBJ) \ | ||
$(SOURCE_DIR)/SporeModManager.$(OBJ) \ | ||
$(SOURCE_DIR)/main.$(OBJ) | ||
|
||
HEADER_FILES := \ | ||
$(SOURCE_DIR)/SporeModManager.hpp \ | ||
$(SOURCE_DIR)/SporeModManagerHelpers.hpp | ||
|
||
|
||
THIRDPARTY_OBJECT_FILES := \ | ||
$(THIRDPARTY_DIR)/tinyxml2/tinyxml2.$(OBJ) \ | ||
$(THIRDPARTY_DIR)/zlib/adler32.$(OBJ) \ | ||
$(THIRDPARTY_DIR)/zlib/crc32.$(OBJ) \ | ||
$(THIRDPARTY_DIR)/zlib/inflate.$(OBJ) \ | ||
$(THIRDPARTY_DIR)/zlib/inffast.$(OBJ) \ | ||
$(THIRDPARTY_DIR)/zlib/inftrees.$(OBJ) \ | ||
$(THIRDPARTY_DIR)/zlib/zutil.$(OBJ) \ | ||
$(THIRDPARTY_DIR)/zlib/contrib/minizip/unzip.$(OBJ) \ | ||
$(THIRDPARTY_DIR)/zlib/contrib/minizip/ioapi.$(OBJ) | ||
|
||
THIRDPARTY_HEADER_FILES := \ | ||
$(THIRDPARTY_DIR)/zlib/zconf.h | ||
|
||
|
||
ifeq ($(VERBOSE), 0) | ||
QUIET := @ | ||
else | ||
QUIET := | ||
endif | ||
|
||
%.$(OBJ): %.c $(THIRDPARTY_HEADER_FILES) | ||
@echo "CC $<" | ||
$(QUIET)$(CC) -c $< -o $@ $(OPTFLAGS) $(CFLAGS) | ||
|
||
%.$(OBJ): %.cpp $(HEADER_FILES) $(THIRDPARTY_HEADER_FILES) | ||
@echo "CXX $<" | ||
$(QUIET)$(CXX) -c $< -o $@ $(OPTFLAGS) $(CXXFLAGS) | ||
|
||
all: $(BINARY_DIR)/$(EXE_FILE)$(EXE_EXT) | ||
|
||
$(BINARY_DIR): | ||
$(QUIET)mkdir -p $@ | ||
|
||
$(THIRDPARTY_DIR)/zlib/zconf.h: | ||
@echo "GEN $@" | ||
$(QUIET)cp $@.in $@ | ||
|
||
$(BINARY_DIR)/$(EXE_FILE)$(EXE_EXT): $(BINARY_DIR) $(THIRDPARTY_OBJECT_FILES) $(OBJECT_FILES) | ||
@echo "LD $@" | ||
$(QUIET)$(CXX) $(OBJECT_FILES) $(THIRDPARTY_OBJECT_FILES) -o $@ $(LDFLAGS) | ||
|
||
clean: | ||
rm -f $(BINARY_DIR)/$(EXE_FILE)$(EXE_EXT) $(OBJECT_FILES) $(THIRDPARTY_OBJECT_FILES) $(THIRDPARTY_HEADER_FILES) | ||
|
||
.PHONY: all clean |