Commit fe5dd9b2 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 ee8b8f43
......@@ -27,8 +27,22 @@ gitmodules:
@git submodule update
# The user can override, using environment variables, all these three:
FMC_BUS ?= $(shell /bin/pwd)/fmc-bus
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 ?= $(shell /bin/pwd)/zio
export ZIO
......
# FMC_BUS, ZIO, SPEC_SW comes from the upper level
# FMC_BUS, ZIO, SPEC_SW comes from the Makefile
KBUILD_EXTRA_SYMBOLS := \
$(ZIO)/Module.symvers \
$(SPEC_SW)/kernel/Module.symvers \
$(FMC_BUS)/kernel/Module.symvers
$(ZIO_ABS)/Module.symvers \
$(SPEC_SW_ABS)/kernel/Module.symvers \
$(FMC_BUS_ABS)/kernel/Module.symvers
# 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 = -DGIT_VERSION=\"$(GIT_VERSION)\" \
-I$(src) \
-I$(ZIO)/include \
-I$(FMC_BUS)/sdb-lib/ \
-I$(SPEC_SW)/kernel
-I$(ZIO_ABS)/include \
-I$(FMC_BUS_ABS)/sdb-lib/ \
-I$(SPEC_SW_ABS)/kernel
ccflags-$(CONFIG_FMC_TDC_DEBUG) += -DDEBUG
ccflags-$(CONFIG_FMC_TDC_VERBOSE_DEBUG) += -DVERBOSE_DEBUG
......
......@@ -4,20 +4,29 @@ REPO_PARENT=$(shell /bin/pwd)/../..
-include $(REPO_PARENT)/parent_common.mk
LINUX ?= /lib/modules/$(shell uname -r)/build
# FMC_BUS, ZIO, SPEC_SW comes from the upper level
FMC_BUS ?= $(shell pwd)/../fmc-bus
ZIO ?= $(shell pwd)/../zio
SPEC_SW ?= $(shell pwd)/../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) )
GIT_VERSION = $(shell git describe --always --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
modules_install modules:
rm -f fmc-bus-link
ln -s $(FMC_BUS) fmc-bus-link
$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) $@
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) SPEC_SW_ABS=$(SPEC_SW_ABS) $@
rm -f fmc-bus-link
clean:
......
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