2 # Makefile to rebuild SM64 split image
10 # These options can either be changed by modifying the makefile, or
11 # by building with 'make SETTING=value'. 'make clean' may be required.
13 # Build debug version (default)
15 # Version of the game to build
17 # Graphics microcode used
19 # If COMPARE is 1, check the output sha1sum when building 'all'
21 # If NON_MATCHING is 1, define the NON_MATCHING and AVOID_UB macros when building (recommended)
24 # Build and optimize for Raspberry Pi(s)
27 # Build for Emscripten/WebGL
30 # Makeflag to enable OSX fixes
33 # Specify the target you are building for, TARGET_BITS=0 means native
37 # Disable better camera by default
39 # Disable no drawing distance by default
40 NODRAWINGDISTANCE ?
= 0
41 # Disable texture fixes by default (helps with them purists)
43 # Enable extended options menu by default
45 # Disable text-based save-files by default
47 # Load resources from external files
49 # Enable Discord Rich Presence
52 # Various workarounds for weird toolchains
59 # Renderers: GL, GL_LEGACY, D3D11, D3D12
61 # Window managers: SDL2, DXGI (forced if D3D11 or D3D12 in RENDER_API)
63 # Audio backends: SDL2
65 # Controller backends (can have multiple, space separated): SDL2
66 CONTROLLER_API ?
= SDL2
68 # Misc settings for EXTERNAL_DATA
73 # Automatic settings for PC port(s)
79 # Attempt to detect OS
81 ifeq ($(OS
),Windows_NT
)
84 HOST_OS ?
= $(shell uname
-s
2>/dev
/null || echo Unknown
)
85 # some weird MINGW/Cygwin env that doesn't define $OS
86 ifneq (,$(findstring MINGW
,HOST_OS
))
91 ifeq ($(TARGET_WEB
),0)
92 ifeq ($(HOST_OS
),Windows
)
99 ifeq ($(WINDOWS_BUILD
),1)
100 ifeq ($(CROSS
),i686-w64-mingw32.static-
)
104 else ifeq ($(CROSS
),x86_64-w64-mingw32.static-
)
111 ifneq ($(TARGET_BITS
),0)
112 BITS
:= -m
$(TARGET_BITS
)
115 # Release (version) flag defs
118 VERSION_CFLAGS
:= -DVERSION_JP
119 VERSION_ASFLAGS
:= --defsym VERSION_JP
=1
120 GRUCODE_CFLAGS
:= -DF3D_OLD
121 GRUCODE_ASFLAGS
:= --defsym F3D_OLD
=1
125 VERSION_CFLAGS
:= -DVERSION_US
126 VERSION_ASFLAGS
:= --defsym VERSION_US
=1
127 GRUCODE_CFLAGS
:= -DF3D_OLD
128 GRUCODE_ASFLAGS
:= --defsym F3D_OLD
=1
132 VERSION_CFLAGS
:= -DVERSION_EU
133 VERSION_ASFLAGS
:= --defsym VERSION_EU
=1
134 GRUCODE_CFLAGS
:= -DF3D_NEW
135 GRUCODE_ASFLAGS
:= --defsym F3D_NEW
=1
139 $(warning Building SH is experimental and is prone to breaking. Try at your own risk.
)
140 VERSION_CFLAGS
:= -DVERSION_SH
141 VERSION_ASFLAGS
:= --defsym VERSION_SH
=1
142 GRUCODE_CFLAGS
:= -DF3D_NEW
143 GRUCODE_ASFLAGS
:= --defsym F3D_NEW
=1
145 # TODO: GET RID OF THIS!!! We should mandate assets for Shindou like EU but we dont have the addresses extracted yet so we'll just pretend you have everything extracted for now.
148 $(error unknown version
"$(VERSION)")
154 # Stuff for showing the git hash in the intro on nightly builds
155 # From https://stackoverflow.com/questions/44038428/include-git-commit-hash-and-or-branch-name-in-c-c-source
156 ifeq ($(shell git rev-parse
--abbrev-ref HEAD
),nightly
)
157 GIT_HASH
=`git rev-parse --short HEAD`
158 COMPILE_TIME
=`date -u +'%Y-%m-%d %H:%M:%S UTC'`
159 VERSION_CFLAGS
+= -DNIGHTLY
-DGIT_HASH
="\"$(GIT_HASH)\"" -DCOMPILE_TIME
="\"$(COMPILE_TIME)\""
164 ifeq ($(GRUCODE
),f3dex
) # Fast3DEX
165 GRUCODE_CFLAGS
:= -DF3DEX_GBI
166 GRUCODE_ASFLAGS
:= --defsym F3DEX_GBI_SHARED
=1 --defsym F3DEX_GBI
=1
167 TARGET
:= $(TARGET
).f3dex
170 ifeq ($(GRUCODE
), f3dex2
) # Fast3DEX2
171 GRUCODE_CFLAGS
:= -DF3DEX_GBI_2
172 GRUCODE_ASFLAGS
:= --defsym F3DEX_GBI_SHARED
=1 --defsym F3DEX_GBI_2
=1
173 TARGET
:= $(TARGET
).f3dex2
176 ifeq ($(GRUCODE
), f3dex2e
) # Fast3DEX2 Extended (PC default)
177 GRUCODE_CFLAGS
:= -DF3DEX_GBI_2E
178 TARGET
:= $(TARGET
).f3dex2e
181 ifeq ($(GRUCODE
),f3d_new
) # Fast3D 2.0H (Shindou)
182 GRUCODE_CFLAGS
:= -DF3D_NEW
183 GRUCODE_ASFLAGS
:= --defsym F3D_NEW
=1
184 TARGET
:= $(TARGET
).f3d_new
187 ifeq ($(GRUCODE
),f3dzex
) # Fast3DZEX (2.0J / Animal Forest - DÅbutsu no Mori)
188 $(warning Fast3DZEX is experimental. Try at your own risk.
)
189 GRUCODE_CFLAGS
:= -DF3DEX_GBI_2
190 GRUCODE_ASFLAGS
:= --defsym F3DEX_GBI_SHARED
=1 --defsym F3DZEX_GBI
=1
191 TARGET
:= $(TARGET
).f3dzex
199 # Default build is for PC now
200 VERSION_CFLAGS
:= $(VERSION_CFLAGS
) -DNON_MATCHING
-DAVOID_UB
202 ifeq ($(TARGET_RPI
),1) # Define RPi to change SDL2 title & GLES2 hints
203 VERSION_CFLAGS
+= -DUSE_GLES
206 ifeq ($(OSX_BUILD
),1) # Modify GFX & SDL2 for OSX GL
207 VERSION_CFLAGS
+= -DOSX_BUILD
210 VERSION_ASFLAGS
:= --defsym AVOID_UB
=1
213 ifeq ($(TARGET_WEB
),1)
214 VERSION_CFLAGS
:= $(VERSION_CFLAGS
) -DTARGET_WEB
-DUSE_GLES
219 ifneq (,$(filter $(RENDER_API
),D3D11 D3D12
))
220 ifneq ($(WINDOWS_BUILD
),1)
221 $(error DirectX is only supported on Windows
)
223 ifneq ($(WINDOW_API
),DXGI
)
224 $(warning DirectX renderers require DXGI
, forcing WINDOW_API value
)
228 ifeq ($(WINDOW_API
),DXGI
)
229 $(error DXGI can only be used with DirectX renderers
)
233 ################### Universal Dependencies ###################
235 # (This is a bit hacky, but a lot of rules implicitly depend
236 # on tools and assets, and we use directory globs further down
237 # in the makefile that we want should cover assets.)
239 ifneq ($(MAKECMDGOALS
),clean)
240 ifneq ($(MAKECMDGOALS
),distclean)
242 # Make sure assets exist
244 ifeq ($(NOEXTRACT
),0)
245 DUMMY
!= .
/extract_assets.py
$(VERSION
) >&2 || echo FAIL
247 $(error Failed to extract assets
)
251 # Make tools if out of date
252 DUMMY
!= make
-C tools
>&2 || echo FAIL
254 $(error Failed to build tools
)
260 ################ Target Executable and Sources ###############
262 # BUILD_DIR is location where all build artifacts are placed
263 BUILD_DIR_BASE
:= build
265 ifeq ($(TARGET_WEB
),1)
266 BUILD_DIR
:= $(BUILD_DIR_BASE
)/$(VERSION
)_web
268 BUILD_DIR
:= $(BUILD_DIR_BASE
)/$(VERSION
)_pc
271 LIBULTRA
:= $(BUILD_DIR
)/libultra.a
273 ifeq ($(TARGET_WEB
),1)
274 EXE
:= $(BUILD_DIR
)/$(TARGET
).html
276 ifeq ($(WINDOWS_BUILD
),1)
277 EXE
:= $(BUILD_DIR
)/$(TARGET
).exe
279 else # Linux builds/binary namer
280 ifeq ($(TARGET_RPI
),1)
281 EXE
:= $(BUILD_DIR
)/$(TARGET
).arm
283 EXE
:= $(BUILD_DIR
)/$(TARGET
)
288 ELF
:= $(BUILD_DIR
)/$(TARGET
).elf
290 MIO0_DIR
:= $(BUILD_DIR
)/bin
291 SOUND_BIN_DIR
:= $(BUILD_DIR
)/sound
292 TEXTURE_DIR
:= textures
294 LEVEL_DIRS
:= $(patsubst levels
/%,%,$(dir $(wildcard levels
/*/header.h
)))
296 # Directories containing source files
299 SRC_DIRS
:= src src
/engine src
/game src
/audio src
/menu src
/buffers actors levels bin data assets src
/pc src
/pc/gfx src
/pc/audio src
/pc/controller src
/pc/fs src
/pc/fs
/packtypes
302 ifeq ($(DISCORDRPC
),1)
303 SRC_DIRS
+= src
/pc/discord
306 BIN_DIRS
:= bin bin
/$(VERSION
)
308 ULTRA_SRC_DIRS
:= lib
/src lib
/src
/math
309 ULTRA_ASM_DIRS
:= lib
/asm lib
/data
310 ULTRA_BIN_DIRS
:= lib
/bin
312 GODDARD_SRC_DIRS
:= src
/goddard src
/goddard
/dynlists
323 # Set BITS (32/64) to compile for
326 ifeq ($(TARGET_WEB
),1)
327 OPT_FLAGS
:= -O2
-g4
--source-map-base http
://localhost
:8080/
330 ifeq ($(TARGET_RPI
),1)
331 machine
= $(shell sh
-c
'uname -m 2>/dev/null || echo unknown')
332 # Raspberry Pi B+, Zero, etc
333 ifneq (,$(findstring armv6l
,$(machine
)))
334 OPT_FLAGS
:= -march
=armv6zk
+fp
-mfpu
=vfp
-Ofast
337 # Raspberry Pi 2 and 3 in ARM 32bit mode
338 ifneq (,$(findstring armv7l
,$(machine
)))
339 model
= $(shell sh
-c
'cat /sys/firmware/devicetree/base/model 2>/dev/null || echo unknown')
341 ifneq (,$(findstring 3,$(model
)))
342 OPT_FLAGS
:= -march
=armv8-a
+crc
-mtune
=cortex-a53
-mfpu
=neon-fp-armv8
-O3
344 OPT_FLAGS
:= -march
=armv7-a
-mtune
=cortex-a7
-mfpu
=neon-vfpv4
-O3
348 # RPi3 or RPi4, in ARM64 (aarch64) mode. NEEDS TESTING 32BIT.
349 # DO NOT pass -mfpu stuff here, thats for 32bit ARM only and will fail for 64bit ARM.
350 ifneq (,$(findstring aarch64
,$(machine
)))
351 model
= $(shell sh
-c
'cat /sys/firmware/devicetree/base/model 2>/dev/null || echo unknown')
352 ifneq (,$(findstring 3,$(model
)))
353 OPT_FLAGS
:= -march
=armv8-a
+crc
-mtune
=cortex-a53
-O3
354 else ifneq (,$(findstring 4,$(model
)))
355 OPT_FLAGS
:= -march
=armv8-a
+crc
+simd
-mtune
=cortex-a72
-O3
361 # File dependencies and variables for specific files
362 include Makefile.split
365 LEVEL_C_FILES
:= $(wildcard levels
/*/leveldata.c
) $(wildcard levels
/*/script.c
) $(wildcard levels
/*/geo.c
)
366 C_FILES
:= $(foreach dir,$(SRC_DIRS
),$(wildcard $(dir)/*.c
)) $(LEVEL_C_FILES
)
367 CXX_FILES
:= $(foreach dir,$(SRC_DIRS
),$(wildcard $(dir)/*.
cpp))
368 S_FILES
:= $(foreach dir,$(ASM_DIRS
),$(wildcard $(dir)/*.s
))
369 ULTRA_C_FILES
:= $(foreach dir,$(ULTRA_SRC_DIRS
),$(wildcard $(dir)/*.c
))
370 GODDARD_C_FILES
:= $(foreach dir,$(GODDARD_SRC_DIRS
),$(wildcard $(dir)/*.c
))
372 GENERATED_C_FILES
:= $(BUILD_DIR
)/assets
/mario_anim_data.c
$(BUILD_DIR
)/assets
/demo_data.c \
373 $(addprefix $(BUILD_DIR
)/bin
/,$(addsuffix _skybox.c
,$(notdir $(basename $(wildcard textures
/skyboxes
/*.png
)))))
375 # We need to keep this for now
376 # If we're not N64 use below
378 ULTRA_C_FILES_SKIP
:= \
406 osCreateViManager.c \
407 osViSetSpecialFeatures.c \
408 osVirtualToPhysical.c \
414 osCreatePiManager.c \
418 osEepromLongWrite.c \
422 osContStartReadData.c \
425 osAiSetNextBuffer.c \
429 __osSiRawStartDma.c \
430 __osViSwapContext.c \
431 __osViGetCurrentContext.c \
434 C_FILES
:= $(filter-out src
/game
/main.c
,$(C_FILES
))
435 ULTRA_C_FILES
:= $(filter-out $(addprefix lib
/src
/,$(ULTRA_C_FILES_SKIP
)),$(ULTRA_C_FILES
))
437 # "If we're not N64, use the above"
440 SOUND_BANK_FILES
:= $(wildcard sound
/sound_banks
/*.json
)
441 SOUND_SEQUENCE_FILES
:= $(wildcard sound
/sequences
/jp
/*.m64
) \
442 $(wildcard sound
/sequences
/*.m64
) \
443 $(foreach file
,$(wildcard sound
/sequences
/jp
/*.s
),$(BUILD_DIR
)/$(file
:.s
=.m64
)) \
444 $(foreach file
,$(wildcard sound
/sequences
/*.s
),$(BUILD_DIR
)/$(file
:.s
=.m64
))
446 SOUND_BANK_FILES
:= $(wildcard sound
/sound_banks
/*.json
)
447 SOUND_SEQUENCE_FILES
:= $(wildcard sound
/sequences
/$(VERSION
)/*.m64
) \
448 $(wildcard sound
/sequences
/*.m64
) \
449 $(foreach file
,$(wildcard sound
/sequences
/$(VERSION
)/*.s
),$(BUILD_DIR
)/$(file
:.s
=.m64
)) \
450 $(foreach file
,$(wildcard sound
/sequences
/*.s
),$(BUILD_DIR
)/$(file
:.s
=.m64
))
453 SOUND_SAMPLE_DIRS
:= $(wildcard sound
/samples
/*)
454 SOUND_SAMPLE_AIFFS
:= $(foreach dir,$(SOUND_SAMPLE_DIRS
),$(wildcard $(dir)/*.aiff
))
455 SOUND_SAMPLE_TABLES
:= $(foreach file
,$(SOUND_SAMPLE_AIFFS
),$(BUILD_DIR
)/$(file
:.aiff
=.table
))
456 SOUND_SAMPLE_AIFCS
:= $(foreach file
,$(SOUND_SAMPLE_AIFFS
),$(BUILD_DIR
)/$(file
:.aiff
=.aifc
))
457 SOUND_OBJ_FILES
:= $(SOUND_BIN_DIR
)/sound_data.ctl.o \
458 $(SOUND_BIN_DIR
)/sound_data.tbl.o \
459 $(SOUND_BIN_DIR
)/sequences.bin.o \
460 $(SOUND_BIN_DIR
)/bank_sets.o
463 O_FILES
:= $(foreach file
,$(C_FILES
),$(BUILD_DIR
)/$(file
:.c
=.o
)) \
464 $(foreach file
,$(CXX_FILES
),$(BUILD_DIR
)/$(file
:.
cpp=.o
)) \
465 $(foreach file
,$(S_FILES
),$(BUILD_DIR
)/$(file
:.s
=.o
)) \
466 $(foreach file
,$(GENERATED_C_FILES
),$(file
:.c
=.o
))
468 ULTRA_O_FILES
:= $(foreach file
,$(ULTRA_S_FILES
),$(BUILD_DIR
)/$(file
:.s
=.o
)) \
469 $(foreach file
,$(ULTRA_C_FILES
),$(BUILD_DIR
)/$(file
:.c
=.o
))
471 GODDARD_O_FILES
:= $(foreach file
,$(GODDARD_C_FILES
),$(BUILD_DIR
)/$(file
:.c
=.o
))
474 ifeq ($(DISCORDRPC
),1)
475 ifeq ($(WINDOWS_BUILD
),1)
476 RPC_LIBS
:= lib
/discord
/libdiscord-rpc.dll
477 else ifeq ($(OSX_BUILD
),1)
479 RPC_LIBS
:= lib
/discord
/libdiscord-rpc.dylib
481 RPC_LIBS
:= lib
/discord
/libdiscord-rpc.so
485 # Automatic dependency files
486 DEP_FILES
:= $(O_FILES
:.o
=.d
) $(ULTRA_O_FILES
:.o
=.d
) $(GODDARD_O_FILES
:.o
=.d
) $(BUILD_DIR
)/$(LD_SCRIPT
).d
489 SEG_FILES
:= $(SEGMENT_ELF_FILES
) $(ACTOR_ELF_FILES
) $(LEVEL_ELF_FILES
)
491 ##################### Compiler Options #######################
492 INCLUDE_CFLAGS
:= -I
include -I
$(BUILD_DIR
) -I
$(BUILD_DIR
)/include -I src
-I .
493 ENDIAN_BITWIDTH
:= $(BUILD_DIR
)/endian-and-bitwidth
495 # Huge deleted N64 section was here
499 ifeq ($(OSX_BUILD
),1)
500 AS
:= i686-w64-mingw32-as
503 ifneq ($(TARGET_WEB
),1) # As in, not-web PC port
513 ifeq ($(DISCORDRPC
),1)
515 else ifeq ($(WINDOWS_BUILD
),1)
516 ifeq ($(CROSS
),i686-w64-mingw32.static-
) # fixes compilation in MXE on Linux and WSL
518 else ifeq ($(CROSS
),x86_64-w64-mingw32.static-
)
525 ifeq ($(WINDOWS_BUILD
),1) # fixes compilation in MXE on Linux and WSL
528 OBJDUMP
:= $(CROSS
)objdump
529 else ifeq ($(OSX_BUILD
),1)
531 OBJDUMP
:= i686-w64-mingw32-objdump
532 OBJCOPY
:= i686-w64-mingw32-objcopy
533 else # Linux & other builds
534 CPP
:= $(CROSS
)cpp -P
535 OBJCOPY
:= $(CROSS
)objcopy
536 OBJDUMP
:= $(CROSS
)objdump
540 SDLCONFIG
:= $(CROSS
)sdl2-config
542 # configure backend flags
544 BACKEND_CFLAGS
:= -DRAPI_
$(RENDER_API
)=1 -DWAPI_
$(WINDOW_API
)=1 -DAAPI_
$(AUDIO_API
)=1
545 # can have multiple controller APIs
546 BACKEND_CFLAGS
+= $(foreach capi
,$(CONTROLLER_API
),-DCAPI_
$(capi
)=1)
550 # for now, it's either SDL+GL or DXGI+DirectX, so choose based on WAPI
551 ifeq ($(WINDOW_API
),DXGI
)
552 DXBITS
:= `cat $(ENDIAN_BITWIDTH) | tr ' ' '\n' | tail -1`
553 ifeq ($(RENDER_API
),D3D11
)
554 BACKEND_LDFLAGS
+= -ld3d11
555 else ifeq ($(RENDER_API
),D3D12
)
556 BACKEND_LDFLAGS
+= -ld3d12
557 BACKEND_CFLAGS
+= -Iinclude
/dxsdk
559 BACKEND_LDFLAGS
+= -ld3dcompiler
-ldxgi
-ldxguid
560 BACKEND_LDFLAGS
+= -lsetupapi
-ldinput8
-luser32
-lgdi32
-limm32
-lole32
-loleaut32
-lshell32
-lwinmm
-lversion
-luuid
-static
561 else ifeq ($(WINDOW_API
),SDL2
)
562 ifeq ($(WINDOWS_BUILD
),1)
563 BACKEND_LDFLAGS
+= -lglew32
-lglu32
-lopengl32
564 else ifeq ($(TARGET_RPI
),1)
565 BACKEND_LDFLAGS
+= -lGLESv2
566 else ifeq ($(OSX_BUILD
),1)
567 BACKEND_LDFLAGS
+= -framework OpenGL
`pkg-config --libs glew`
569 BACKEND_LDFLAGS
+= -lGL
574 ifeq ($(AUDIO_API
),SDL2
)
578 ifneq (,$(findstring SDL
,$(CONTROLLER_API
)))
582 # SDL can be used by different systems, so we consolidate all of that shit into this
584 BACKEND_CFLAGS
+= -DHAVE_SDL2
=1 `$(SDLCONFIG) --cflags`
585 ifeq ($(WINDOWS_BUILD
),1)
586 BACKEND_LDFLAGS
+= `$(SDLCONFIG) --static-libs` -lsetupapi
-luser32
-limm32
-lole32
-loleaut32
-lshell32
-lwinmm
-lversion
588 BACKEND_LDFLAGS
+= `$(SDLCONFIG) --libs`
592 ifeq ($(WINDOWS_BUILD
),1)
593 CC_CHECK
:= $(CC
) -fsyntax-only
-fsigned-char
$(BACKEND_CFLAGS
) $(INCLUDE_CFLAGS
) -Wall
-Wextra
-Wno-format-security
$(VERSION_CFLAGS
) $(GRUCODE_CFLAGS
)
594 CFLAGS
:= $(OPT_FLAGS
) $(INCLUDE_CFLAGS
) $(BACKEND_CFLAGS
) $(VERSION_CFLAGS
) $(GRUCODE_CFLAGS
) -fno-strict-aliasing
-fwrapv
596 else ifeq ($(TARGET_WEB
),1)
597 CC_CHECK
:= $(CC
) -fsyntax-only
-fsigned-char
$(BACKEND_CFLAGS
) $(INCLUDE_CFLAGS
) -Wall
-Wextra
-Wno-format-security
$(VERSION_CFLAGS
) $(GRUCODE_CFLAGS
) -s USE_SDL
=2
598 CFLAGS
:= $(OPT_FLAGS
) $(INCLUDE_CFLAGS
) $(BACKEND_CFLAGS
) $(VERSION_CFLAGS
) $(GRUCODE_CFLAGS
) -fno-strict-aliasing
-fwrapv
-s USE_SDL
=2
600 # Linux / Other builds below
602 CC_CHECK
:= $(CC
) -fsyntax-only
-fsigned-char
$(BACKEND_CFLAGS
) $(INCLUDE_CFLAGS
) -Wall
-Wextra
-Wno-format-security
$(VERSION_CFLAGS
) $(GRUCODE_CFLAGS
)
603 CFLAGS
:= $(OPT_FLAGS
) $(INCLUDE_CFLAGS
) $(BACKEND_CFLAGS
) $(VERSION_CFLAGS
) $(GRUCODE_CFLAGS
) -fno-strict-aliasing
-fwrapv
607 # Check for enhancement options
609 # Check for Puppycam option
610 ifeq ($(BETTERCAMERA
),1)
611 CC_CHECK
+= -DBETTERCAMERA
612 CFLAGS
+= -DBETTERCAMERA
613 EXT_OPTIONS_MENU
:= 1
616 ifeq ($(TEXTSAVES
),1)
617 CC_CHECK
+= -DTEXTSAVES
618 CFLAGS
+= -DTEXTSAVES
621 # Check for no drawing distance option
622 ifeq ($(NODRAWINGDISTANCE
),1)
623 CC_CHECK
+= -DNODRAWINGDISTANCE
624 CFLAGS
+= -DNODRAWINGDISTANCE
627 # Check for Discord Rich Presence option
628 ifeq ($(DISCORDRPC
),1)
629 CC_CHECK
+= -DDISCORDRPC
630 CFLAGS
+= -DDISCORDRPC
633 # Check for texture fix option
634 ifeq ($(TEXTURE_FIX
),1)
635 CC_CHECK
+= -DTEXTURE_FIX
636 CFLAGS
+= -DTEXTURE_FIX
639 # Check for extended options menu option
640 ifeq ($(EXT_OPTIONS_MENU
),1)
641 CC_CHECK
+= -DEXT_OPTIONS_MENU
642 CFLAGS
+= -DEXT_OPTIONS_MENU
645 # Check for no bzero/bcopy workaround option
646 ifeq ($(NO_BZERO_BCOPY
),1)
647 CC_CHECK
+= -DNO_BZERO_BCOPY
648 CFLAGS
+= -DNO_BZERO_BCOPY
651 # Use internal ldiv()/lldiv()
653 CC_CHECK
+= -DNO_LDIV
658 ifeq ($(LEGACY_GL
),1)
659 CC_CHECK
+= -DLEGACY_GL
660 CFLAGS
+= -DLEGACY_GL
663 # Load external textures
664 ifeq ($(EXTERNAL_DATA
),1)
665 CC_CHECK
+= -DEXTERNAL_DATA
-DFS_BASEDIR
="\"$(BASEDIR)\""
666 CFLAGS
+= -DEXTERNAL_DATA
-DFS_BASEDIR
="\"$(BASEDIR)\""
667 # tell skyconv to write names instead of actual texture data and save the split tiles so we can use them later
668 SKYTILE_DIR
:= $(BUILD_DIR
)/textures
/skybox_tiles
669 SKYCONV_ARGS
:= --store-names
--write-tiles
"$(SKYTILE_DIR)"
672 ASFLAGS
:= -I
include -I
$(BUILD_DIR
) $(VERSION_ASFLAGS
)
674 ifeq ($(TARGET_WEB
),1)
675 LDFLAGS
:= -lm
-lGL
-lSDL2
-no-pie
-s TOTAL_MEMORY
=20MB
-g4
--source-map-base http
://localhost
:8080/ -s
"EXTRA_EXPORTED_RUNTIME_METHODS=['callMain']"
677 else ifeq ($(WINDOWS_BUILD
),1)
678 LDFLAGS
:= $(BITS
) -march
=$(TARGET_ARCH
) -Llib
-lpthread
$(BACKEND_LDFLAGS
) -static
682 ifeq ($(WINDOWS_CONSOLE
),1)
686 else ifeq ($(TARGET_RPI
),1)
687 LDFLAGS
:= $(OPT_FLAGS
) -lm
$(BACKEND_LDFLAGS
) -no-pie
689 else ifeq ($(OSX_BUILD
),1)
690 LDFLAGS
:= -lm
$(BACKEND_LDFLAGS
) -no-pie
-lpthread
693 LDFLAGS
:= $(BITS
) -march
=$(TARGET_ARCH
) -lm
$(BACKEND_LDFLAGS
) -no-pie
-lpthread
694 ifeq ($(DISCORDRPC
),1)
695 LDFLAGS
+= -ldl
-Wl
,-rpath .
698 endif # End of LDFLAGS
700 # Prevent a crash with -sopt
703 ####################### Other Tools #########################
705 # N64 conversion tools
707 MIO0TOOL
= $(TOOLS_DIR
)/mio0
708 N64CKSUM
= $(TOOLS_DIR
)/n64cksum
709 N64GRAPHICS
= $(TOOLS_DIR
)/n64graphics
710 N64GRAPHICS_CI
= $(TOOLS_DIR
)/n64graphics_ci
711 TEXTCONV
= $(TOOLS_DIR
)/textconv
712 IPLFONTUTIL
= $(TOOLS_DIR
)/iplfontutil
713 AIFF_EXTRACT_CODEBOOK
= $(TOOLS_DIR
)/aiff_extract_codebook
714 VADPCM_ENC
= $(TOOLS_DIR
)/vadpcm_enc
715 EXTRACT_DATA_FOR_MIO
= $(TOOLS_DIR
)/extract_data_for_mio
716 SKYCONV
= $(TOOLS_DIR
)/skyconv
717 EMULATOR
= mupen64plus
722 ZEROTERM
= $(PYTHON
) $(TOOLS_DIR
)/zeroterm.py
724 ###################### Dependency Check #####################
728 ######################## Targets #############################
732 # thank you apple very cool
733 ifeq ($(HOST_OS
),Darwin
)
739 ifeq ($(EXTERNAL_DATA
),1)
741 BASEPACK_PATH
:= $(BUILD_DIR
)/$(BASEDIR
)/$(BASEPACK
)
742 BASEPACK_LST
:= $(BUILD_DIR
)/basepack.lst
744 # depend on resources as well
745 all: $(BASEPACK_PATH
)
747 # phony target for building resources
748 res
: $(BASEPACK_PATH
)
750 # prepares the basepack.lst
751 $(BASEPACK_LST
): $(EXE
)
752 @mkdir
-p
$(BUILD_DIR
)/$(BASEDIR
)
753 @echo
-n
> $(BASEPACK_LST
)
754 @echo
"$(BUILD_DIR)/sound/bank_sets sound/bank_sets" >> $(BASEPACK_LST
)
755 @echo
"$(BUILD_DIR)/sound/sequences.bin sound/sequences.bin" >> $(BASEPACK_LST
)
756 @echo
"$(BUILD_DIR)/sound/sound_data.ctl sound/sound_data.ctl" >> $(BASEPACK_LST
)
757 @echo
"$(BUILD_DIR)/sound/sound_data.tbl sound/sound_data.tbl" >> $(BASEPACK_LST
)
758 @
$(foreach f
, $(wildcard $(SKYTILE_DIR
)/*), echo
$(f
) gfx
/$(f
:$(BUILD_DIR
)/%=%) >> $(BASEPACK_LST
);)
759 @find actors
-name \
*.png
-exec echo
"{} gfx/{}" >> $(BASEPACK_LST
) \
;
760 @find levels
-name \
*.png
-exec echo
"{} gfx/{}" >> $(BASEPACK_LST
) \
;
761 @find textures
-name \
*.png
-exec echo
"{} gfx/{}" >> $(BASEPACK_LST
) \
;
763 # prepares the resource ZIP with base data
764 $(BASEPACK_PATH
): $(BASEPACK_LST
)
765 @
$(PYTHON
) $(TOOLS_DIR
)/mkzip.py
$(BASEPACK_LST
) $(BASEPACK_PATH
)
770 $(RM
) -r
$(BUILD_DIR_BASE
)
773 $(MAKE
) -s
-C tools
clean
776 $(RM
) -r
$(BUILD_DIR_BASE
)
777 .
/extract_assets.py
--clean
780 $(EMULATOR
) $(EMU_FLAGS
) $<
783 $(LOADER
) $(LOADER_FLAGS
) $<
785 $(BUILD_DIR
)/$(RPC_LIBS
):
786 @
$(CP
) -f
$(RPC_LIBS
) $(BUILD_DIR
)
788 libultra
: $(BUILD_DIR
)/libultra.a
790 asm
/boot.s
: $(BUILD_DIR
)/lib
/bin
/ipl3_font.bin
792 $(BUILD_DIR
)/lib
/bin
/ipl3_font.bin
: lib
/ipl3_font.png
793 $(IPLFONTUTIL
) e
$< $@
795 #Required so the compiler doesn't complain about this not existing.
796 $(BUILD_DIR
)/src
/game
/camera.o
: $(BUILD_DIR
)/include/text_strings.h
798 $(BUILD_DIR
)/include/text_strings.h
: include/text_strings.h.in
799 $(TEXTCONV
) charmap.txt
$< $@
801 $(BUILD_DIR
)/include/text_menu_strings.h
: include/text_menu_strings.h.in
802 $(TEXTCONV
) charmap_menu.txt
$< $@
804 $(BUILD_DIR
)/include/text_options_strings.h
: include/text_options_strings.h.in
805 $(TEXTCONV
) charmap.txt
$< $@
808 TEXT_DIRS
:= text
/de text
/us text
/fr
810 # EU encoded text inserted into individual segment 0x19 files,
811 # and course data also duplicated in leveldata.c
812 $(BUILD_DIR
)/bin
/eu
/translation_en.o
: $(BUILD_DIR
)/text
/us
/define_text.inc.c
813 $(BUILD_DIR
)/bin
/eu
/translation_de.o
: $(BUILD_DIR
)/text
/de
/define_text.inc.c
814 $(BUILD_DIR
)/bin
/eu
/translation_fr.o
: $(BUILD_DIR
)/text
/fr
/define_text.inc.c
815 $(BUILD_DIR
)/levels
/menu
/leveldata.o
: $(BUILD_DIR
)/text
/us
/define_courses.inc.c
816 $(BUILD_DIR
)/levels
/menu
/leveldata.o
: $(BUILD_DIR
)/text
/de
/define_courses.inc.c
817 $(BUILD_DIR
)/levels
/menu
/leveldata.o
: $(BUILD_DIR
)/text
/fr
/define_courses.inc.c
822 $(BUILD_DIR
)/bin
/segment2.o
: $(BUILD_DIR
)/text
/jp
/define_text.inc.c
825 TEXT_DIRS
:= text
/$(VERSION
)
827 # non-EU encoded text inserted into segment 0x02
828 $(BUILD_DIR
)/bin
/segment2.o
: $(BUILD_DIR
)/text
/$(VERSION
)/define_text.inc.c
832 $(BUILD_DIR
)/text
/%/define_courses.inc.c
: text
/define_courses.inc.c text
/%/courses.h
833 $(CPP
) $(VERSION_CFLAGS
) $< -o
$@
-I text
/$*/
834 $(TEXTCONV
) charmap.txt
$@
$@
836 $(BUILD_DIR
)/text
/%/define_text.inc.c
: text
/define_text.inc.c text
/%/courses.h text
/%/dialogs.h
837 $(CPP
) $(VERSION_CFLAGS
) $< -o
$@
-I text
/$*/
838 $(TEXTCONV
) charmap.txt
$@
$@
840 ALL_DIRS
:= $(BUILD_DIR
) $(addprefix $(BUILD_DIR
)/,$(SRC_DIRS
) $(ASM_DIRS
) $(GODDARD_SRC_DIRS
) $(ULTRA_SRC_DIRS
) $(ULTRA_ASM_DIRS
) $(ULTRA_BIN_DIRS
) $(BIN_DIRS
) $(TEXTURE_DIRS
) $(TEXT_DIRS
) $(SOUND_SAMPLE_DIRS
) $(addprefix levels
/,$(LEVEL_DIRS
)) include) $(MIO0_DIR
) $(addprefix $(MIO0_DIR
)/,$(VERSION
)) $(SOUND_BIN_DIR
) $(SOUND_BIN_DIR
)/sequences
/$(VERSION
)
842 # Make sure build directory exists before compiling anything
843 DUMMY
!= mkdir
-p
$(ALL_DIRS
)
845 $(BUILD_DIR
)/include/text_strings.h
: $(BUILD_DIR
)/include/text_menu_strings.h
846 $(BUILD_DIR
)/include/text_strings.h
: $(BUILD_DIR
)/include/text_options_strings.h
849 $(BUILD_DIR
)/src
/menu
/file_select.o
: $(BUILD_DIR
)/include/text_strings.h
$(BUILD_DIR
)/bin
/eu
/translation_en.o
$(BUILD_DIR
)/bin
/eu
/translation_de.o
$(BUILD_DIR
)/bin
/eu
/translation_fr.o
850 $(BUILD_DIR
)/src
/menu
/star_select.o
: $(BUILD_DIR
)/include/text_strings.h
$(BUILD_DIR
)/bin
/eu
/translation_en.o
$(BUILD_DIR
)/bin
/eu
/translation_de.o
$(BUILD_DIR
)/bin
/eu
/translation_fr.o
851 $(BUILD_DIR
)/src
/game
/ingame_menu.o
: $(BUILD_DIR
)/include/text_strings.h
$(BUILD_DIR
)/bin
/eu
/translation_en.o
$(BUILD_DIR
)/bin
/eu
/translation_de.o
$(BUILD_DIR
)/bin
/eu
/translation_fr.o
852 $(BUILD_DIR
)/src
/game
/options_menu.o
: $(BUILD_DIR
)/include/text_strings.h
$(BUILD_DIR
)/bin
/eu
/translation_en.o
$(BUILD_DIR
)/bin
/eu
/translation_de.o
$(BUILD_DIR
)/bin
/eu
/translation_fr.o
853 O_FILES
+= $(BUILD_DIR
)/bin
/eu
/translation_en.o
$(BUILD_DIR
)/bin
/eu
/translation_de.o
$(BUILD_DIR
)/bin
/eu
/translation_fr.o
854 ifeq ($(DISCORDRPC
),1)
855 $(BUILD_DIR
)/src
/pc/discord
/discordrpc.o
: $(BUILD_DIR
)/include/text_strings.h
$(BUILD_DIR
)/bin
/eu
/translation_en.o
$(BUILD_DIR
)/bin
/eu
/translation_de.o
$(BUILD_DIR
)/bin
/eu
/translation_fr.o
858 $(BUILD_DIR
)/src
/menu
/file_select.o
: $(BUILD_DIR
)/include/text_strings.h
859 $(BUILD_DIR
)/src
/menu
/star_select.o
: $(BUILD_DIR
)/include/text_strings.h
860 $(BUILD_DIR
)/src
/game
/ingame_menu.o
: $(BUILD_DIR
)/include/text_strings.h
861 $(BUILD_DIR
)/src
/game
/options_menu.o
: $(BUILD_DIR
)/include/text_strings.h
862 ifeq ($(DISCORDRPC
),1)
863 $(BUILD_DIR
)/src
/pc/discord
/discordrpc.o
: $(BUILD_DIR
)/include/text_strings.h
867 ################################################################
868 # TEXTURE GENERATION #
869 ################################################################
871 # RGBA32, RGBA16, IA16, IA8, IA4, IA1, I8, I4
872 ifeq ($(EXTERNAL_DATA
),1)
873 $(BUILD_DIR
)/%: %.png
874 $(ZEROTERM
) "$(patsubst %.png,%,$^)" > $@
876 $(BUILD_DIR
)/%: %.png
877 $(N64GRAPHICS
) -i
$@
-g
$< -f
$(lastword
$(subst .
, ,$@
))
880 $(BUILD_DIR
)/%.inc.c
: $(BUILD_DIR
)/% %.png
881 hexdump
-v
-e
'1/1 "0x%X,"' $< > $@
884 ifeq ($(EXTERNAL_DATA
),0)
886 $(BUILD_DIR
)/%.ci8
: %.ci8.png
887 $(N64GRAPHICS_CI
) -i
$@
-g
$< -f ci8
890 $(BUILD_DIR
)/%.ci4
: %.ci4.png
891 $(N64GRAPHICS_CI
) -i
$@
-g
$< -f ci4
894 ################################################################
896 # compressed segment generation
899 $(BUILD_DIR
)/%.table
: %.aiff
900 $(AIFF_EXTRACT_CODEBOOK
) $< >$@
902 $(BUILD_DIR
)/%.aifc
: $(BUILD_DIR
)/%.table
%.aiff
903 $(VADPCM_ENC
) -c
$^
$@
905 $(ENDIAN_BITWIDTH
): tools
/determine-endian-bitwidth.c
906 $(CC
) -c
$(CFLAGS
) -o
$@.dummy2
$< 2>$@.dummy1
; true
907 grep
-o
'msgbegin --endian .* --bitwidth .* msgend' $@.dummy1
> $@.dummy2
908 head
-n1
<$@.dummy2 | cut
-d
' ' -f2-5
> $@
912 $(SOUND_BIN_DIR
)/sound_data.ctl
: sound
/sound_banks
/ $(SOUND_BANK_FILES
) $(SOUND_SAMPLE_AIFCS
) $(ENDIAN_BITWIDTH
)
913 $(PYTHON
) tools
/assemble_sound.py
$(BUILD_DIR
)/sound
/samples
/ sound
/sound_banks
/ $(SOUND_BIN_DIR
)/sound_data.ctl
$(SOUND_BIN_DIR
)/sound_data.tbl
$(VERSION_CFLAGS
) $$(cat
$(ENDIAN_BITWIDTH
))
915 $(SOUND_BIN_DIR
)/sound_data.tbl
: $(SOUND_BIN_DIR
)/sound_data.ctl
919 $(SOUND_BIN_DIR
)/sequences.bin
: $(SOUND_BANK_FILES
) sound
/sequences.json sound
/sequences
/ sound
/sequences
/jp
/ $(SOUND_SEQUENCE_FILES
) $(ENDIAN_BITWIDTH
)
920 $(PYTHON
) tools
/assemble_sound.py
--sequences
$@
$(SOUND_BIN_DIR
)/bank_sets sound
/sound_banks
/ sound
/sequences.json
$(SOUND_SEQUENCE_FILES
) $(VERSION_CFLAGS
) $$(cat
$(ENDIAN_BITWIDTH
))
922 $(SOUND_BIN_DIR
)/sequences.bin
: $(SOUND_BANK_FILES
) sound
/sequences.json sound
/sequences
/ sound
/sequences
/$(VERSION
)/ $(SOUND_SEQUENCE_FILES
) $(ENDIAN_BITWIDTH
)
923 $(PYTHON
) tools
/assemble_sound.py
--sequences
$@
$(SOUND_BIN_DIR
)/bank_sets sound
/sound_banks
/ sound
/sequences.json
$(SOUND_SEQUENCE_FILES
) $(VERSION_CFLAGS
) $$(cat
$(ENDIAN_BITWIDTH
))
926 $(SOUND_BIN_DIR
)/bank_sets
: $(SOUND_BIN_DIR
)/sequences.bin
929 $(SOUND_BIN_DIR
)/%.m64
: $(SOUND_BIN_DIR
)/%.o
930 $(OBJCOPY
) -j .rodata
$< -O binary
$@
932 $(SOUND_BIN_DIR
)/%.o
: $(SOUND_BIN_DIR
)/%.s
933 $(AS
) $(ASFLAGS
) -o
$@
$<
935 ifeq ($(EXTERNAL_DATA
),1)
937 $(SOUND_BIN_DIR
)/sound_data.ctl.c
: $(SOUND_BIN_DIR
)/sound_data.ctl
938 echo
"unsigned char gSoundDataADSR[] = \"sound/sound_data.ctl\";" > $@
939 $(SOUND_BIN_DIR
)/sound_data.tbl.c
: $(SOUND_BIN_DIR
)/sound_data.tbl
940 echo
"unsigned char gSoundDataRaw[] = \"sound/sound_data.tbl\";" > $@
941 $(SOUND_BIN_DIR
)/sequences.bin.c
: $(SOUND_BIN_DIR
)/sequences.bin
942 echo
"unsigned char gMusicData[] = \"sound/sequences.bin\";" > $@
943 $(SOUND_BIN_DIR
)/bank_sets.c
: $(SOUND_BIN_DIR
)/bank_sets
944 echo
"unsigned char gBankSetsData[] = \"sound/bank_sets\";" > $@
948 $(SOUND_BIN_DIR
)/sound_data.ctl.c
: $(SOUND_BIN_DIR
)/sound_data.ctl
949 echo
"unsigned char gSoundDataADSR[] = {" > $@
950 hexdump
-v
-e
'1/1 "0x%X,"' $< >> $@
953 $(SOUND_BIN_DIR
)/sound_data.tbl.c
: $(SOUND_BIN_DIR
)/sound_data.tbl
954 echo
"unsigned char gSoundDataRaw[] = {" > $@
955 hexdump
-v
-e
'1/1 "0x%X,"' $< >> $@
958 $(SOUND_BIN_DIR
)/sequences.bin.c
: $(SOUND_BIN_DIR
)/sequences.bin
959 echo
"unsigned char gMusicData[] = {" > $@
960 hexdump
-v
-e
'1/1 "0x%X,"' $< >> $@
963 $(SOUND_BIN_DIR
)/bank_sets.c
: $(SOUND_BIN_DIR
)/bank_sets
964 echo
"unsigned char gBankSetsData[0x100] = {" > $@
965 hexdump
-v
-e
'1/1 "0x%X,"' $< >> $@
970 $(BUILD_DIR
)/levels
/scripts.o
: $(BUILD_DIR
)/include/level_headers.h
972 $(BUILD_DIR
)/include/level_headers.h
: levels
/level_headers.h.in
973 $(CPP
) -I . levels
/level_headers.h.in |
$(PYTHON
) tools
/output_level_headers.py
> $(BUILD_DIR
)/include/level_headers.h
975 $(BUILD_DIR
)/assets
/mario_anim_data.c
: $(wildcard assets
/anims
/*.inc.c
)
976 $(PYTHON
) tools
/mario_anims_converter.py
> $@
978 $(BUILD_DIR
)/assets
/demo_data.c
: assets
/demo_data.json
$(wildcard assets
/demos
/*.bin
)
979 $(PYTHON
) tools
/demo_data_converter.py assets
/demo_data.json
$(VERSION_CFLAGS
) > $@
982 $(BUILD_DIR
)/levels
/%/leveldata.o
: OPT_FLAGS
:= -g
983 $(BUILD_DIR
)/actors
/%.o
: OPT_FLAGS
:= -g
984 $(BUILD_DIR
)/bin
/%.o
: OPT_FLAGS
:= -g
985 $(BUILD_DIR
)/src
/goddard
/%.o
: OPT_FLAGS
:= -g
986 $(BUILD_DIR
)/src
/goddard
/%.o
: MIPSISET
:= -mips1
987 $(BUILD_DIR
)/src
/audio
/%.o
: OPT_FLAGS
:= -O2
-Wo
,-loopunroll
,0
988 $(BUILD_DIR
)/src
/audio
/load.o
: OPT_FLAGS
:= -O2
-framepointer
-Wo
,-loopunroll
,0
989 $(BUILD_DIR
)/lib
/src
/%.o
: OPT_FLAGS
:=
990 $(BUILD_DIR
)/lib
/src
/math
/ll
%.o
: MIPSISET
:= -mips3
-32
991 $(BUILD_DIR
)/lib
/src
/math
/%.o
: OPT_FLAGS
:= -O2
992 $(BUILD_DIR
)/lib
/src
/math
/ll
%.o
: OPT_FLAGS
:=
993 $(BUILD_DIR
)/lib
/src
/ldiv.o
: OPT_FLAGS
:= -O2
994 $(BUILD_DIR
)/lib
/src
/string.o
: OPT_FLAGS
:= -O2
995 $(BUILD_DIR
)/lib
/src
/gu
%.o
: OPT_FLAGS
:= -O3
996 $(BUILD_DIR
)/lib
/src
/al
%.o
: OPT_FLAGS
:= -O3
999 $(BUILD_DIR
)/lib
/src
/_Litob.o
: OPT_FLAGS
:= -O3
1000 $(BUILD_DIR
)/lib
/src
/_Ldtob.o
: OPT_FLAGS
:= -O3
1001 $(BUILD_DIR
)/lib
/src
/_Printf.o
: OPT_FLAGS
:= -O3
1002 $(BUILD_DIR
)/lib
/src
/sprintf.o
: OPT_FLAGS
:= -O3
1004 # enable loop unrolling except for external.c (external.c might also have used
1005 # unrolling, but it makes one loop harder to match)
1006 $(BUILD_DIR
)/src
/audio
/%.o
: OPT_FLAGS
:= -O2
1007 $(BUILD_DIR
)/src
/audio
/load.o
: OPT_FLAGS
:= -O2
1008 $(BUILD_DIR
)/src
/audio
/external.o
: OPT_FLAGS
:= -O2
-Wo
,-loopunroll
,0
1011 # The source-to-source optimizer copt is enabled for audio. This makes it use
1012 # acpp, which needs -Wp,-+ to handle C++-style comments.
1013 $(BUILD_DIR
)/src
/audio
/effects.o
: OPT_FLAGS
:= -O2
-Wo
,-loopunroll
,0 -sopt
,-inline
=sequence_channel_process_sound
,-scalaroptimize
=1 -Wp
,-+
1014 $(BUILD_DIR
)/src
/audio
/synthesis.o
: OPT_FLAGS
:= -O2
-sopt
,-scalaroptimize
=1 -Wp
,-+
1016 # Add a target for build/eu/src/audio/*.copt to make it easier to see debug
1017 $(BUILD_DIR
)/src
/audio
/%.acpp
: src
/audio
/%.c
1018 $(QEMU_IRIX
) -silent
-L
$(IRIX_ROOT
) $(IRIX_ROOT
)/usr
/lib
/acpp
$(TARGET_CFLAGS
) $(INCLUDE_CFLAGS
) $(VERSION_CFLAGS
) $(GRUCODE_CFLAGS
) -D__sgi
-+ $< > $@
1019 $(BUILD_DIR
)/src
/audio
/%.copt
: $(BUILD_DIR
)/src
/audio
/%.acpp
1020 $(QEMU_IRIX
) -silent
-L
$(IRIX_ROOT
) $(IRIX_ROOT
)/usr
/lib
/copt
-signed
-I
=$< -CMP
=$@
-cp
=i
-scalaroptimize
=1
1023 # Rebuild files with 'GLOBAL_ASM' if the NON_MATCHING flag changes.
1024 $(GLOBAL_ASM_O_FILES
): $(GLOBAL_ASM_DEP
).
$(NON_MATCHING
)
1025 $(GLOBAL_ASM_DEP
).
$(NON_MATCHING
):
1026 @
rm -f
$(GLOBAL_ASM_DEP
).
*
1029 $(BUILD_DIR
)/%.o
: %.
cpp
1030 @
$(CXX
) -fsyntax-only
$(CFLAGS
) -MMD
-MP
-MT
$@
-MF
$(BUILD_DIR
)/$*.d
$<
1031 $(CXX
) -c
$(CFLAGS
) -o
$@
$<
1033 $(BUILD_DIR
)/%.o
: %.c
1034 @
$(CC_CHECK
) -MMD
-MP
-MT
$@
-MF
$(BUILD_DIR
)/$*.d
$<
1035 $(CC
) -c
$(CFLAGS
) -o
$@
$<
1038 $(BUILD_DIR
)/%.o
: $(BUILD_DIR
)/%.c
1039 @
$(CC_CHECK
) -MMD
-MP
-MT
$@
-MF
$(BUILD_DIR
)/$*.d
$<
1040 $(CC
) -c
$(CFLAGS
) -o
$@
$<
1042 $(BUILD_DIR
)/%.o
: %.s
1043 $(AS
) $(ASFLAGS
) -MD
$(BUILD_DIR
)/$*.d
-o
$@
$<
1047 $(EXE
): $(O_FILES
) $(MIO0_FILES
:.mio0
=.o
) $(SOUND_OBJ_FILES
) $(ULTRA_O_FILES
) $(GODDARD_O_FILES
) $(BUILD_DIR
)/$(RPC_LIBS
)
1048 $(LD
) -L
$(BUILD_DIR
) -o
$@
$(O_FILES
) $(SOUND_OBJ_FILES
) $(ULTRA_O_FILES
) $(GODDARD_O_FILES
) $(LDFLAGS
)
1050 .PHONY
: all clean distclean default diff
test load libultra res
1051 .PRECIOUS
: $(BUILD_DIR
)/bin
/%.elf
$(SOUND_BIN_DIR
)/%.ctl
$(SOUND_BIN_DIR
)/%.tbl
$(SOUND_SAMPLE_TABLES
) $(SOUND_BIN_DIR
)/%.s
$(BUILD_DIR
)/%
1054 # Remove built-in rules, to improve performance
1055 MAKEFLAGS
+= --no-builtin-rules
1057 -include $(DEP_FILES
)
1059 print-
% : ; $(info $* is a
$(flavor
$*) variable set to
[$($*)]) @true