-
-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Easier support for cross compiled GCC tools under Windows #325
Changes from all commits
551c046
ebc26f0
21ac93e
34c7334
009ac5b
97da4bc
c8b25db
56554e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,50 +2,34 @@ | |
|
||
BIN := $(GDK)/bin | ||
LIB := $(GDK)/lib | ||
export PATH := $(BIN):$(PATH) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Set the path to include the SGDK/bin directory. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would rather avoid to modify the PATH variable as it may cause troubles for an user who already has a GCC toolchain in its path (it was the case before and we got many issues with that). The way SGDK is working currently is convenient as it doesn't need any environment vars nor PATH modification. The |
||
|
||
SRC_LIB := $(GDK)/src | ||
RES_LIB := $(GDK)/res | ||
INCLUDE_LIB := $(GDK)/inc | ||
MAKEFILE_DIR := $(dir $(lastword $(MAKEFILE_LIST))) | ||
MAKEFILE_DIR := $(subst \,/,$(MAKEFILE_DIR)) | ||
|
||
ifeq ($(OS),Windows_NT) | ||
# Native Windows | ||
SHELL := $(BIN)/sh.exe | ||
RM := $(BIN)/rm.exe | ||
CP := $(BIN)/cp.exe | ||
MKDIR := $(BIN)/mkdir.exe | ||
|
||
AR := $(BIN)/ar.exe | ||
CC := $(BIN)/gcc.exe | ||
LD:= $(BIN)/ld.exe | ||
NM:= $(BIN)/nm.exe | ||
OBJCPY := $(BIN)/objcopy.exe | ||
ASMZ80 := $(BIN)/sjasm.exe | ||
MACCER := $(BIN)/mac68k.exe | ||
BINTOS := $(BIN)/bintos.exe | ||
LTO_PLUGIN := --plugin=liblto_plugin-0.dll | ||
LIBGCC := $(LIB)/libgcc.a | ||
else | ||
# Native Linux and Docker | ||
ifneq ($(OS),Windows_NT) | ||
PREFIX ?= m68k-elf- | ||
SHELL = sh | ||
RM = rm | ||
CP = cp | ||
MKDIR = mkdir | ||
|
||
AR := $(PREFIX)ar | ||
CC := $(PREFIX)gcc | ||
LD := $(PREFIX)ld | ||
NM := $(PREFIX)nm | ||
OBJCPY := $(PREFIX)objcopy | ||
ASMZ80 := sjasm | ||
MACCER := mac68k | ||
BINTOS := bintos | ||
LTO_PLUGIN := | ||
LIBGCC := -lgcc | ||
endif | ||
|
||
SHELL = sh | ||
RM = rm | ||
CP = cp | ||
MKDIR = mkdir | ||
|
||
AR := $(PREFIX)ar | ||
CC := $(PREFIX)gcc | ||
LD := $(PREFIX)ld | ||
NM := $(PREFIX)nm | ||
OBJCPY := $(PREFIX)objcopy | ||
ASMZ80 := sjasm | ||
MACCER := mac68k | ||
BINTOS := bintos | ||
LTO_PLUGIN := | ||
LIBGCC := -lgcc | ||
|
||
Comment on lines
+17
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As mentioned in previous comment I prefer to not path PATH and use full path and so keep both |
||
JAVA := java | ||
ECHO := echo | ||
SIZEBND := $(JAVA) -jar $(BIN)/sizebnd.jar | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,7 +168,7 @@ $(OUT)/symbol.txt: $(OUT)/rom.out | |
|
||
$(OUT)/rom.out: $(OUT)/sega.o $(OUT)/cmd_ $(LIBMD) | ||
$(MKDIR) -p $(dir $@) | ||
$(CC) -m68000 -B$(BIN) -n -T $(GDK)/md.ld -nostdlib $(OUT)/sega.o @$(OUT)/cmd_ $(LIBMD) $(LIBGCC) -o $(OUT)/rom.out -Wl,--gc-sections -flto | ||
$(CC) -m68000 -B$(BIN) -n -T $(GDK)/md.ld -nostdlib $(OUT)/sega.o @$(OUT)/cmd_ -L$(LIB) $(LIBMD) $(LIBGCC) -o $(OUT)/rom.out -Wl,--gc-sections -flto | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use -L to set the library path. This allows libgcc.a to be picked up from the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
See previous comment (use full path for lib) so the option is not needed. |
||
$(RM) $(OUT)/cmd_ | ||
|
||
$(OUT)/cmd_: $(OBJS) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minimize the differences between Windows and Linux. The
.exe
extension isn't needed.