Add assemble step
This commit is contained in:
9
Makefile
9
Makefile
@@ -25,9 +25,10 @@ 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))
|
||||
OBJ_FILES := $(patsubst $(BUILD_DIR)/%.S,$(BUILD_DIR)/%.o,$(ASM_FILES))
|
||||
|
||||
.PHONY: build
|
||||
build: builddir preprocess compile
|
||||
build: builddir preprocess compile assemble
|
||||
|
||||
$(BUILD_DIR)/%.i: $(SRC_DIR)/%.c
|
||||
$(CC) $(CFLAGS) -E $^ -o $@
|
||||
@@ -35,6 +36,9 @@ $(BUILD_DIR)/%.i: $(SRC_DIR)/%.c
|
||||
$(BUILD_DIR)/%.S: $(BUILD_DIR)/%.i
|
||||
$(CC) $(CFLAGS) -S $^ -o $@
|
||||
|
||||
$(BUILD_DIR)/%.o: $(BUILD_DIR)/%.S
|
||||
$(CC) $(CFLAGS) -c $^ -o $@
|
||||
|
||||
.PHONY: builddir
|
||||
builddir:
|
||||
mkdir $(BUILD_DIR)
|
||||
@@ -45,6 +49,9 @@ preprocess: $(PREP_FILES)
|
||||
.PHONY: compile
|
||||
compile: preprocess $(ASM_FILES)
|
||||
|
||||
.PHONY: assemble
|
||||
assemble: compile $(OBJ_FILES)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR)
|
||||
|
||||
Reference in New Issue
Block a user