forked from vieter-v/libvieter
chore: some nitpicking
This commit is contained in:
parent
ab418e57b3
commit
d77b3e4fee
3 changed files with 10 additions and 7 deletions
11
Makefile
11
Makefile
|
|
@ -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'
|
||||
|
|
@ -40,7 +42,7 @@ all: vieter
|
|||
objs: $(OBJS)
|
||||
|
||||
.PHONY: vieter
|
||||
vieter: $(BUILD_DIR)/$(LIB_FILENAME)
|
||||
vieter: $(LIB)
|
||||
$(BUILD_DIR)/$(LIB_FILENAME): $(OBJS)
|
||||
ar -rcs $@ $(OBJS)
|
||||
|
||||
|
|
@ -69,10 +71,11 @@ 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) \
|
||||
$^ -o $@
|
||||
|
||||
# Allow with the include directory, each test includes $(TEST_DIR) (which
|
||||
# Along with the include directory, each test includes $(TEST_DIR) (which
|
||||
# contains the acutest.h header file), and the src directory of the module it's
|
||||
# testing. This allows tests to access internal methods, which aren't publicly
|
||||
# exposed.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue