Skip to content

Commit d24da7f

Browse files
committed
do not attempt to create build folder several time
1 parent 5142ee5 commit d24da7f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@ all: $(TARGET)
1717
$(TARGET): $(OBJS) | $(BUILD_DIR)
1818
$(CC) -o $@ $^
1919

20-
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
21-
mkdir -p $(@D)
20+
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR)
2221
$(CC) $(CFLAGS) -c $< -o $@
2322

24-
$(BUILD_DIR):
23+
$(BUILD_DIR) $(OBJ_DIR):
2524
mkdir -p $@
2625

2726
clean:

0 commit comments

Comments
 (0)