Converted monitor to asz80 to allow a more modular design
This commit is contained in:
70
Makefile
70
Makefile
@@ -1,19 +1,67 @@
|
||||
BUILDDIR=.build
|
||||
_BIN= rom_monitor.bin ram_monitor.bin MONITOR.COM
|
||||
BIN = $(patsubst %,$(BUILDDIR)/%,$(_BIN))
|
||||
# BUILDDIR=.build
|
||||
# _BIN= rom_monitor.bin ram_monitor.bin MONITOR.COM
|
||||
# BIN = $(patsubst %,$(BUILDDIR)/%,$(_BIN))
|
||||
#
|
||||
# .PHONY: all clean
|
||||
#
|
||||
# all: $(BUILDDIR) $(BIN)
|
||||
#
|
||||
# $(BUILDDIR)/%.bin: src/%.z80 | $(BUILDDIR)
|
||||
# @zasm -w -i $< -o $@
|
||||
#
|
||||
# $(BUILDDIR)/%.COM: src/%.z80 | $(BUILDDIR)
|
||||
# @zasm -w -i $< -o $@
|
||||
#
|
||||
# $(BUILDDIR):
|
||||
# @mkdir $(BUILDDIR)
|
||||
#
|
||||
# clean:
|
||||
# @rm -df $(BUILDDIR)/*.bin $(BUILDDIR)/*.COM $(BUILDDIR)/*.lst .build
|
||||
|
||||
AS = sdasz80
|
||||
LD = sdldz80
|
||||
OBJCOPY = sdobjcopy
|
||||
|
||||
BUILD = .build
|
||||
|
||||
TARGET_ROM = rom_monitor
|
||||
TARGET_COM = MONITOR
|
||||
|
||||
ASFLAGS = -plosff
|
||||
|
||||
SRC_ROM = \
|
||||
src/monitor.s \
|
||||
src/rom.s
|
||||
SRC_COM = \
|
||||
src/monitor.s \
|
||||
src/cpm.s
|
||||
|
||||
OBJ_ROM = $(addprefix $(BUILD)/, $(notdir $(SRC_ROM:.s=.rel)))
|
||||
OBJ_COM = $(addprefix $(BUILD)/, $(notdir $(SRC_COM:.s=.rel)))
|
||||
vpath %.s $(sort $(dir $(SRC_ROM)))
|
||||
vpath %.s $(sort $(dir $(SRC_COM)))
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
all: $(BUILDDIR) $(BIN)
|
||||
all: $(BUILD) $(BUILD)/$(TARGET_ROM).bin $(BUILD)/$(TARGET_COM).COM
|
||||
|
||||
$(BUILDDIR)/%.bin: src/%.z80 | $(BUILDDIR)
|
||||
@zasm -w -i $< -o $@
|
||||
$(BUILD)/%.rel: %.s Makefile | $(BUILD)
|
||||
$(AS) $(ASFLAGS) $@ $<
|
||||
|
||||
$(BUILDDIR)/%.COM: src/%.z80 | $(BUILDDIR)
|
||||
@zasm -w -i $< -o $@
|
||||
$(BUILD)/$(TARGET_ROM).ihx: $(OBJ_ROM)
|
||||
$(LD) -im1 $@ $(OBJ_ROM) -b BOOT=0x0000
|
||||
|
||||
$(BUILDDIR):
|
||||
@mkdir $(BUILDDIR)
|
||||
$(BUILD)/$(TARGET_COM).ihx: $(OBJ_COM)
|
||||
$(LD) -im1 $@ $(OBJ_COM) -b BOOT=0x0100 -b MAIN=0xE200
|
||||
|
||||
%.bin: %.ihx
|
||||
$(OBJCOPY) -I ihex -O binary $< $@
|
||||
|
||||
%.COM: %.ihx
|
||||
$(OBJCOPY) -I ihex -O binary $< $@
|
||||
|
||||
$(BUILD):
|
||||
mkdir $@
|
||||
|
||||
clean:
|
||||
@rm -df $(BUILDDIR)/*.bin $(BUILDDIR)/*.COM $(BUILDDIR)/*.lst .build
|
||||
rm -fr $(BUILD)
|
||||
|
||||
Reference in New Issue
Block a user