Skip to content

Commit

Permalink
Fixed creating directories by the makefile.
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlexSee committed Feb 1, 2019
1 parent 68c8d22 commit b88886e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 1 addition & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ libs:
$(MAKE) -C src/main
$(MAKE) -C src/utils

.PHONY: dirs
.PHONY: create_dirs
create_dirs:
mkdir -p $(BUILD_DIR)
mkdir -p $(LIB_DIR)
mkdir -p $(OBJ_DIR)

Expand Down
12 changes: 9 additions & 3 deletions unit_tests/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ HASH_MAP_LIB = hash_map.a
INDEX_LIB = index.a
UTILS_LIB = utils.a

LIB_DIR = "../build/libs"
BUILD_DIR = ../build
LIB_DIR = $(BUILD_DIR)/libs
OBJ_DIR = $(BUILD_DIR)/obj

LIBS = $(HASH_MAP_LIB) $(HASH_FUNCTION_LIB) $(INDEX_LIB) $(UTILS_LIB)
LIBS := $(addprefix $(LIB_DIR)/,$(LIBS))

all: $(EXE)
all: create_dirs $(EXE)

$(EXE): $(OBJ) libs
$(CC) $(CCFLAGS) $(OPTFLAGS) $(OBJ) $(LIBS) -o $@
Expand Down Expand Up @@ -71,8 +73,12 @@ utils_string_utils_tests.o: utils_string_utils_tests.cpp ../src/utils/string_uti
run: all
./$(EXE)

.PHONY: clean
.PHONY: create_dirs
create_dirs:
mkdir -p $(LIB_DIR)
mkdir -p $(OBJ_DIR)

.PHONY: clean
clean:
rm -f $(EXE) $(OBJ)

Expand Down

0 comments on commit b88886e

Please sign in to comment.