mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-01-22 00:51:54 -05:00
32x: Add to main makefile
This commit is contained in:
parent
2dc30e8859
commit
36a1fbbd49
2 changed files with 41 additions and 20 deletions
6
Makefile
6
Makefile
|
@ -222,10 +222,12 @@ release:
|
|||
|
||||
# Some builds require more complex handling, so are moved to
|
||||
# separate makefiles to avoid having one giant messy makefile
|
||||
dreamcast:
|
||||
$(MAKE) -f misc/dreamcast/Makefile
|
||||
32x:
|
||||
$(MAKE) -f misc/32x/Makefile
|
||||
saturn:
|
||||
$(MAKE) -f misc/saturn/Makefile
|
||||
dreamcast:
|
||||
$(MAKE) -f misc/dreamcast/Makefile
|
||||
psp:
|
||||
$(MAKE) -f misc/psp/Makefile
|
||||
vita:
|
||||
|
|
|
@ -30,15 +30,31 @@ MDLD = $(MDPREFIX)ld
|
|||
DD = dd
|
||||
RM = rm -f
|
||||
|
||||
TARGET = ClassiCube
|
||||
TARGET = ClassiCube-32x
|
||||
LIBS = $(LIBPATH) -lc -lgcc -lgcc-Os-4-200 -lnosys
|
||||
BUILD_DIR = build-32x
|
||||
|
||||
SOURCE_DIRS = ../../src
|
||||
SOURCE_DIRS = src misc/32x
|
||||
C_FILES = $(foreach dir,$(SOURCE_DIRS),$(wildcard $(dir)/*.c))
|
||||
OBJS = sh2_crt0.o main_32x.o hw_32x.o $(notdir $(C_FILES:%.c=%.o))
|
||||
S_FILES = misc/32x/sh2_crt0.s
|
||||
OBJS = $(addprefix $(BUILD_DIR)/, $(notdir $(C_FILES:%.c=%.o) $(S_FILES:%.s=%.o)))
|
||||
|
||||
all: m68k_crt0.bin m68k_crt1.bin $(TARGET).bin
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# main targets
|
||||
#---------------------------------------------------------------------------------
|
||||
all: $(BUILD_DIR) m68k_crt0.bin m68k_crt1.bin $(TARGET).bin
|
||||
|
||||
clean:
|
||||
$(RM) *.o *.bin *.elf output.map
|
||||
|
||||
$(BUILD_DIR):
|
||||
mkdir -p $(BUILD_DIR)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# binary generation
|
||||
#---------------------------------------------------------------------------------
|
||||
$(TARGET).bin: $(TARGET).elf
|
||||
$(SHOBJC) -O binary $< temp.bin
|
||||
$(DD) if=temp.bin of=$@ bs=64K conv=sync
|
||||
|
@ -46,25 +62,28 @@ $(TARGET).bin: $(TARGET).elf
|
|||
$(TARGET).elf: $(OBJS)
|
||||
$(SHCC) $(SHLDFLAGS) $(OBJS) $(LIBS) -o $(TARGET).elf
|
||||
|
||||
m68k_crt0.bin: m68k_crt0.s
|
||||
$(MDAS) $(MDASFLAGS) -o m68k_crt0.o m68k_crt0.s
|
||||
$(MDLD) $(MDLDFLAGS) -o m68k_crt0.bin m68k_crt0.o
|
||||
|
||||
m68k_crt1.bin: m68k_crt1.s
|
||||
$(MDAS) $(MDASFLAGS) -o m68k_crt1.o m68k_crt1.s
|
||||
$(MDLD) $(MDLDFLAGS) -o m68k_crt1.bin m68k_crt1.o
|
||||
$(BUILD_DIR)/m68k_crt0.o: misc/32x/m68k_crt0.s
|
||||
$(MDAS) $(MDASFLAGS) $< -o $@
|
||||
|
||||
hw_32x.o: hw_32x.c
|
||||
$(SHCC) $(SHHWFLAGS) $(INCPATH) $< -o $@
|
||||
m68k_crt0.bin: $(BUILD_DIR)/m68k_crt0.o
|
||||
$(MDLD) $(MDLDFLAGS) $< -o $@
|
||||
|
||||
%.o: %.c
|
||||
$(BUILD_DIR)/m68k_crt1.o: misc/32x/m68k_crt1.s
|
||||
$(MDAS) $(MDASFLAGS) $< -o $@
|
||||
|
||||
m68k_crt1.bin: $(BUILD_DIR)/m68k_crt1.o
|
||||
$(MDLD) $(MDLDFLAGS) $< -o $@
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# object generation
|
||||
#---------------------------------------------------------------------------------
|
||||
$(BUILD_DIR)/%.o: src/%.c
|
||||
$(SHCC) $(SHCCFLAGS) $(INCPATH) $< -o $@
|
||||
|
||||
%.o: ../../src/%.c
|
||||
$(BUILD_DIR)/%.o: misc/32x/%.c
|
||||
$(SHCC) $(SHCCFLAGS) $(INCPATH) $< -o $@
|
||||
|
||||
%.o: %.s
|
||||
$(BUILD_DIR)/%.o: misc/32x/%.s
|
||||
$(SHAS) $(SHASFLAGS) $(INCPATH) $< -o $@
|
||||
|
||||
clean:
|
||||
$(RM) *.o *.bin *.elf output.map
|
||||
|
|
Loading…
Reference in a new issue