forked from open-mesh-mirror/batman-adv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
81 lines (67 loc) · 2.17 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
71
72
73
74
75
76
77
78
79
80
81
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) B.A.T.M.A.N. contributors:
#
# Marek Lindner, Simon Wunderlich
# read README.external for more information about the configuration
# B.A.T.M.A.N. V routing algorithm (experimental):
export CONFIG_BATMAN_ADV_BATMAN_V=y
# B.A.T.M.A.N. bridge loop avoidance:
export CONFIG_BATMAN_ADV_BLA=y
# B.A.T.M.A.N. distributed ARP table:
export CONFIG_BATMAN_ADV_DAT=y
# B.A.T.M.A.N. debugging:
export CONFIG_BATMAN_ADV_DEBUG=n
# B.A.T.M.A.N. multicast optimizations:
export CONFIG_BATMAN_ADV_MCAST=y
# B.A.T.M.A.N network coding (catwoman):
export CONFIG_BATMAN_ADV_NC=n
# B.A.T.M.A.N. tracing support:
export CONFIG_BATMAN_ADV_TRACING=n
PWD:=$(shell pwd)
KERNELPATH ?= /lib/modules/$(shell uname -r)/build
# sanity check: does KERNELPATH exist?
ifeq ($(shell cd $(KERNELPATH) && pwd),)
$(warning $(KERNELPATH) is missing, please set KERNELPATH)
endif
export KERNELPATH
RM ?= rm -f
CP := cp -fpR
LN := ln -sf
DEPMOD := depmod -a
REVISION= $(shell if [ -d "$(PWD)/.git" ]; then \
echo $$(git --git-dir="$(PWD)/.git" describe --always --dirty --match "v*" |sed 's/^v//' 2> /dev/null || echo "[unknown]"); \
fi)
NOSTDINC_FLAGS += \
-I$(PWD)/compat-include/ \
-I$(PWD)/include/ \
-include $(PWD)/compat.h \
$(CFLAGS)
ifneq ($(REVISION),)
NOSTDINC_FLAGS += -DBATADV_SOURCE_VERSION=\"$(REVISION)\"
endif
obj-y += net/batman-adv/
export batman-adv-y
BUILD_FLAGS := \
M=$(PWD) \
PWD=$(PWD) \
REVISION=$(REVISION) \
CONFIG_BATMAN_ADV=m \
CONFIG_BATMAN_ADV_DEBUG=$(CONFIG_BATMAN_ADV_DEBUG) \
CONFIG_BATMAN_ADV_BLA=$(CONFIG_BATMAN_ADV_BLA) \
CONFIG_BATMAN_ADV_DAT=$(CONFIG_BATMAN_ADV_DAT) \
CONFIG_BATMAN_ADV_NC=$(CONFIG_BATMAN_ADV_NC) \
CONFIG_BATMAN_ADV_MCAST=$(CONFIG_BATMAN_ADV_MCAST) \
CONFIG_BATMAN_ADV_TRACING=$(CONFIG_BATMAN_ADV_TRACING) \
CONFIG_BATMAN_ADV_BATMAN_V=$(CONFIG_BATMAN_ADV_BATMAN_V) \
INSTALL_MOD_DIR=updates/
all: config
$(MAKE) -C $(KERNELPATH) $(BUILD_FLAGS) modules
clean:
$(RM) compat-autoconf.h*
$(MAKE) -C $(KERNELPATH) $(BUILD_FLAGS) clean
install: config
$(MAKE) -C $(KERNELPATH) $(BUILD_FLAGS) modules_install
$(DEPMOD)
config:
$(PWD)/gen-compat-autoconf.sh $(PWD)/compat-autoconf.h
.PHONY: all clean install config