-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathlinux.target
More file actions
40 lines (29 loc) · 846 Bytes
/
linux.target
File metadata and controls
40 lines (29 loc) · 846 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
# Turn on all warnings except missing-braces
# (no-missing-braces is for protoc generated code)
CC = gcc -Wall -Wextra -Wno-missing-braces
AR = ar rc
DIRs += $(shell find ./src -maxdepth 3 -type d)
DIRs += ./osal/linux
OUTPUT_DIR = build/debug
#CFLAGS += -DPRINTDEBUG
CFLAGS += $(foreach dir, $(DIRs), -I $(dir))
CFLAGS += -DOSAL_LINUX
LIBS += -lpthread
LIBSRC = $(foreach dir, $(DIRs), $(wildcard $(dir)/*.c))
LIBOBJ_nodir = $(notdir $(LIBSRC))
LIBOBJ = $(patsubst %.c,%.o,$(LIBOBJ_nodir))
LIB_OBJECT = csmp_agent_lib.a
LIBSRC += osal/linux/osal_linux.c
INC += \
osal
vpath %.c $(DIRs)
$(LIB_OBJECT): $(addprefix $(OUTPUT_DIR)/, $(LIBOBJ))
@echo 'Building lib $@'
$(AR) $@ $^
$(OUTPUT_DIR)/%.o: %.c
@echo 'Building $<'
@mkdir -p $(@D)
@$(CC) $(CFLAGS) -c -o $@ $< -I $(INC)
clean:
$(RM) -rf $(BUILD_DIR)
$(RM) $(PROJECTNAME).a