Skip to content

Commit

Permalink
feat: add asm dependencies in makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
tdameros committed Aug 3, 2024
1 parent b359883 commit b664b79
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ DIR_UTEST = $(DIR_LIB)utest/
# ------------- SHORTCUTS ------------- #

OBJ = $(patsubst %.s, $(DIR_BUILD)%.o, $(SRC))
DEP = $(patsubst %.c, $(DIR_BUILD)%.d, $(SRC))
DEP = $(patsubst %.s, $(DIR_BUILD)%.d, $(SRC))
SRC = $(addprefix $(DIR_SRC), $(LIST_ASM_SRC))
TEST_SRC = $(addprefix $(DIR_TEST), $(LIST_TEST_SRC))
TEST_DEP = $(patsubst %.c, $(DIR_BUILD)%.d, $(TEST_SRC))
Expand All @@ -71,6 +71,7 @@ MKDIR = mkdir -p

#*********************************** RULES **********************************#


.PHONY: all
all: $(NAME)

Expand All @@ -88,9 +89,10 @@ $(NAME): $(OBJ)

# ---------- COMPILED RULES ----------- #

-include $(DEP)
$(DIR_BUILD)%.o: %.s
mkdir -p $(shell dirname $@)
$(AS) $(ASFLAGS) $< -o $@
$(AS) $(ASFLAGS) -MD $(@:.o=.d) $< -o $@

-include $(TEST_DEP)
$(DIR_BUILD)%.o: %.c
Expand Down

0 comments on commit b664b79

Please sign in to comment.