-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile.cfg
115 lines (94 loc) · 3.74 KB
/
Makefile.cfg
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
113
114
115
# dcload-serial Makefile Configuration
# Detect the host
ROOTDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
include $(ROOTDIR)/Makefile.hostdetect
# Host compiler and flags
HOSTCC = gcc
HOSTCFLAGS = -O2 -I/usr/local/include
HOSTLDFLAGS = -L/usr/local/lib
ifdef MACOS
ifeq ($(shell uname -m),arm64)
HOSTCFLAGS = -O2 -I/opt/homebrew/include
HOSTLDFLAGS = -L/opt/homebrew/lib
endif
endif
# For MinGW/MSYS, MinGW-w64/MSYS2 and Cygwin
ifdef WINDOWS
HOSTCFLAGS += -D_WIN32
EXECUTABLEEXTENSION = .exe
endif
# dc compiler prefix -- this is usually what you used for --prefix when
# building your compiler.
TARGETPREFIX = /opt/toolchains/dc/sh-elf
# dir to install dc-tool in
TOOLINSTALLDIR = /opt/toolchains/dc/bin
# To build dc-tool, we need to use libelf or libbfd
# By default, libelf is used, except for MinGW/MSYS which uses libbfd.
# libbfd is installed using dc-chain, an utility provided with KallistiOS.
# Define this if you want to use libbfd instead of libelf (which is default)
WITH_BFD = 0
# For MinGW/MSYS, we need to use libbfd instead of libelf
ifdef MINGW
WITH_BFD = 1
endif
# You may have to change the paths for BFDLIB and BFDINCLUDE to the correct
# ones for your system. These must point to your sh-elf BFD, not the system one!
# If you built your Sega Dreamcast toolchains with dc-chain, you'll have it
# installed in the correct location.
BFDLIB = $(TARGETPREFIX)/lib
BFDINCLUDE = $(TARGETPREFIX)/include
# When using libelf instead of BFD, these must point to your
# libelf installation (leave empty or undefined if libelf is part of the system)
ELFLIB = $(TARGETPREFIX)/lib
ELFINCLUDE = $(TARGETPREFIX)/include
# For macOS, libelf is here when installed through Homebrew
ifdef MACOS
ifeq ($(shell uname -m),arm64)
ELFINCLUDE = /opt/homebrew/include/libelf
else
ELFINCLUDE = /usr/local/include/libelf
endif
endif
# sh-elf-stuff
# You don't need to change these
TARGETCC = $(TARGETPREFIX)/bin/sh-elf-gcc
TARGETCFLAGS = -O2 -ml -m4-single-only
TARGETOBJCOPY = $(TARGETPREFIX)/bin/sh-elf-objcopy -R .stack
TARGETLD = $(TARGETPREFIX)/bin/sh-elf-ld
# set TARGETCCVER to 3 or 4, depending on your SH compiler version (gcc 3.x or gcc 4.x)
# this line tries to detect the version automatically
# This only matters for building the example sources.
# if version > 4 then it's 4
TARGETCCVER = $(shell $(TARGETCC) --version | head -1 | sed "s/.* \([[:digit:]][[:digit:]]*\)\.[[:digit:]][[:digit:]]*.*/\1/")
ifeq ($(shell test $(TARGETCCVER) -gt 4; echo $$?),0)
TARGETCCVER = 4
endif
# You generally shouldn't change this unless you are making forked
# versions (or test versions)
# Version numbers must be of the form x.x.x
VERSION = 1.0.6
# Define this if you want a standalone, statically linked, no dependency binary
#STANDALONE_BINARY = 1
# This is on by default for Windows (MinGW/MSYS, MinGW-w64/MSYS2 and Cygwin)
ifdef WINDOWS
STANDALONE_BINARY = 1
endif
# this is the default port for dc-tool, it can be changed on the commandline
# used for *nix systems
SERIALDEVICE = /dev/ttyS0
# alternative setting for USB-based serial interfaces
#SERIALDEVICE = /dev/ttyUSB0
# macOS -- you'll need to go look in /dev to see what the actual device
# name is, and depending on the device, it must be plugged into the same
# port each time.
#SERIALDEVICE = /dev/cu.usbserial-5B24
# Windows -- it's usually COM1
ifdef WINDOWS
SERIALDEVICE = COM1
endif
# default speed for dc-tool - after initial connection is established, connection
# speed will change to this value, same as using the -b argument
# value must be one of 9600, 19200, 38400, 57600, 115200, 230400, 500000, or 1500000
TOOL_DEFAULT_SPEED = 57600
# USB-based serial devices can potentially achieve speeds of 500000 or 1500000 baud
#TOOL_DEFAULT_SPEED = 500000