Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Network Interface Card
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Network Interface Card
Commits
b53f3835
Commit
b53f3835
authored
Apr 04, 2019
by
Miguel Jimenez Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: Update Makefile and create Kbuild for kernel compilation.
parent
e51e1d42
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
25 deletions
+53
-25
Kbuild
sw/kernel/Kbuild
+34
-0
Makefile
sw/kernel/Makefile
+19
-25
No files found.
sw/kernel/Kbuild
0 → 100644
View file @
b53f3835
KBUILD_EXTRA_SYMBOLS := $(FMC_BUS_ABS)/kernel/Module.symvers
# add versions of supermodule. It is useful when spec-sw is included as sub-module
# of a bigger project that we want to track
ifdef CONFIG_SUPER_REPO
ifdef CONFIG_SUPER_REPO_VERSION
SUBMODULE_VERSIONS += MODULE_INFO(version_$(CONFIG_SUPER_REPO),\"$(CONFIG_SUPER_REPO_VERSION)\");
endif
endif
# add versions of used submodules
SUBMODULE_VERSIONS += MODULE_INFO(version_fmc_bus,\"$(FMC_BUS_VERSION)\");
ccflags-y += -DADDITIONAL_VERSIONS="$(SUBMODULE_VERSIONS)"
# The library includes <sdb.h>, so point -I directtly there
# include our header before to avoid conflicts with the kernel
LINUXINCLUDE := -I$(FMC_BUS_ABS)/kernel/include -I$(src)/include/linux $(LINUXINCLUDE)
ccflags-y += -I$(src)/include
ccflags-y += $(WR_NIC_CFLAGS)
ccflags-y += -DGIT_VERSION=\"$(GIT_VERSION)\"
# FIXME: Node or switch?
ccflags-y += -DWR_NODE
#ccflags-y += -DWR_SWITCH
obj-m += wr-nic.o
wr-nic-y = module.o
wr-nic-y += device.o
wr-nic-y += nic-core.o
wr-nic-y += endpoint.o
wr-nic-y += ethtool.o
wr-nic-y += pps.o
wr-nic-y += timestamp.o
sw/kernel/Makefile
View file @
b53f3835
# This Makefile is meant to be used by the wr-switch. When built for wr-node
# the relevant Makefile lived in the parent directory.
# include parent_common.mk for buildsystem's defines
#use absolute path for REPO_PARENT
REPO_PARENT
=
$(
shell
/bin/pwd
)
/../..
-include
$(REPO_PARENT)/parent_common.mk
ccflags-y
+=
-DWR_SWITCH
LINUX
?=
/lib/modules/
$(
shell
uname
-r
)
/build
obj-m
:=
wr-nic.o
wr-nic-objs
:=
module.o device.o nic-core.o endpoint.o ethtool.o
\
pps.o timestamp.o
# by default use the fmc-bus within the repository
FMC_BUS
?=
../fmc-bus/
# FMC_BUS_ABS has to be absolut path, due to beeing passed to the Kbuild
FMC_BUS_ABS
?=
$
(
abspath
$(FMC_BUS)
)
# accept WRN_DEBUG from the environment. It turns pr_debug() into printk.
ifdef
WRN_DEBUG
ccflags-y
+=
-DDEBUG
endif
GIT_VERSION
?=
$(
shell
git describe
--dirty
--long
--tags
)
export
GIT_VERSION
ccflags-y
+=
-I
$(src)
/../wr_pstats
# What follows is standard stuff
export
ARCH
?=
arm
export
CROSS_COMPILE
?=
$(CROSS_COMPILE_ARM)
FMC_BUS_VERSION
?=
$(
shell
cd
$(FMC_BUS_ABS)
;
git describe
--always
--dirty
--long
--tags
)
export
FMC_BUS_VERSION
all modules
:
$(MAKE)
CONFIG_DEBUG_SECTION_MISMATCH
=
y
\
-C
$(LINUX)
SUBDIRS
=
$(
shell
/bin/pwd
)
modules
$(MAKE)
-C
$(LINUX)
M
=
$(
shell
/bin/pwd
)
FMC_BUS_ABS
=
$(FMC_BUS_ABS)
modules
# looking at preprocessed output is helpful for bug hunting
preprocess
:
$(MAKE)
CONFIG_DEBUG_SECTION_MISMATCH
=
y
\
-C
$(LINUX)
SUBDIRS
=
$(
shell
/bin/pwd
)
$
(
wr-nic-objs:.o
=
.i
)
install modules_install
:
$(MAKE)
-C
$(LINUX)
M
=
$(
shell
/bin/pwd
)
modules_install
# We might "$(MAKE) -C $(LINUX)" but "make clean" with no LINUX defined
# is sometimes useful to have
# be able to run the "clean" rule even if $(LINUX) is not valid
clean
:
rm
-
f
*
.mod.c
*
.o
*
.ko
*
.i .
*
cmd Module.symvers modules.order
*
~
rm
-rf
.tmp_versions
rm
-
rf
*
.o
*
~ .
*
.cmd
*
.ko
*
.mod.c .tmp_versions Module.symvers
\
Module.markers modules.order
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment