-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (31 loc) · 1.06 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Makefile to automate CMake building
# process
# Default action is to prepare
# and compile all targets
all: prepare compile
# Test run the sample debug target
test: all debug
# Generate the project files with Ninja
prepare:
@echo "[Makefile] Generating project files..."
@cmake -G "Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=YES -B build -S src
# Build all targets with generated files
compile:
@echo "[Makefile] Building all targets..."
@cmake --build build
# Run the sample debug target
debug:
@echo "[Makefile] Running debug target..."
@./build/sdl2_debug
# Compile for windows
compile-windows:
@echo "[Makefile] Compile for Windows..."
@cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=`pwd`/toolchain/win-mingw.cmake -B build-win -S src
@cmake --build build-win
# Prepare release
release:
@echo "[Makefile] Compile all and zip release..."
@make prepare compile
@make compile-windows
@zip -j cg-any-linux.zip build/render data/camera/* data/objects/* data/light/*
@zip -j cg-win32-x64.zip build-win/render.exe build-win/SDL2.dll data/camera/* data/objects/* data/light/*