-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile.in
72 lines (56 loc) · 1.75 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
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
# Makefile
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
srcdir = @srcdir@
abs_srcdir = @abs_srcdir@
abs_builddir = @abs_builddir@
prefix = @prefix@
exec_prefix = @exec_prefix@
sbindir = @sbindir@
includedir = @includedir@
KERNEL_DIR = @KERNEL_DIR@
KERNEL_VERSION = @KERNEL_VERSION@
@SET_MAKE@
SHELL = @SHELL@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_MODULE = $(INSTALL_DATA)
INSTALL_HEADER = $(INSTALL_DATA)
MKDIR_P = @MKDIR_P@
CC = @CC@
CPPFLAGS = @CPPFLAGS@
CFLAGS = @CFLAGS@ @DEFS@ -I"$(abs_srcdir)" -Wall
KERNEL_CFLAGS := -DNF_TBF_VERSION='\"$(PACKAGE_VERSION)\"'
KERNEL_CFLAGS := $(KERNEL_CFLAGS) -I"$(abs_srcdir)" -Wall
.PHONY: all
all: modules utils
.PHONY: modules
modules: $(srcdir)/nf_tbf.c
make -C $(KERNEL_DIR) M="$(abs_builddir)" V=1 \
EXTRA_CFLAGS="$(KERNEL_CFLAGS)" modules
nf_tbf_ctl.o: $(srcdir)/nf_tbf_ctl.c $(srcdir)/nf_tbf.h
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
nf_tbf_ctl: nf_tbf_ctl.o
$(CC) $(LDFLAGS) -o $@ $<
.PHONY: utils
utils: nf_tbf_ctl
.PHONY: install-modules
install-modules: modules
$(MKDIR_P) "$(DESTDIR)/lib/modules/$(KERNEL_VERSION)/extra"
$(INSTALL_MODULE) nf_tbf.ko \
"$(DESTDIR)/lib/modules/$(KERNEL_VERSION)/extra/nf_tbf.ko"
.PHONY: install-utils
install-utils: utils
$(MKDIR_P) "$(DESTDIR)$(sbindir)"
$(INSTALL_PROGRAM) nf_tbf_ctl "$(DESTDIR)$(sbindir)/nf_tbf_ctl"
.PHONY: install-headers
install-headers: $(srcdir)/nf_tbf.h
$(MKDIR_P) "$(DESTDIR)$(includedir)"
$(INSTALL_HEADER) "$(srcdir)/nf_tbf.h" "$(DESTDIR)$(includedir)/nf_tbf.h"
.PHONY: install
install: install-modules install-utils install-headers
.PHONY: clean
clean:
$(MAKE) -C $(KERNEL_DIR) M="$(abs_builddir)" clean
rm -f nf_tbf_ctl.o nf_tbf_ctl Module.markers Module.symvers