This repository was archived by the owner on Nov 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (52 loc) · 2.1 KB
/
Copy pathMakefile
File metadata and controls
62 lines (52 loc) · 2.1 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
# First ensure that the user has correctly created a sc_env.mk file by running the init-repo script
ifeq (,$(wildcard ./build/sc_env.mk))
$(error Could not find environment configuration file, ensure one exists in build/sc_env.mk)
else
endif
# The user has an environment config, so souce it for it's variables
include build/sc_env.mk
# Check that the user has the compiler
ifeq (, $(wildcard $(DEVKITPPC)/bin/powerpc-eabi-gcc))
$(error Could not find compiler at the right path. Check build/sc_env.mk)
else
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc
LD = $(CC)
endif
#
# Start defining targets to build, the first being scuffedcraft.dol
#
# Define the default target which is to build the Scuffedcraft release, which depends on the Scuffedcraft.elf
ScuffedCraft.dol: ScuffedCraft.elf
@echo -e "\e[1m\e[32mCompiling release configuration\e[39m\e[0m" # Green and bold
@$(DEVKITPRO)/tools/bin/elf2dol $< $@
@echo "Done!"
# Include the file that defines all of the source files used, or at least all the ones I want to add
# I don't want to use globbing, so that I can have explicit control
BUILD_DIR=build
include source/make.mk
# The scuffedcraft.elf target is dependent on all the object files.
# it is the binary after all the code has been compiled and linked into one file
# The list of source files are described in source/make.mk
ScuffedCraft.elf: inform $(OBJ_FILES) $(CFILES)
@echo "Linking ..."
@$(CC) $(OBJ_FILES) $(CFLAGS) $(LINK_DIRS) $(LINK_FLAGS) -o ScuffedCraft.elf
# A target that runs the build on dolphin
run: ScuffedCraft.elf
@echo "Launching ..."
@$(DOLPHIN_CMD) -b -d ScuffedCraft.elf
# A target to remove all the builds made
.PHONY: clean
clean:
@echo "Cleaning intermediates"
@rm -f $(BUILD_DIR)/*.d
@rm -f $(BUILD_DIR)/*.o
@echo "Cleaning Binaries"
@rm -f ScuffedCraft.elf
@rm -f ScuffedCraft.dol
@echo "Done"
# A phony target that informs the user of the variables and environments used
.PHONY: inform
inform:
@echo -e "\e[1m\e[32mBuilding ScuffedCraft ...\e[39m\e[0m" # Green and bold
@echo "Using DevkitPro path : $(DEVKITPRO)"
@echo -e "Compiler path : $(DEVKITPPC)/bin/powerpc-eabi-gcc\n"