Commit 3bce9901 authored by Adam Wujek's avatar Adam Wujek 💬

kernel: always use absolute path of fmc-bus

FMC_BUS_ABS is passed to Kbuild, which uses different current directory.
It is not trivial to handle FMC_BUS to be absolute or relative path.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent ed6f65c1
...@@ -6,6 +6,9 @@ REPO_PARENT=$(shell /bin/pwd)/.. ...@@ -6,6 +6,9 @@ REPO_PARENT=$(shell /bin/pwd)/..
# by default use the fmc-bus within the repository # by default use the fmc-bus within the repository
FMC_BUS ?= $(shell pwd)/fmc-bus/ FMC_BUS ?= $(shell pwd)/fmc-bus/
export FMC_BUS export FMC_BUS
# FMC_BUS_ABS has to be absolut path, due to beeing passed to the Kbuild
FMC_BUS_ABS ?= $(abspath $(FMC_BUS) )
export FMC_BUS_ABS
RUNME := $(shell test -d $(FMC_DRV) || git submodule update --init) RUNME := $(shell test -d $(FMC_DRV) || git submodule update --init)
......
KBUILD_EXTRA_SYMBOLS := $(FMC_BUS)/kernel/Module.symvers KBUILD_EXTRA_SYMBOLS := $(FMC_BUS_ABS)/kernel/Module.symvers
# For this CSM_VERSION, please see ohwr.org/csm documentation # For this CSM_VERSION, please see ohwr.org/csm documentation
ifdef CONFIG_CSM_VERSION ifdef CONFIG_CSM_VERSION
...@@ -9,7 +9,7 @@ endif ...@@ -9,7 +9,7 @@ endif
# The library includes <sdb.h>, so point -I directtly there # The library includes <sdb.h>, so point -I directtly there
# include our header before to avoid conflicts with the kernel # include our header before to avoid conflicts with the kernel
LINUXINCLUDE := -I$(FMC_BUS)/kernel/include -I$(src)/include/linux $(LINUXINCLUDE) LINUXINCLUDE := -I$(FMC_BUS_ABS)/kernel/include -I$(src)/include/linux $(LINUXINCLUDE)
ccflags-y += -I$(src)/include ccflags-y += -I$(src)/include
ccflags-y += $(WR_NIC_CFLAGS) ccflags-y += $(WR_NIC_CFLAGS)
ccflags-y += -DGIT_VERSION=\"$(GIT_VERSION)\" ccflags-y += -DGIT_VERSION=\"$(GIT_VERSION)\"
......
...@@ -7,16 +7,14 @@ LINUX ?= /lib/modules/$(shell uname -r)/build ...@@ -7,16 +7,14 @@ LINUX ?= /lib/modules/$(shell uname -r)/build
# by default use the fmc-bus within the repository # by default use the fmc-bus within the repository
FMC_BUS ?= $(shell pwd)/../fmc-bus/ FMC_BUS ?= $(shell pwd)/../fmc-bus/
# FMC_DRV has to be absolut path, due to beeing passed to the Kbuild # FMC_BUS_ABS has to be absolut path, due to beeing passed to the Kbuild
FMC_DRV = $(shell realpath -f $(FMC_DRV) ) FMC_BUS_ABS ?= $(abspath $(FMC_BUS) )
export FMC_BUS
GIT_VERSION = $(shell git describe --dirty --long --tags) GIT_VERSION = $(shell git describe --dirty --long --tags)
export GIT_VERSION export GIT_VERSION
all modules: all modules:
$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) modules $(MAKE) -C $(LINUX) M=$(shell /bin/pwd) FMC_BUS_ABS=$(FMC_BUS_ABS) modules
install modules_install: install modules_install:
$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) modules_install $(MAKE) -C $(LINUX) M=$(shell /bin/pwd) modules_install
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment