Commit b560be10 authored by Federico Vaga's avatar Federico Vaga

Merge branch '20-rebuild-and-install-for-debian-12' into 'master'

Resolve "Rebuild and install for debian 12"

Closes #20

See merge request be-cem-edl/fec/hardware-modules/spec!10
parents b52a7929 e61abb57
......@@ -2,6 +2,9 @@
#
# SPDX-FileCopyrightText: 2020 CERN
variables:
GIT_DEPTH: 0
include:
- project: 'be-cem-edl/evergreen/gitlab-ci'
ref: master
......@@ -19,17 +22,17 @@ cppcheck:
script:
- make -C software cppcheck
.script_build_kernel_dep: &script_build_kernel_dep
- export FPGA_MGR="/opt/fpga-mgr"
- git clone --depth 1 https://gitlab.cern.ch/fvaga/fpga-manager.git "$FPGA_MGR"
- make -C "$FPGA_MGR" all
flawfinder:
stage: analyse
image:
name: gitlab-registry.cern.ch/coht/common-containers/static-analysis:latest
script:
- make -C software flawfinder
kernel_build_cc7:
extends: .kernel_build_cc7
software_build:
extends: .build_fec_os_sw
variables:
EDL_CI_KBUILD_PATHS: software/kernel
before_script:
- *script_build_kernel_dep
EDL_CI_SW_PATHS: software
kernel_build_validation:
extends: .kernel_build_validation
......
......@@ -2,6 +2,9 @@
#
# SPDX-License-Identifier: LGPL-2.1-or-later
TOPDIR ?= $(shell pwd)
REPO_PARENT ?= $(TOPDIR)/..
HDL_DIR ?= $(TOP_DIR)/hdl
SW_DIR ?= $(TOP_DIR)/software
HDR_DIR ?= $(SW_DIR)/include
......
......@@ -7,9 +7,11 @@ REPO_PARENT ?= $(TOPDIR)/..
-include Makefile.specific
-include $(REPO_PARENT)/parent_common.mk
DIRS = include kernel tools
C_DIRS = kernel tools
.PHONY: all clean modules install modules_install coccicheck cppcheck $(DIRS)
DIRS = $(C_DIRS) include
.PHONY: all flawfinder clean modules install modules_install coccicheck cppcheck $(DIRS)
all install modules_install coccicheck modules: $(DIRS)
......@@ -17,17 +19,15 @@ modules: TARGET = modules
coccicheck: TARGET = coccicheck
install: TARGET = install
modules_install: TARGET = modules_install
clean: TARGET = clean
cppcheck:
$(MAKE) -C tools $@
headers:
$(MAKE) -C include $@
$(C_DIRS): include
$(DIRS): headers
$(DIRS):
$(MAKE) -C $@ $(ENV_VAR) $(TARGET)
clean:
$(MAKE) -C include $@
$(MAKE) -C kernel $@
$(MAKE) -C tools $@
flawfinder:
for d in $(C_DIRS); do $(MAKE) -C $$d $@ || exit 1; done
cppcheck:
$(MAKE) -C tools cppcheck
......@@ -24,10 +24,14 @@ headers: uapi/linux/spec-core-fpga.h
uapi/linux/spec-core-fpga.h:
$(CHEBY) --gen-c -i $(HDL_DIR)/rtl/spec_base_regs.cheby > $@
DESTDIR ?=
prefix ?= /usr/local
includedir ?= $(prefix)/include
install: headers
install -d $(HDRDIR)/linux
install -D uapi/linux/spec.h $(HDRDIR)/linux
install -D uapi/linux/spec-core-fpga.h $(HDRDIR)/linux
mkdir -m 0775 -p $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)/linux
install -D -t $(DESTDIR)$(includedir)/linux -m 0644 uapi/linux/spec.h
install -D -t $(DESTDIR)$(includedir)/linux -m 0644 uapi/linux/spec-core-fpga.h
clean:
rm -f uapi/linux/spec-core-fpga.h
......
......@@ -10,8 +10,6 @@ include $(TOP_DIR)/common.mk
KVERSION ?= $(shell uname -r)
KERNELSRC ?= /lib/modules/$(KVERSION)/build
INSTALL_MOD_PATH ?=
INSTALL_MOD_DIR ?= extra/cern/spec-fmc-carrier
CONFIG_FPGA_MGR_BACKPORT ?= n
......@@ -44,6 +42,7 @@ I2C_ABS ?= $(abspath $(I2C))
SPI_ABS ?= $(abspath $(SPI))
CPPCHECK ?= cppcheck
FLAWFINDER ?= flawfinder
all: modules
......@@ -55,8 +54,10 @@ help coccicheck:
headers:
$(MAKE) -C $(HDR_DIR) $@
modules_install: modules
install: modules_install
modules: headers
modules_install modules: headers
$(MAKE) -C $(KERNELSRC) M=$(shell pwd) \
VERSION=$(GIT_VERSION) \
FPGA_MGR_ABS=$(FPGA_MGR_ABS) \
......@@ -65,19 +66,13 @@ modules: headers
I2C_ABS=$(I2C_ABS) \
SPI_ABS=$(SPI_ABS) \
$@
install: modules_install
modules_install: modules
@$(MAKE) -C $(KERNELSRC) M=$(shell pwd) \
INSTALL_MOD_PATH=$(INSTALL_MOD_PATH) \
INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
$@
clean:
@rm -f spec-core-fpga.h
@$(MAKE) -C $(KERNELSRC) M=$(shell pwd) $@
INCLUDE := -I./
cppcheck:
$(CPPCHECK) -q $(INCLUDE) --suppress=missingIncludeSystem --enable=all *.c *.h --error-exitcode=1
$(CPPCHECK) -q -I. -I$(KERNELSRC) --suppress=missingIncludeSystem --enable=all *.c *.h --error-exitcode=1
flawfinder:
$(FLAWFINDER) -SQDC --error-level=3 .
......@@ -9,12 +9,6 @@
TOP_DIR ?= $(shell pwd)/../..
include $(TOP_DIR)/common.mk
#
# Install variable
#
DESTDIR ?= /usr/local/
BINDIR ?= $(DESTDIR)/bin
TOOLS = spec-firmware-version
#
......@@ -25,6 +19,7 @@ CFLAGS = -ggdb $(INCLUDE) -Wall -Werror $(EXTRACFLAGS)
CFLAGS += -DGIT_VERSION="\"$(GIT_VERSION)\""
CPPCHECK ?= cppcheck
FLAWFINDER ?= flawfinder
all: $(TOOLS)
......@@ -38,11 +33,19 @@ headers:
clean:
rm -f $(TOOLS)
install:
install -d $(BINDIR)
install -D $(TOOLS) $(BINDIR)
DESTDIR ?=
prefix ?= /usr/local
exec_prefix ?= $(prefix)
bindir ?= $(exec_prefix)/bin
install: all
mkdir -m 0775 -p $(DESTDIR)$(bindir)
install -D -t $(DESTDIR)$(bindir) -m 0755 $(TOOLS)
cppcheck:
$(CPPCHECK) -q $(INCLUDE) --suppress=missingIncludeSystem --enable=all *.c *.h --error-exitcode=1
flawfinder:
$(FLAWFINDER) -SQDC --error-level=4 .
.PHONY: cppcheck
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