Skip to content

Commit

Permalink
#407 32X use Chilly Willy's CRT code for Mars & Genesis, use preproce…
Browse files Browse the repository at this point in the history
…ssor for asm files
  • Loading branch information
XProger committed Mar 8, 2022
1 parent 26c4ed5 commit 13255f9
Show file tree
Hide file tree
Showing 9 changed files with 1,943 additions and 947 deletions.
16 changes: 8 additions & 8 deletions src/platform/32x/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ LDSCRIPTSDIR = $(ROOTDIR)/ldscripts
SHPREFIX = $(ROOTDIR)/sh-elf/bin/sh-elf-
SHCC = $(SHPREFIX)gcc
SHXX = $(SHPREFIX)g++
SHPP = $(SHPREFIX)cpp
SHAS = $(SHPREFIX)as
SHLD = $(SHPREFIX)ld
SHOBJC = $(SHPREFIX)objcopy
Expand Down Expand Up @@ -41,14 +42,13 @@ FILES_CC = $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.c))
FILES_XX = $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.cpp))

LIBS = $(LIBPATH) -lm -lc -lgcc -lgcc-Os-4-200 -lnosys
OBJS = $(BUILD)/sh2_crt0.o
OBJS += $(addprefix $(BUILD)/, $(notdir $(FILES_AS:%.s=%.o)))
OBJS = $(addprefix $(BUILD)/, $(notdir $(FILES_AS:%.s=%.o)))
OBJS += $(addprefix $(BUILD)/, $(notdir $(FILES_CC:%.c=%.o)))
OBJS += $(addprefix $(BUILD)/, $(notdir $(FILES_XX:%.cpp=%.o)))

.PHONY: dump clean

all: $(BUILD) m68k_crt0.bin m68k_crt1.bin $(TARGET).32x
all: $(BUILD) m68k.bin $(TARGET).32x

dump:
@[ -d dump ] || mkdir -p dump
Expand All @@ -68,15 +68,15 @@ $(TARGET).32x: $(TARGET).elf
$(TARGET).elf: $(OBJS)
$(SHCC) $(SHLDFLAGS) $(OBJS) $(LIBS) -o $(TARGET).elf

%.bin: crt/%.s
$(MDAS) $(MDASFLAGS) -o $(BUILD)/$@.o $<
$(MDLD) $(MDLDFLAGS) -o $(BUILD)/$@ $(BUILD)/$@.o
m68k.bin:
make -C src-md

$(BUILD)/%.o: crt/%.s
$(BUILD)/%.o: %.s
$(SHAS) $(SHASFLAGS) $(INCPATH) -o $@ $<

$(BUILD)/%.o: asm/%.s
$(SHAS) $(SHASFLAGS) $(INCPATH) -o $@ $<
$(SHPP) $(INCPATH) -o $(BUILD)/$(notdir $<) $<
$(SHAS) $(SHASFLAGS) $(INCPATH) -o $@ $(BUILD)/$(notdir $<)

$(BUILD)/%.o: %.c
$(SHCC) $(SHCCFLAGS) $(INCPATH) -o $@ $<
Expand Down
85 changes: 0 additions & 85 deletions src/platform/32x/crt/m68k_crt0.s

This file was deleted.

Loading

0 comments on commit 13255f9

Please sign in to comment.