diff --git a/Makefile b/Makefile index f3059a7..7a817a6 100644 --- a/Makefile +++ b/Makefile @@ -6,15 +6,20 @@ LIB_FILENAME ?= libvieter.a BUILD_DIR ?= build SRC_DIR ?= src TEST_DIR ?= test -INC_DIRS ?= include +3RDPARTY_DIR ?= thirdparty +INCLUDE_DIR ?= include +INC_DIRS ?= $(INCLUDE_DIR) $(3RDPARTY_DIR)/include LIB := $(BUILD_DIR)/$(LIB_FILENAME) SRCS != find '$(SRC_DIR)' -iname '*.c' -SRCS_H != find $(INC_DIRS) -iname '*.h' +SRCS_H != find $(INCLUDE_DIR) -iname '*.h' SRCS_TEST != find '$(TEST_DIR)' -iname '*.c' +SRCS_3RDPARTY != find '$(3RDPARTY_DIR)/src' -iname '*.c' -OBJS := $(SRCS:%=$(BUILD_DIR)/%.o) +$(info ${SRCS}) + +OBJS := $(SRCS:%=$(BUILD_DIR)/%.o) $(SRCS_3RDPARTY:%=$(BUILD_DIR)/%.o) OBJS_TEST := $(SRCS_TEST:%=$(BUILD_DIR)/%.o) DEPS := $(SRCS:%=$(BUILD_DIR)/%.d) $(SRCS_TEST:%=$(BUILD_DIR)/%.d) @@ -51,6 +56,9 @@ $(BUILD_DIR)/$(SRC_DIR)/%.c.o: $(SRC_DIR)/%.c mkdir -p $(dir $@) $(CC) $(VIETERCFLAGS) -c $< -o $@ +$(BUILD_DIR)/$(3RDPARTY_DIR)/src/%.c.o: $(3RDPARTY_DIR)/src/%.c + mkdir -p $(dir $@) + $(CC) $(VIETERCFLAGS) -c $< -o $@ # =====TESTING===== .PHONY: test diff --git a/src/package/sha256.h b/thirdparty/include/sha256.h similarity index 100% rename from src/package/sha256.h rename to thirdparty/include/sha256.h diff --git a/src/package/sha256.c b/thirdparty/src/sha256.c similarity index 100% rename from src/package/sha256.c rename to thirdparty/src/sha256.c