-
Notifications
You must be signed in to change notification settings - Fork 168
/
Copy pathMakefile.in
46 lines (39 loc) · 1.49 KB
/
Makefile.in
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
# SPDX-License-Identifier: GPL-2.0-only OR MIT
#
# Copyright (C) 2023 The Falco Authors.
#
# This file is dual licensed under either the MIT or GPL 2. See
# MIT.txt or GPL.txt for full copies of the license.
#
@DRIVER_NAME@-y += main.o dynamic_params_table.o fillers_table.o flags_table.o ppm_events.o ppm_fillers.o event_table.o syscall_table64.o ppm_cputime.o ppm_tp.o syscall_ia32_64_map.o
obj-m += @[email protected]
ccflags-y := @KBUILD_FLAGS@
ifeq ($(strip $(MAKEFILE_LIST)),Makefile)
#
# If MAKEFILE_LIST is just "Makefile", it means `make` was invoked pointing to
# this Makefile. Targets don't make any sense if the Makefile was included.
#
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
TOP := $(shell pwd)
all:
$(MAKE) -C $(KERNELDIR) M=$(TOP) modules
clean:
$(MAKE) -C $(KERNELDIR) M=$(TOP) clean
install: all
$(MAKE) -C $(KERNELDIR) M=$(TOP) modules_install
else
KERNELDIR ?= $(CURDIR)
#
# Get the path of the module sources
#
FIRST_MAKEFILE := $(firstword $(MAKEFILE_LIST))
FIRST_MAKEFILE_FILENAME := $(notdir $(FIRST_MAKEFILE))
FIRST_MAKEFILE_DIRNAME := $(shell basename $(dir $(FIRST_MAKEFILE)))
ifeq ($(FIRST_MAKEFILE_DIRNAME)/$(FIRST_MAKEFILE_FILENAME), scripts/Makefile.build)
# Build phase
MODULE_MAKEFILE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
MAKEFILE_INC_FILES := $(shell find $(MODULE_MAKEFILE_DIR)/configure -type f -name Makefile.inc)
$(info [configure-kmod] Including $(MAKEFILE_INC_FILES))
include $(MAKEFILE_INC_FILES)
endif
endif # $(strip $(MAKEFILE_LIST)),Makefile