-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
113 lines (93 loc) · 3.28 KB
/
Makefile
File metadata and controls
113 lines (93 loc) · 3.28 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Copyright (c) 2019-2023 Damien Ciabrini
# This file is part of ngdevkit
#
# ngdevkit is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# ngdevkit is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with ngdevkit. If not, see <http://www.gnu.org/licenses/>.
EXAMPLES = \
01-helloworld \
02-sprite \
03-sprite-animation \
04-palette \
05-scrolling \
06-sound-adpcma \
07-attract-and-game \
08-software-dips \
09-horizontal-sync \
10-credits-management \
11-backup-ram \
12-prom-1mb \
13-prom-full-2mb \
14-prom-bankswitch \
15-sound-adpcmb \
16-sound-music \
17-hello-c++ \
18-memory-card \
include config.mk
all: .prebuild
for i in $(EXAMPLES); do $(MAKE) -C $$i || exit 1; done
clean:
for i in $(EXAMPLES); do $(MAKE) -C $$i clean; done
distclean:
for i in $(EXAMPLES); do $(MAKE) -C $$i distclean; done
find . -name '*~' -delete
rm -rf .prebuild config.log config.status configure aclocal.m4 config.mk 00-template/config.mk autom4te.cache
_examples:
@echo $(EXAMPLES)
# build the ngdevkit assets used in these examples only once to speed up things
.prebuild:
@ set -e
@ echo "Pre-building ngdevkit assets for all examples"
cp config.mk 00-template/config.mk
$(MAKE) -C 00-template generate
for i in $(EXAMPLES); do rsync -a 00-template/setup/ngdevkit-assets/ $$i/setup/ngdevkit-assets/; done
touch $@
# ngdevkit-gngeo config targets
all: build-gngeo-config
define GNGEO_DEFAULT_INPUT_SETTINGS =
# default blitter
blitter $(if $(findstring yes,$(GNGEO_GLSL)),glsl,soft)
$(if $(and $(findstring yes,$(GNGEO_GLSL)),$(if $(findstring yes,$(ENABLE_MINGW)),,nomingw)),shaderpath $(SHADER_PATH),)
$(if $(findstring yes,$(GNGEO_GLSL)),shader $(SHADER),)
# default scale factor
scale 3
# default key mapping
p1control A=K97,B=K115,C=K113,D=K119,START=K49,COIN=K51,UP=K82,DOWN=K81,LEFT=K80,RIGHT=K79,A=J0B0,B=J0B1,C=J0B2,D=J0B3,START=J0B9,COIN=J0B8,UP=J0a3,DOWN=J0a3,LEFT=J0A0,RIGHT=J0A0
p2control A=K103,B=K104,C=K116,D=K117,START=K50,COIN=K52,UP=K105,DOWN=K107,LEFT=K106,RIGHT=K108,A=J1B0,B=J1B1,C=J1B2,D=J1B3,START=J1B9,COIN=J1B8,UP=J1a3,DOWN=J1a3,LEFT=J1A0,RIGHT=J1A0
endef
ifeq ($(ENABLE_MINGW),yes)
GNGEO_CFG=$(GNGEO_INSTALL_PATH)/conf/ngdevkit-gngeorc
else
ifeq ($(ENABLE_MSYS2),yes)
GNGEO_CFG=$(shell cygpath $(HOMEDRIVE)$(HOMEPATH))/.gngeo/ngdevkit-gngeorc
else
GNGEO_CFG=$(HOME)/.gngeo/ngdevkit-gngeorc
endif
endif
build-gngeo-config: $(GNGEO_CFG)
$(GNGEO_CFG): export INPUT_SETTINGS:=$(GNGEO_DEFAULT_INPUT_SETTINGS)
$(GNGEO_CFG):
@ echo generating a default input config for gngeo; \
mkdir -p $(dir $(GNGEO_CFG)) && \
echo "$$INPUT_SETTINGS" > $(GNGEO_CFG)
# ngdevkit-gngeo shaders when running under mingw
ifeq ($(ENABLE_MINGW),yes)
ifneq ($(SHADER),)
ifneq ($(SHADER),noop.glslp)
ifneq ($(GLSL_SHADER_PATH),)
all: copy-gngeo-shaders
copy-gngeo-shaders: $(GNGEO_INSTALL_PATH)/shaders/$(SHADER)
endif
endif
endif
endif
.PHONY: all clean distclean _examples