-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (41 loc) · 1.16 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
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
.PHONY: all fe5_all fe8_all clean veryclean
.SUFFIXES:
all: fe5_all fe8_all | $(DESTDIR)
SHELL = /bin/sh
# Folders
export ROOT := $(realpath .)
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
ifneq (,$(findstring $(SPACE),$(ROOT)))
$(error "Please avoid spaces in file paths.")
endif
export DESTDIR = $(ROOT)/BIN
export CACHEDIR = $(ROOT)/.CACHE
export TOOLSDIR = $(ROOT)/TOOLS
export FE5DIR = $(ROOT)/FE5
export FE8DIR = $(ROOT)/FE8
# These are clean ROMs used to build the outputs
export FE5_BASEROM = $(ROOT)/FE5.sfc
export FE8_BASEROM = $(ROOT)/FE8U.gba
# General dependencies
ifeq ($(shell python -c "import sys; print(int(sys.version_info[0] > 2))"),1)
export PYTHON = python
else
export PYTHON = python3
endif
# Game-specific dependencies are handled in their individual makefiles.
export FE5_YEARS = 2019 2022
export FE8_YEARS = 2023 2024
.PHONY: $(FE5_YEARS) $(FE8_YEARS)
export NOTIFY_PROCESS = @echo "$(notdir $<) => $(notdir $@)"
include $(FE5DIR)/Makefile
include $(FE8DIR)/Makefile
$(DESTDIR):
@mkdir -p "$(DESTDIR)"
$(CACHEDIR):
@mkdir -p "$(CACHEDIR)"
clean::
@$(RM) "$(DESTDIR)"/*.*
veryclean:: clean
@$(RM) -rf "$(DESTDIR)"
@$(RM) -rf "$(CACHEDIR)"