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

use absolute paths in Makefiles

Use _ABS in Makefiles wherever possible.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 85f07dab
......@@ -10,13 +10,9 @@ CONFIG_WR_NIC=n
export CONFIG_WR_NIC
# 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 ?= fmc-bus
ZIO ?= zio
SPEC_SW ?= spec-sw
# FMC_BUS_ABS, ZIO_ABS and SPEC_SW_ABS has to be absolut path, due to beeing
# passed to the Kbuild
......@@ -28,15 +24,15 @@ export FMC_BUS_ABS
export ZIO_ABS
export SPEC_SW_ABS
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
DIRS = $(FMC_BUS) $(ZIO) $(SPEC_SW) kernel lib tools
DIRS = $(FMC_BUS_ABS) $(ZIO_ABS) $(SPEC_SW_ABS) kernel lib tools
$(SPEC_SW): $(FMC_BUS)
kernel: $(FMC_BUS) $(ZIO) $(SPEC_SW)
lib: $(ZIO)
$(SPEC_SW_ABS): $(FMC_BUS_ABS)
kernel: $(FMC_BUS_ABS) $(ZIO_ABS) $(SPEC_SW_ABS)
lib: $(ZIO_ABS)
tools: lib
DESTDIR ?= /usr/local
......@@ -58,7 +54,7 @@ $(DIRS):
$(MAKE) -C $@ $(TARGET)
SUBMOD = $(FMC_BUS) $(ZIO) $(SPEC_SW)
SUBMOD = $(FMC_BUS_ABS) $(ZIO_ABS) $(SPEC_SW_ABS)
prereq_install_warn:
@test -f .prereq_installed || \
......@@ -68,21 +64,21 @@ prereq_install:
for d in $(SUBMOD); do $(MAKE) -C $$d modules_install || exit 1; done
touch .prereq_installed
$(FMC_BUS): fmc-bus-init_repo
$(ZIO): zio-init_repo
$(SPEC_SW): spec-sw-init_repo
$(FMC_BUS_ABS): fmc-bus-init_repo
$(ZIO_ABS): zio-init_repo
$(SPEC_SW_ABS): spec-sw-init_repo
# init submodule if missing
fmc-bus-init_repo:
@test -d $(FMC_BUS)/doc || ( echo "Checking out submodule $(FMC_BUS)"; git submodule update --init $(FMC_BUS) )
@test -d $(FMC_BUS_ABS)/doc || ( echo "Checking out submodule $(FMC_BUS_ABS)"; git submodule update --init $(FMC_BUS_ABS) )
# init submodule if missing
zio-init_repo:
@test -d $(ZIO)/doc || ( echo "Checking out submodule $(ZIO)" && git submodule update --init $(ZIO) )
@test -d $(ZIO_ABS)/doc || ( echo "Checking out submodule $(ZIO_ABS)" && git submodule update --init $(ZIO_ABS) )
# init submodule if missing
spec-sw-init_repo:
@test -d $(SPEC_SW)/doc || ( echo "Checking out submodule $(SPEC_SW)" && git submodule update --init $(SPEC_SW) )
@test -d $(SPEC_SW_ABS)/doc || ( echo "Checking out submodule $(SPEC_SW_ABS)" && git submodule update --init $(SPEC_SW_ABS) )
include scripts/gateware.mk
......@@ -5,8 +5,8 @@ REPO_PARENT=$(shell /bin/pwd)/../..
LINUX ?= /lib/modules/$(shell uname -r)/build
FMC_BUS ?= $(shell pwd)/../fmc-bus
ZIO ?= $(shell pwd)/../zio
FMC_BUS ?= ../fmc-bus
ZIO ?= ../zio
# FMC_BUS_ABS, ZIO_ABS and SPEC_SW_ABS has to be absolut path, due to beeing
# passed to the Kbuild
......
......@@ -9,7 +9,9 @@
REPO_PARENT=../..
-include $(REPO_PARENT)/parent_common.mk
ZIO ?= ../zio
ZIO_ABS ?= $(abspath $(ZIO) )
LIB = libfdelay.a
LOBJ := fdelay-init.o
......@@ -17,7 +19,7 @@ LOBJ += fdelay-time.o
LOBJ += fdelay-tdc.o
LOBJ += fdelay-output.o
CFLAGS = -Wall -ggdb -O2 -I../kernel -I$(ZIO)/include $(EXTRACFLAGS)
CFLAGS = -Wall -ggdb -O2 -I../kernel -I$(ZIO_ABS)/include $(EXTRACFLAGS)
LDFLAGS = -L. -lfdelay
DESTDIR ?= /usr/local
......
......@@ -9,11 +9,14 @@
REPO_PARENT=../..
-include $(REPO_PARENT)/fmc_common.mk
ZIO ?= ../zio
ZIO_ABS ?= $(abspath $(ZIO) )
M = $(shell /bin/pwd)/../kernel
DESTDIR ?= /usr/local
CFLAGS += -I$(M) -I../lib -I$(ZIO)/include -Wno-trigraphs -Wall -ggdb $(EXTRACFLAGS)
CFLAGS += -I$(M) -I../lib -I$(ZIO_ABS)/include -Wno-trigraphs -Wall -ggdb $(EXTRACFLAGS)
LDFLAGS = -L../lib
LDLIBS = -lfdelay
......
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