forked from Microsemi/switchtec-kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (33 loc) · 955 Bytes
/
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
#
# By default, the build is done against the running linux kernel source.
# To build against a different kernel source tree, set KDIR:
#
# make KDIR=/path/to/kernel/source
ifdef KDIR
KERNEL_SOURCES = $(KDIR)
else
KERNEL_UNAME := $(shell uname -r)
KERNEL_SOURCES = /lib/modules/$(KERNEL_UNAME)/build
endif
default: modules
.PHONY: default
install: modules_install
.PHONY: install
version.h: FORCE $(OBJDIR)
@$(SHELL_PATH) ./VERSION-GEN
modules: | version.h
%::
$(MAKE) -C $(KERNEL_SOURCES) M=$$PWD $@
pahole64: pahole.c linux/switchtec_ioctl.h
gcc -O0 -g -I. $< -o $@
pahole32: pahole.c linux/switchtec_ioctl.h
gcc -O0 -g -I. $< -o $@ -m32
pahole: pahole64 pahole32
pahole pahole32 > pahole32.txt
pahole pahole64 > pahole64.txt
@cmp pahole32.txt pahole64.txt && echo "Arches Match" || \
echo "!!Arches don't match!!"
clean::
rm -f pahole32 pahole64 pahole*.txt version.h
$(MAKE) -C $(KERNEL_SOURCES) M=$$PWD $@
.PHONY: FORCE