Got windows building. Need to test with CI/CD

This commit is contained in:
aryeh 2020-11-27 11:44:38 +11:00
parent 91c0fc115e
commit 012259869e

View File

@ -1,5 +1,6 @@
# Set general macros # Set general macros
buildFile = build/app buildFile = build/app
libGenDirectory = src
# Check for Windows # Check for Windows
ifeq ($(OS), Windows_NT) ifeq ($(OS), Windows_NT)
@ -7,7 +8,13 @@ ifeq ($(OS), Windows_NT)
platform = Windows platform = Windows
compiler = g++ compiler = g++
options = -pthread -lopengl32 -lgdi32 -lwinmm -mwindows options = -pthread -lopengl32 -lgdi32 -lwinmm -mwindows
# Windows-specific syntax
THEN = &&
MAKE = mingw32-make
# Set Windows commands # Set Windows commands
cleanCommand = del build\app.exe cleanCommand = del build\app.exe
else else
@ -25,11 +32,16 @@ else
platform = macOS platform = macOS
compiler = clang++ compiler = clang++
options = -framework CoreVideo -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL options = -framework CoreVideo -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL
libGenDirectory = src
endif endif
# Set UNIX commands # Set UNIX commands
mkdirOptions = -p mkdirOptions = -p
MAKE = make
# Copy Directories for Unix/Linux
RaylibDirectory = vendor/raylib-cpp/vendor/raylib/src/raylib.h
cleanCommand = rm $(buildFile) cleanCommand = rm $(buildFile)
endif endif
@ -49,22 +61,35 @@ setup: include lib
# Pull and update the the build submodules # Pull and update the the build submodules
pull: pull:
git submodule init; git submodule update git submodule init $(THEN) git submodule update
cd vendor/raylib-cpp; git submodule init; git submodule update cd vendor/raylib-cpp $(THEN) git submodule init $(THEN) git submodule update
# Copy the relevant header files into includes # Copy the relevant header files into includes
include: pull include: pull
# Copy commands for Windows
ifeq ($(OS), Windows_NT)
-mkdir $(mkdirOptions) include
copy vendor\raylib-cpp\vendor\raylib\src\raylib.h include
copy vendor\raylib-cpp\vendor\raylib\src\raymath.h include
copy vendor\raylib-cpp\include\*.hpp include
# Copy commands for UNIX/Linux
else
mkdir $(mkdirOptions) include mkdir $(mkdirOptions) include
cp vendor/raylib-cpp/vendor/raylib/src/raylib.h include/raylib.h cp vendor/raylib-cpp/vendor/raylib/src/raylib.h include/raylib.h
cp vendor/raylib-cpp/vendor/raylib/src/raymath.h include/raymath.h cp vendor/raylib-cpp/vendor/raylib/src/raymath.h include/raymath.h
cp vendor/raylib-cpp/include/*.hpp include cp vendor/raylib-cpp/include/*.hpp include
endif
# Build the raylib static library file and copy it into lib # Build the raylib static library file and copy it into lib
lib: pull lib: pull
cd vendor/raylib-cpp/vendor/raylib/src; make PLATFORM=PLATFORM_DESKTOP cd vendor/raylib-cpp/vendor/raylib/src $(THEN) $(MAKE) PLATFORM=PLATFORM_DESKTOP
ifeq ($(OS), Windows_NT)
-mkdir $(mkdirOptions) lib\$(platform)
copy vendor\raylib-cpp\vendor\raylib\$(libGenDirectory)\libraylib.a lib\$(platform)
else
mkdir $(mkdirOptions) lib/$(platform) mkdir $(mkdirOptions) lib/$(platform)
cp vendor/raylib-cpp/vendor/raylib/$(libGenDirectory)/libraylib.a lib/$(platform)/libraylib.a cp vendor/raylib-cpp/vendor/raylib/$(libGenDirectory)/libraylib.a lib/$(platform)/libraylib.a
endif
# Create the build folder # Create the build folder
build: build:
mkdir $(mkdirOptions) build mkdir $(mkdirOptions) build