forked from vieter-v/libvieter
refactor: separate directory for thirdparty code
parent
031e28ed33
commit
bfa1130478
14
Makefile
14
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
|
||||
|
|
Loading…
Reference in New Issue