Skip to content

Commit

Permalink
Fix gh #162 : Fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kanjoe24 committed Dec 19, 2024
1 parent e2022be commit 3d4d7b9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ ifdef BUILD_WEAK_STUBS_SRC

# Define variables for the static library and its source files
WEAK_STUBS_LIB := $(LIB_DIR)/libweak_stubs_libs.a
WEAK_STUBS_OUTPUT_DIR ?= $(BUILD_DIR)/weak_stubs/src
WEAK_STUBS_SRC := $(shell find $(BUILD_WEAK_STUBS_SRC) -name *.c)
WEAK_STUBS_OBJ := $(patsubst $(TOP_DIR)/%, $(BUILD_DIR)/%, $(WEAK_STUBS_SRC:.c=.o)) # Apply the pattern substitution to create object file paths
WEAK_STUBS_OBJ := $(patsubst $(BUILD_WEAK_STUBS_SRC)/%, $(WEAK_STUBS_OUTPUT_DIR)/%, $(WEAK_STUBS_SRC:.c=.o)) # Apply the pattern substitution to create object file paths

XLDFLAGS := -L$(LIB_DIR) -lweak_stubs_libs $(XLDFLAGS)
endif
Expand Down Expand Up @@ -155,7 +156,7 @@ endif
# Create necessary directories
createdirs:
@echo "$(VARIANT)" > $(VARIANT_FILE)
@$(MKDIR_P) ${BIN_DIR} ${LIB_DIR}
@$(MKDIR_P) ${BIN_DIR} ${LIB_DIR} $(if $(BUILD_WEAK_STUBS_SRC),${WEAK_STUBS_OUTPUT_DIR})

# Compilation rules
$(BUILD_DIR)/%.o: %.c
Expand Down Expand Up @@ -184,11 +185,11 @@ checkvariantchange:

# Create the library weak_stubs_libs
$(WEAK_STUBS_LIB): $(WEAK_STUBS_OBJ)
@${ECHOE} ${GREEN}Building weak_stubs_libs...${NC}
${ECHOE} ${GREEN}Building weak_stubs_libs...${NC}
@$(AR) rcs $@ $^

# Rule to compile .c files into .o files in the correct directory
$(BUILD_DIR)/skelton/src/%.o: $(BUILD_WEAK_STUBS_SRC)/%.c
$(WEAK_STUBS_OUTPUT_DIR)/%.o: $(BUILD_WEAK_STUBS_SRC)/%.c
@$(MKDIR_P) $(dir $@)
@$(COMPILER) $(XCFLAGS) -c $< -o $@

Expand Down

0 comments on commit 3d4d7b9

Please sign in to comment.