Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
FMC DEL 1ns 4cha - Software
Commits
2948417d
Commit
2948417d
authored
May 19, 2020
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bld: improve build
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
90b5c56f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
26 deletions
+60
-26
Kbuild
kernel/Kbuild
+10
-12
Makefile
kernel/Makefile
+41
-14
Makefile
lib/Makefile
+5
-0
Makefile
tools/Makefile
+4
-0
No files found.
kernel/Kbuild
View file @
2948417d
...
...
@@ -2,6 +2,16 @@
KBUILD_EXTRA_SYMBOLS += $(ZIO_EXTRA_SYMBOLS-y)
KBUILD_EXTRA_SYMBOLS += $(FMC_EXTRA_SYMBOLS-y)
ccflags-y += -DVERSION=\"$(VERSION)\"
ccflags-y += -I$(src)
ccflags-y += -I$(ZIO_ABS)/include
ccflags-y += -I$(FMC_ABS)/include
# Extract ZIO minimum compatible version
ccflags-y += -D__ZIO_MIN_MAJOR_VERSION=$(shell echo $(ZIO_VERSION) | cut -d '-' -f 1 | cut -d '.' -f 1 | tr -d 'v'; )
ccflags-y += -D__ZIO_MIN_MINOR_VERSION=$(shell echo $(ZIO_VERSION) | cut -d '-' -f 1 | cut -d '.' -f 2; )
# add versions of supermodule. It is useful when fine-delay-sw is included as sub-module
# of a bigger project that we want to track
ifdef CONFIG_SUPER_REPO
...
...
@@ -14,18 +24,6 @@ SUBMODULE_VERSIONS += MODULE_INFO(version_zio,\"$(ZIO_VERSION)\");
ccflags-y += -DADDITIONAL_VERSIONS="$(SUBMODULE_VERSIONS)"
ccflags-y += \
-I$(ZIO_ABS)/include \
-I$(FMC_ABS)/include \
-I$(src)
ccflags-y += -DVERSION=\"$(VERSION)\"
# Extract ZIO minimum compatible version
ccflags-y += -D__ZIO_MIN_MAJOR_VERSION=$(shell echo $(ZIO_VERSION) | cut -d '-' -f 1 | cut -d '.' -f 1 | tr -d 'v'; )
ccflags-y += -D__ZIO_MIN_MINOR_VERSION=$(shell echo $(ZIO_VERSION) | cut -d '-' -f 1 | cut -d '.' -f 2; )
subdirs-ccflags-y = $(ccflags-y)
obj-m := fmc-fine-delay.o
...
...
kernel/Makefile
View file @
2948417d
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2019 CERN
-include
Makefile.specific
# include parent_common.mk for buildsystem's defines
#
use absolute path for REPO_PARENT
#use absolute path for REPO_PARENT
REPO_PARENT
?=
$(
shell
/bin/pwd
)
/../..
-include
$(REPO_PARENT)/parent_common.mk
LINUX
?=
/lib/modules/
$(
shell
uname
-r
)
/build
FMC
?=
ZIO
?=
../zio
ZIO_ABS
?=
$
(
abspath
$(ZIO)
)
CPPCHECK
?=
cppcheck
DKMS
?=
0
CURDIR
:=
$(
shell
/bin/pwd
)
KVERSION
?=
$(
shell
uname
-r
)
LINUX
?=
/lib/modules/
$(KVERSION)
/build
ifdef
REPO_PARENT
ZIO
?=
$(REPO_PARENT)
/fmc/zio
FMC
?=
$(REPO_PARENT)
/fmc-sw
endif
ifeq
($(DKMS),
1)
# Take last installed version (if installed using RPM it should be OK)
ZIO_VERSION
?=
$(
shell
basename
$(
shell
ls
-d
$(DKMSTREE)
/zio/
*
|
grep
-E
"
\/
[0-9]+
\.
[0-9]+
\.
[0-9]+"
|
sort
-V
|
tail
-n
1
))
ZIO_ABS
?=
$(DKMSTREE)
/zio/
$(ZIO_VERSION)
/source
ZIO_EXTRA_SYMBOLS-y
=
$(DKMSTREE)
/zio/kernel-
$(KVERSION)
-
$(
shell
uname
-p
)
/module/Module.symvers
else
ifndef
ZIO
$(error
"Missing ZIO environment variable"
)
endif
ifndef
FMC
$(error
"Missing FMC environment variable"
)
endif
ZIO_ABS
?=
$
(
abspath
$(ZIO)
)
ZIO_EXTRA_SYMBOLS-y
=
$(ZIO_ABS)
/drivers/zio/Module.symvers
ZIO_VERSION
?=
$(
shell
cd
$(ZIO_ABS)
;
git describe
--always
--dirty
--long
--tags
)
FMC_ABS
?=
$
(
abspath
$(FMC)
)
FMC_EXTRA_SYMBOLS-y
=
$(FMC_ABS)
/drivers/fmc/Module.symvers
GIT_VERSION
=
$(
shell
git describe
--dirty
--long
--tags
)
ZIO_VERSION
?=
$(
shell
cd
$(ZIO_ABS)
;
git describe
--always
--dirty
--long
--tags
)
endif
GIT_VERSION
=
$(
shell
git describe
--always
--dirty
--long
--tags
)
all modules
:
$(MAKE)
-C
$(LINUX)
M
=
$(
shell
/bin/pwd
)
\
ZIO_ABS
=
$(ZIO_ABS)
FMC_ABS
=
$(FMC_ABS)
\
$(MAKE)
-C
$(LINUX)
M
=
$(CURDIR)
ZIO_ABS
=
$(ZIO_ABS)
FMC_ABS
=
$(FMC_ABS)
\
ZIO_EXTRA_SYMBOLS-y
=
$
(
ZIO_EXTRA_SYMBOLS-y
)
\
FMC_EXTRA_SYMBOLS-y
=
$
(
FMC_EXTRA_SYMBOLS-y
)
\
ZIO_VERSION
=
$(ZIO_VERSION)
\
VERSION
=
$(GIT_VERSION)
\
GIT_
VERSION
=
$(GIT_VERSION)
\
modules
install modules_install
:
modules
$(MAKE)
-C
$(LINUX)
M
=
$(
shell
/bin/pwd
)
modules_install
$(MAKE)
-C
$(LINUX)
M
=
$(
CURDIR
)
modules_install
# be able to run the "clean" rule even if $(LINUX) is not valid
clean
:
rm
-rf
*
.o
*
~ .
*
.cmd
*
.ko
*
.mod.c .tmp_versions Module.symvers
\
Module.markers modules.order
cppcheck
:
$(CPPCHECK)
-q
-I
.
-I
$(ZIO_ABS)
/include
-I
$(FMC_BUS_ABS)
/
--enable
=
all
*
.c
*
.h
lib/Makefile
View file @
2948417d
...
...
@@ -36,6 +36,7 @@ CFLAGS += $(EXTRACFLAGS)
LDFLAGS
=
-L
.
-lfdelay
DESTDIR
?=
/usr/local
CPPCHECK
?=
cppcheck
modules all
:
lib
...
...
@@ -69,5 +70,9 @@ install:
modules_install
:
cppcheck
:
$(CPPCHECK)
-q
-I
.
-I
../kernel
-I
$(ZIO_ABS)
/include
--suppress
=
missingIncludeSystem
--enable
=
warning,style,information,missingInclude
*
.c
*
.h
-include
.depend
.PHONY
=
cppcheck
tools/Makefile
View file @
2948417d
...
...
@@ -28,6 +28,8 @@ progs += fmc-fdelay-input
progs
+=
fmc-fdelay-pulse
progs
+=
fmc-fdelay-status
CPPCHECK
?=
cppcheck
# we are not in the kernel, so we need to piggy-back on "make modules"
all modules
:
$(progs) fmc-fdelay-calibration
...
...
@@ -47,3 +49,5 @@ install:
install
-d
$(DESTDIR)
/bin
install
-D
$(progs)
$(DESTDIR)
/bin
cppcheck
:
$(CPPCHECK)
-q
-I
.
-I
../kernel
-I
$(LIBTDC)
--suppress
=
missingIncludeSystem
--enable
=
all
*
.c
*
.h
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