-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.dreamcast.mk
93 lines (77 loc) · 2.12 KB
/
Makefile.dreamcast.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
all: $(patsubst %.cpp,%.elf,$(wildcard example/*.cpp))
OPT = -O2
CSTD = -std=gnu11
MAKEFILE_PATH := $(patsubst %/,%,$(dir $(abspath $(firstword $(MAKEFILE_LIST)))))
LIB ?= $(MAKEFILE_PATH)/dreamcast
CFLAGS += -D__dreamcast__
CFLAGS += -DDEBUG
#CFLAGS += -DDEBUG_PRINT
CFLAGS += -I$(MAKEFILE_PATH)/c
CFLAGS += -I$(MAKEFILE_PATH)/dreamcast
CFLAGS += -I$(MAKEFILE_PATH)/
CFLAGS += -Wno-error=strict-aliasing -fno-strict-aliasing
CARCH = -m4-single -ml
include dreamcast/base.mk
include dreamcast/common.mk
include dreamcast/headers.mk
include dreamcast/ip.mk
include java.mk
%.class.o: %.class
$(BUILD_BINARY_O)
%.class.h: %.class
$(BUILD_BINARY_H)
libgcc/%.o: $(LIBGCC)
@mkdir -p $(dir $@)
ar x --output $(dir $@) $(LIBGCC) $(notdir $@)
sh4-none-elf-objdump -t $@ \
| grep -E '[.]hidden' \
| grep -vE 'UND' \
| cut -d' ' -f10 \
| xargs rebind --visibility=default $@
LIBGCC_OBJ = \
libgcc/_divdi3.o \
libgcc/_udiv_qrnnd_16.o \
libgcc/_clz.o \
libgcc/_moddi3.o \
libgcc/_fixdfdi.o \
libgcc/_fixunsdfdi.o \
libgcc/_fixunssfdi.o \
libgcc/_floatdisf.o \
libgcc/_floatdidf.o \
libgcc/_sdivsi3.o \
libgcc/_fixsfdi.o \
libgcc/_div_table.o \
libgcc/_movmem_i4.o \
libgcc/_set_fpscr.o
include classpath.mk
GDROM_JVM_BOOT_OBJ = \
$(LIB)/example/gdrom_jvm_boot.o \
$(LIB)/sh7091/serial.o
boot.elf: LDSCRIPT = $(LIB)/ip.lds
boot.elf: $(IP_OBJ) $(START_OBJ) $(GDROM_JVM_BOOT_OBJ)
zero.bin:
dd if=/dev/zero of=$@ bs=2048 count=1
jvm.iso: boot.bin main.bin zero.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 boot.bin \
-o $@ \
-graft-points \
/0JVM.BIN=./main.bin \
/1ST_READ.BIN=zero.bin \
/=$(LIB)/COPYRIGH.TXT \
/=$(LIB)/ABSTRACT.TXT \
/=$(LIB)/BIBLIOGR.TXT \
images/java_text.data \
images/java_cup.data \
$(shell cat classes.txt)
main.elf: LDSCRIPT = $(LIB)/main.lds
main.elf: $(START_OBJ) $(OBJ) $(MAIN_OBJ) $(MAIN_DREAMCAST_OBJ) $(LIBGCC_OBJ) $(CLASS_PATH)