-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefileTest.mk
More file actions
42 lines (32 loc) · 923 Bytes
/
Copy pathMakefileTest.mk
File metadata and controls
42 lines (32 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
CC = gcc
FLAGS = -std=c99
BUILD_DIR = $(UNITY_DIR)/build
TARGET = $(BUILD_DIR)/tests.out
SYMBOLS=-DTEST -DUNITY_SUPPORT_64
TESTS_DIR = Tests
INCLUDES += \
-I$(UNITY_DIR)/src \
-I$(UNITY_DIR)/extras/fixture/src \
-I$(UNITY_DIR)/extras/memory/src
SOURCES += \
$(UNITY_DIR)/src/unity.c \
$(UNITY_DIR)/extras/fixture/src/unity_fixture.c \
$(UNITY_DIR)/extras/memory/src/unity_memory.c \
$(TESTS_DIR)/all_tests.c \
$(TESTS_DIR)/crc_buffer/crc_buffer_test.c \
$(TESTS_DIR)/crc_buffer/crc_buffer_test_runner.c
OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(SOURCES:.c=.o)))
all: $(TARGET)
vpath %.c $(dir $(SOURCES))
$(BUILD_DIR)/%.o: %.c
$(CC) $(FLAGS) $(SYMBOLS) -MD $(INCLUDES) -c $< -o $@
$(TARGET): $(OBJECTS)
$(CC) $(FLAGS) $(OBJECTS) -o $(TARGET)
.PHONY = start
start: $(TARGET)
echo ---Start tests:
./$(TARGET) -v # -v - print tests
.PHONY = clean
clean:
rm -f $(BUILD_DIR)/*
-include $(TEST_OBJECTS:.o=.d)