blob: 68c34c2b2941d74692e74dbd5655cb07a377e13a (
plain)
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
# -*- mode: Makefile; -*-
#============================================================================
#
# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free software Foundation, Inc.,
# 59 Temple Place, suite 330, Boston, MA 02111-1307 USA
#============================================================================
#============================================================================
# Vnet module makefile for 2.4 series kernels.
LINUX_SERIES ?=2.4
include Makefile.ver
KERNEL_MODULE := vnet_module.o
CONFIG_MODVERSIONS := $(shell grep 'CONFIG_MODVERSIONS=y' $(KERNEL_SRC)/.config && echo 1 || echo 0)
include Makefile.vnet
VNET_OBJ += $(VNET_LIB_OBJ)
#----------------------------------------------------------------------------
vpath %.h $(KERNEL_SRC)/include
INCLUDES+= -I $(KERNEL_SRC)/include
vpath %.h $(LIB_DIR)
vpath %.c $(LIB_DIR)
INCLUDES += -I $(LIB_DIR)
INCLUDES+= -I .
#----------------------------------------------------------------------------
CPPFLAGS += -D__KERNEL__
CPPFLAGS += -DMODULE
ifeq ($(CONFIG_MODVERSIONS), 1)
CPPFLAGS += -DMODVERSIONS
CPPFLAGS += -include $(KERNEL_SRC)/include/linux/modversions.h
endif
CPPFLAGS += $(INCLUDES)
CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes
CFLAGS += -Wno-trigraphs
CFLAGS += -Wno-unused-function
CFLAGS += -Wno-unused-parameter
CFLAGS += -g
CFLAGS += -O2
CFLAGS += -fno-strict-aliasing
CFLAGS += -fno-common
#CFLAGS += -fomit-frame-pointer
# Dependencies. Gcc generates them for us.
CFLAGS += -Wp,-MD,.$(@F).d
VNET_DEP = .*.d
#----------------------------------------------------------------------------
.PHONY: all
all: module
.PHONY: module modules
module modules: $(KERNEL_MODULE)
$(KERNEL_MODULE): $(VNET_OBJ)
$(LD) -r -o $@ $^
.PHONY: install install-module modules_install
install install-module modules_install: module
install -m 0755 -d $(DESTDIR)$(KERNEL_MODULE_DIR)
install -m 0554 $(KERNEL_MODULE) $(DESTDIR)$(KERNEL_MODULE_DIR)
TAGS:
etags *.c *.h
.PHONY: clean
clean:
@rm -f *.a *.o *.ko *~
@rm -f $(VNET_DEP) .*.cmd *.mod.?
@rm -rf .tmp_versions
-include $(VNET_DEP)
|