feat(tree): initially working binary tree

This commit is contained in:
Jef Roosens 2023-01-19 22:45:22 +01:00 committed by Jef Roosens
parent 2ecd2eae4d
commit e88bfadf2c
4 changed files with 146 additions and 23 deletions

View file

@ -8,6 +8,8 @@ SRC_DIR ?= src
TEST_DIR ?= test
INC_DIRS ?= include
LIB := $(BUILD_DIR)/$(LIB_FILENAME)
SRCS != find '$(SRC_DIR)' -iname '*.c'
SRCS_H != find $(INC_DIRS) -iname '*.h'
SRCS_TEST != find '$(TEST_DIR)' -iname '*.c'
@ -34,8 +36,8 @@ all: vieter
# =====COMPILATION=====
.PHONY: vieter
vieter: $(BUILD_DIR)/$(LIB_FILENAME)
$(BUILD_DIR)/$(LIB_FILENAME): $(OBJS)
vieter: $(LIB)
$(LIB): $(OBJS)
ar -rcs $@ $(OBJS)
$(BUILD_DIR)/$(SRC_DIR)/%.c.o: $(SRC_DIR)/%.c
@ -55,10 +57,8 @@ test-mem: build-test
.PHONY: build-test
build-test: $(BINS_TEST)
# For simplicity, we link every object file to each of the test files. This
# might be changed later if this starts to become too slow.
$(BINS_TEST): %: %.c.o $(OBJS)
$(CC) $^ -o $@
$(BINS_TEST): %: %.c.o $(LIB)
$(CC) -L$(BUILD_DIR) -lvieter $^ -o $@
# Each test includes the test directory, which contains the acutest header file
$(BUILD_DIR)/$(TEST_DIR)/%.c.o: $(TEST_DIR)/%.c