-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (49 loc) · 1.6 KB
/
Copy pathMakefile
File metadata and controls
65 lines (49 loc) · 1.6 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
.SUFFIXES:
.DEFAULT_GOAL := help
ROOT_DIR := $(CURDIR)
export ROOT_DIR
BUILD_3DS := build/n3ds
TARGET_3DS := cinnamon
SOURCES_3DS := src src/n3ds
INCLUDES_3DS := src src/n3ds vendor vendor/stb/ds
BUILD_WIIU := build/wiiu
CMAKE ?= cmake
ifeq ($(OS),Windows_NT)
ifneq ($(wildcard /opt/devkitpro/msys2/usr/bin/cmake.exe),)
CMAKE := /opt/devkitpro/msys2/usr/bin/cmake.exe
endif
endif
DEVKITPRO_CMAKE_PATH := $(DEVKITPRO)
ifeq ($(OS),Windows_NT)
ifneq ($(strip $(DEVKITPRO)),)
CYGPATH := $(firstword $(wildcard C:/devkitPro/msys2/usr/bin/cygpath.exe) $(wildcard /usr/bin/cygpath))
ifneq ($(strip $(CYGPATH)),)
DEVKITPRO_CMAKE_PATH := $(shell "$(CYGPATH)" -u "$(DEVKITPRO)")
endif
endif
endif
.PHONY: help 3ds 3ds-clean wiiu wiiu-clean
help:
@echo "Available targets: 3ds, 3ds-clean, wiiu, wiiu-clean"
wiiu:
@"$(CMAKE)" --fresh -S "$(ROOT_DIR)" -B "$(ROOT_DIR)/$(BUILD_WIIU)" -G "Unix Makefiles" \
-DCMAKE_TOOLCHAIN_FILE="$(DEVKITPRO_CMAKE_PATH)/cmake/WiiU.cmake" \
-DPLATFORM=wiiu \
-DCMAKE_BUILD_TYPE=Release
@"$(CMAKE)" --build "$(ROOT_DIR)/$(BUILD_WIIU)"
wiiu-clean:
@rm -rf "$(ROOT_DIR)/$(BUILD_WIIU)"
THREEDS_GOALS := 3ds
ifneq ($(filter $(THREEDS_GOALS),$(MAKECMDGOALS)),)
ifeq ($(strip $(DEVKITPRO)),)
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to devkitPro>")
endif
3ds:
@"$(CMAKE)" --fresh -S "$(ROOT_DIR)" -B "$(ROOT_DIR)/$(BUILD_3DS)" -G "Unix Makefiles" \
-DCMAKE_TOOLCHAIN_FILE="$(DEVKITPRO_CMAKE_PATH)/cmake/3DS.cmake" \
-DPLATFORM=n3ds \
-DCMAKE_BUILD_TYPE=Release
@"$(CMAKE)" --build "$(ROOT_DIR)/$(BUILD_3DS)"
endif
3ds-clean:
@rm -rf "$(ROOT_DIR)/$(BUILD_3DS)"