Add compilation step
This commit is contained in:
9
Makefile
9
Makefile
@@ -24,13 +24,17 @@ BUILD_DIR = build
|
||||
|
||||
SRC_FILES := $(wildcard $(SRC_DIR)/*.c)
|
||||
PREP_FILES := $(patsubst $(SRC_DIR)/%.c,$(BUILD_DIR)/%.i,$(SRC_FILES))
|
||||
ASM_FILES := $(patsubst $(BUILD_DIR)/%.i,$(BUILD_DIR)/%.S,$(PREP_FILES))
|
||||
|
||||
.PHONY: build
|
||||
build: builddir preprocess
|
||||
build: builddir preprocess compile
|
||||
|
||||
$(BUILD_DIR)/%.i: $(SRC_DIR)/%.c
|
||||
$(CC) $(CFLAGS) -E $^ -o $@
|
||||
|
||||
$(BUILD_DIR)/%.S: $(BUILD_DIR)/%.i
|
||||
$(CC) $(CFLAGS) -S $^ -o $@
|
||||
|
||||
.PHONY: builddir
|
||||
builddir:
|
||||
mkdir $(BUILD_DIR)
|
||||
@@ -38,6 +42,9 @@ builddir:
|
||||
.PHONY: preprocess
|
||||
preprocess: $(PREP_FILES)
|
||||
|
||||
.PHONY: compile
|
||||
compile: preprocess $(ASM_FILES)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR)
|
||||
|
||||
2465
build/main.S
Normal file
2465
build/main.S
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user