-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
50 lines (38 loc) · 938 Bytes
/
Makefile
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
43
44
45
46
47
48
49
50
.PHONY: all check clean
TARGET = radar01
GIT_HOOKS := .git/hooks/applied
all: $(GIT_HOOKS) $(TARGET) $(C_SOURCES)
$(GIT_HOOKS):
@scripts/install-git-hooks
@echo
include common.mk
CFLAGS = -I./ -I./vender -I./ringbuffer
CFLAGS += -Os
CFLAGS += -std=gnu99 -Wall -W
CFLAGS += -DUNUSED="__attribute__((unused))"
CFLAGS += -DNDEBUG
CFLAGS += -ljson-c
LDFLAGS += -lpthread -ljson-c
##### C Source #####
C_SOURCES = \
./radar01_main.c \
./radar01_io.c \
./radar01_utils.c \
./radar01_tlv.c \
./radar01_http.c \
./ringbuffer/ringbuffer.c
####################
OBJECTS = $(patsubst %.c, %.o, $(C_SOURCES))
deps += $(OBJECTS:%.o=%.o.d)
%.o: %.c
$(VECHO) " CC\t$@\n"
$(Q)$(CC) -o $@ $(CFLAGS) -c -MMD -MF $@.d $<
$(TARGET): $(OBJECTS)
$(VECHO) " LD\t$@\n"
$(Q)$(CC) -o $@ $^ $(LDFLAGS)
check: all
@scripts/test.sh
clean:
$(VECHO) " Cleaning...\n"
$(Q)$(RM) $(TARGET) $(OBJECTS) $(deps)
-include $(deps)