Add compilation step

This commit is contained in:
Alexander Heldt
2024-06-22 13:10:33 +02:00
parent 3dab4aece3
commit f5ce434891
2 changed files with 2473 additions and 1 deletions

View File

@@ -24,13 +24,17 @@ BUILD_DIR = build
SRC_FILES := $(wildcard $(SRC_DIR)/*.c) SRC_FILES := $(wildcard $(SRC_DIR)/*.c)
PREP_FILES := $(patsubst $(SRC_DIR)/%.c,$(BUILD_DIR)/%.i,$(SRC_FILES)) PREP_FILES := $(patsubst $(SRC_DIR)/%.c,$(BUILD_DIR)/%.i,$(SRC_FILES))
ASM_FILES := $(patsubst $(BUILD_DIR)/%.i,$(BUILD_DIR)/%.S,$(PREP_FILES))
.PHONY: build .PHONY: build
build: builddir preprocess build: builddir preprocess compile
$(BUILD_DIR)/%.i: $(SRC_DIR)/%.c $(BUILD_DIR)/%.i: $(SRC_DIR)/%.c
$(CC) $(CFLAGS) -E $^ -o $@ $(CC) $(CFLAGS) -E $^ -o $@
$(BUILD_DIR)/%.S: $(BUILD_DIR)/%.i
$(CC) $(CFLAGS) -S $^ -o $@
.PHONY: builddir .PHONY: builddir
builddir: builddir:
mkdir $(BUILD_DIR) mkdir $(BUILD_DIR)
@@ -38,6 +42,9 @@ builddir:
.PHONY: preprocess .PHONY: preprocess
preprocess: $(PREP_FILES) preprocess: $(PREP_FILES)
.PHONY: compile
compile: preprocess $(ASM_FILES)
.PHONY: clean .PHONY: clean
clean: clean:
rm -rf $(BUILD_DIR) rm -rf $(BUILD_DIR)

2465
build/main.S Normal file

File diff suppressed because it is too large Load Diff