-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
70 lines (56 loc) · 1.27 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#
ifndef CC
CC := gcc
endif
CFLAGS := $(PLAT_CFLAGS)
RM := rm -rf
CP := cp
MD := mkdir -p
DIR_SRC := ./src
DIR_OBJ := ./obj
DIR_DEP := ./obj
DIR_BIN := ./bin
DIR_CONFIG := ./config
# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include objects.mk
ifeq ($(DEBUG), 1)
CFLAGS := $(CFLAGS) -DNVIPFIX_DEF_DEBUG
endif
ifeq ($(USE_NVC), 1)
CFLAGS := $(CFLAGS) -DNVIPFIX_DEF_ENABLE_NVC
LIBS := $(LIBS) -lssl -lcrypto -lnvOS
endif
ifeq ($(UNICODE), 1)
CFLAGS := $(CFLAGS) -DNVIPFIX_DEF_UNICODE
endif
ifeq ($(TEST), 1)
CFLAGS := $(CFLAGS) -DNVIPFIX_DEF_TEST
endif
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
endif
# All Target
all: dirs $(DIR_BIN)/nvIPFIX
dirs:
$(MD) $(DIR_BIN)
$(MD) $(DIR_OBJ)
$(MD) $(DIR_DEP)
# Tool invocations
$(DIR_BIN)/nvIPFIX: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: Cross GCC Linker'
$(CC) -fopenmp -o $@ $(OBJS) $(USER_OBJS) -L/usr/local/lib $(PLAT_LDFLAGS) $(LIBS)
$(CP) $(DIR_CONFIG)/log4crc $(DIR_BIN)/
$(CP) $(DIR_CONFIG)/nvipfix.config $(DIR_BIN)/
@echo 'Finished building target: $@'
@echo ' '
# Other Targets
clean:
-$(RM) $(OBJS)$(C_DEPS)$(EXECUTABLES) $(DIR_BIN)/nvIPFIX
-@echo ' '
.PHONY: all clean dependents
.SECONDARY: