First commit

This commit is contained in:
2021-01-08 04:13:12 +01:00
commit c29ed0580a
23 changed files with 643 additions and 0 deletions

42
Makefile Normal file
View File

@@ -0,0 +1,42 @@
AS = sdasz80
CC = sdcc
AR = sdar
BUILD = .build
TARGET = crt
OPT = s
CFLAGS = -mz80 -D__SDCC__ -Iinclude
ASFLAGS = -plosgff
SRC = \
src/crt0.s \
src/bios.s \
src/random.s \
src/console.c \
OBJ_1 = $(notdir $(SRC:.c=.rel))
OBJ_2 = $(notdir $(OBJ_1:.s=.rel))
OBJ = $(addprefix $(BUILD)/, $(OBJ_2))
vpath %.c $(sort $(dir $(SRC)))
vpath %.s $(sort $(dir $(SRC)))
.PHONY: all clean
all: $(BUILD) $(BUILD)/$(TARGET).a
$(BUILD)/%.rel: %.c Makefile | $(BUILD)
$(CC) -c $(CFLAGS) $< -o $@
$(BUILD)/%.rel: %.s Makefile | $(BUILD)
$(AS) $(ASFLAGS) $@ $<
$(BUILD)/$(TARGET).a: $(OBJ)
$(AR) rcs $@ $(OBJ)
$(BUILD):
mkdir $@
clean:
rm -fr $(BUILD)