Debian Codegraph @

Makefile

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 # SPDX-License-Identifier: GPL-2.0
2 # Copyright (C) 2020- OpenVPN, Inc.
3 #
4 # Author: Antonio Quartulli <[email protected]>
5
6 PWD:=$(shell pwd)
7 KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build
8 ifeq ($(shell cd $(KERNEL_SRC) && pwd),)
9 $(warning $(KERNEL_SRC) is missing, please set KERNEL_SRC)
10 endif
11
12 export KERNEL_SRC
13 RM ?= rm -f
14 CP := cp -fpR
15 LN := ln -sf
16 DEPMOD := depmod -a
17
18 REVISION= $(shell if [ -d "$(PWD)/.git" ]; then \
19 echo $$(git --git-dir="$(PWD)/.git" describe --always --dirty --match "v*" |sed 's/^v//' 2> /dev/null || echo "[unknown]"); \
20 fi)
21 ifneq ("$(wildcard $(KERNEL_SRC)/include/generated/uapi/linux/suse_version.h)","")
22 VERSION_INCLUDE = -include linux/suse_version.h
23 endif
24
25 NOSTDINC_FLAGS += \
26 -I$(PWD)/include/ \
27 $(CFLAGS) \
28 $(VERSION_INCLUDE) \
29 -include $(PWD)/linux-compat.h \
30 -I$(PWD)/compat-include/
31
32 ifneq ($(REVISION),)
33 NOSTDINC_FLAGS += -DOVPN_DCO_VERSION=\"$(REVISION)\"
34 endif
35
36 ifeq ($(DEBUG),1)
37 NOSTDINC_FLAGS += -DDEBUG=1
38 endif
39
40 obj-y += drivers/net/ovpn-dco/
41 export ovpn-dco-v2-y
42
43 BUILD_FLAGS := \
44 M=$(PWD) \
45 PWD=$(PWD) \
46 REVISION=$(REVISION) \
47 CONFIG_OVPN_DCO_V2=m \
48 INSTALL_MOD_DIR=updates/
49
50 all: config
51 $(MAKE) -C $(KERNEL_SRC) $(BUILD_FLAGS) modules
52
53 clean:
54 $(RM) psk_client
55 $(RM) compat-autoconf.h*
56 $(MAKE) -C $(KERNEL_SRC) $(BUILD_FLAGS) clean
57 $(MAKE) -C tests clean
58
59 install: config
60 $(MAKE) -C $(KERNEL_SRC) $(BUILD_FLAGS) modules_install
61 $(DEPMOD)
62
63 config:
64 $(PWD)/gen-compat-autoconf.sh $(PWD)/compat-autoconf.h
65
66 tests:
67 $(MAKE) -C tests
68
69 .PHONY: all clean install config tests