-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.mk
112 lines (95 loc) · 1.92 KB
/
common.mk
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
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
DIR := $(dir $(MAKEFILE_PATH))
LIB ?= .
OPT ?= -O2
GENERATED ?=
AARCH = --isa=sh4 --little
CARCH = -m4-single-only -ml
CFLAGS += -mfsca -funsafe-math-optimizations -ffast-math
CFLAGS += -I"$(dir $(MAKEFILE_PATH))"
CXXFLAGS += -std=c++23
OBJARCH = -O elf32-shl -B sh4
TARGET = sh4-none-elf-
START_OBJ = \
start.o \
runtime.o \
sh7091/cache.o
IP_OBJ = \
systemid.o \
toc.o \
sg/sg_sec.o \
sg_arejp.o \
sg_areus.o \
sg_areec.o \
sg_are00.o \
sg_are01.o \
sg_are02.o \
sg_are03.o \
sg_are04.o \
$(START_OBJ) \
example/serial_transfer.o \
sh7091/serial.o \
serial_load.o \
maple/maple.o \
font/portfolio_6x8/portfolio_6x8.data.o \
crc32.o
#sg_ini.o \
#aip.o
%.o: %.obj
$(OBJCOPY) -g \
--rename-section IP=.text.$* \
$< $@
ip.elf: $(IP_OBJ)
$(LD) --orphan-handling=error --print-memory-usage -T $(LIB)/ip.lds $^ -o $@
include base.mk
sine.pcm: common.mk
sox \
--rate 44100 \
--encoding signed-integer \
--bits 16 \
--channels 1 \
--endian big \
--null \
synth 100s sin 700 vol -10dB
mv [email protected] $@
%.iso: %.bin ip.bin
mkisofs \
-C 0,11702 \
-sysid "SEGA SEGAKATANA" \
-volid "SAMPLE_GAME_TITLE" \
-volset "SAMPLE_GAME_TITLE" \
-publisher "SEGA ENTERPRISES, LTD." \
-preparer "CRI CD CRAFT VER.2.27" \
-copyright "COPYRIGH.TXT" \
-abstract "ABSTRACT.TXT" \
-biblio "BIBLIOGR.TXT" \
-G ip.bin \
-o $@ \
-graft-points \
/1ST_READ.BIN=./$< \
/=./COPYRIGH.TXT \
/=./ABSTRACT.TXT \
/=./BIBLIOGR.TXT \
/=./pcm/REIGN.PCM \
/=./pcm/PILLAR.PCM \
/=./pcm/RIDDLE.PCM \
/=./pcm/PRELUDE.PCM \
/=./pcm/CLOCKTOW.PCM \
/=./pcm/ELEC.PCM \
/=./pcm/ECCLESIA.PCM
include headers.mk
clean:
find -P \
-regextype posix-egrep \
-regex '.*\.(iso|o|d|bin|elf|cue|gch|scramble)$$' \
-exec rm {} \;
.SUFFIXES:
.INTERMEDIATE:
.SECONDARY:
.PHONY: all clean
%: RCS/%,v
%: RCS/%
%: %,v
%: s.%
%: SCCS/s.%