Commit bd9ee169 authored by Adam Wujek's avatar Adam Wujek 💬

always use absolute paths for submodules in Makefiles

It is not trivial to handle passing relative and absolute paths
between Makefiles.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 5f323811
......@@ -3,11 +3,27 @@
REPO_PARENT=$(shell /bin/pwd)/..
-include $(REPO_PARENT)/parent_common.mk
FMC_BUS := $(shell scripts/check-submodule fmc-bus $(FMC_BUS))
ZIO := $(shell scripts/check-submodule zio $(ZIO))
# The user can override, using environment variables, all these three:
FMC_BUS ?= $(shell pwd)/fmc-bus
ZIO ?= $(shell pwd)/zio
SPEC_SW ?= $(shell pwd)/spec-sw
export FMC_BUS
export ZIO
export SPEC_SW
# FMC_BUS_ABS, ZIO_ABS and SPEC_SW_ABS has to be absolut path, due to beeing
# passed to the Kbuild
FMC_BUS_ABS ?= $(abspath $(FMC_BUS) )
ZIO_ABS ?= $(abspath $(ZIO) )
SPEC_SW_ABS ?= $(abspath $(SPEC_SW) )
export FMC_BUS_ABS
export ZIO_ABS
export SPEC_SW_ABS
ZIO_VERSION = $(shell cd $(ZIO); git describe --always --dirty --long --tags)
export ZIO_VERSION
SPEC_SW := $(shell scripts/check-submodule spec-sw $(SPEC_SW))
DESTDIR ?= /usr/local
......
KBUILD_EXTRA_SYMBOLS := \
$(ZIO)/Module.symvers \
$(FMC_BUS)/kernel/Module.symvers
$(ZIO_ABS)/Module.symvers \
$(FMC_BUS_ABS)/kernel/Module.symvers
# For this CSM_VERSION, please see ohwr.org/csm documentation
ifdef CONFIG_CSM_VERSION
......@@ -11,11 +11,11 @@ else
endif
# The library includes <sdb.h>, so point -I directtly there
# include our header before to avoid conflicts with the kernel
LINUXINCLUDE := -I$(FMC_BUS)/kernel/include -I$(FMC_BUS)/kernel/include/linux $(LINUXINCLUDE)
LINUXINCLUDE := -I$(FMC_BUS_ABS)/kernel/include -I$(FMC_BUS_ABS)/kernel/include/linux $(LINUXINCLUDE)
ccflags-y += \
-I$(ZIO)/include \
-I$(FMC_BUS) \
-I$(ZIO_ABS)/include \
-I$(FMC_BUS_ABS) \
-I$(src)
ccflags-y += -DGIT_VERSION=\"$(GIT_VERSION)\"
......
......@@ -5,19 +5,24 @@ REPO_PARENT=$(shell /bin/pwd)/../..
LINUX ?= /lib/modules/$(shell uname -r)/build
ZIO ?= $(src)/../zio
FMC_BUS ?= $(src)/../fmc-bus
FMC_BUS ?= $(shell pwd)/../fmc-bus
ZIO ?= $(shell pwd)/../zio
# FMC_BUS_ABS, ZIO_ABS and SPEC_SW_ABS has to be absolut path, due to beeing
# passed to the Kbuild
FMC_BUS_ABS ?= $(abspath $(FMC_BUS) )
ZIO_ABS ?= $(abspath $(ZIO) )
GIT_VERSION = $(shell git describe --dirty --long --tags)
export GIT_VERSION
ZIO_VERSION = $(shell cd $(ZIO); git describe --always --dirty --long --tags)
ZIO_VERSION = $(shell cd $(ZIO_ABS); git describe --always --dirty --long --tags)
export ZIO_VERSION
all modules:
rm -f fmc-bus-link
ln -s $(FMC_BUS) fmc-bus-link
$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) modules
ln -s $(FMC_BUS_ABS) fmc-bus-link
$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) FMC_BUS_ABS=$(FMC_BUS_ABS) ZIO_ABS=$(ZIO_ABS) modules
rm -f fmc-bus-link
install modules_install: modules
......
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