Commit 2faa5be7 authored by Federico Vaga's avatar Federico Vaga

Merge branch '9-use-fec-build-sw-to-build-fmc' into 'master'

Resolve "Use fec-build-sw to build FMC"

Closes #9

See merge request be-cem-edl/fec/hardware-modules/fmc!4
parents 2893d1a5 f822c365
Pipeline #4832 failed
......@@ -17,6 +17,13 @@ cppcheck:
script:
- make cppcheck
flawfinder:
stage: analyse
image:
name: gitlab-registry.cern.ch/coht/common-containers/static-analysis:latest
script:
- make flawfinder
documentation:
stage: build
image:
......@@ -29,40 +36,10 @@ documentation:
paths:
- $EDL_CI_EOS_OUTPUT_DIR
build-centos-7:
stage: build
kernel_build_cc7:
extends: .kernel_build_cc7
variables:
KERNELSRC: /usr/src/kernels/*/
image:
name: gitlab-registry.cern.ch/coht/common-containers/build-centos-7:latest
script:
- make modules
EDL_CI_KBUILD_PATHS: drivers/fmc
build-kernel:
stage: build
allow_failure: true
image:
name: gitlab-registry.cern.ch/coht/common-containers/build-kernel:latest
parallel:
matrix:
- VERSION: [5.10.149, 5.15.74]
script:
- source /linux-versions.sh
- fetch $VERSION && prepare $VERSION && export LINUX=$(linux $VERSION) && export KERNELSRC=$(linux $VERSION)
- make modules
build_dkms_rpm:
stage: release
script:
- yum install -y dkms
- make -C distribution dkms-rpm
build_srpm:
stage: release
script:
- yum-builddep -y ${DIST_PATH}/*.spec
- KERNELSRC=/usr/src/kernels/*/ make -C distribution srpm
artifacts:
paths:
- distribution/build/SRPMS/${CI_PROJECT_NAME}*src.rpm
expire_in: 1 day
kernel_build_validation:
extends: .kernel_build_validation
# SPDX-License-Identifier: CC0-1.0
#
# SPDX-FileCopyrightText: 2019 CERN
C_DIRS = \
tools \
drivers/fmc
all: modules tools
DIRS = $(C_DIRS) \
Documentation/fmc
tools:
@$(MAKE) -C tools all
all clean cleanall install: $(DIRS)
modules modules_install:
@$(MAKE) -C drivers/fmc/ $@
sources srpm:
@$(MAKE) -C distribution $@
flawfinder cppcheck:
for d in $(C_DIRS); do $(MAKE) -C $$d $@ || exit 1; done
clean:
@$(MAKE) -C distribution $@
@$(MAKE) -C drivers/fmc/ $@
@$(MAKE) -C tools $@
cppcheck:
@$(MAKE) -C tools $@
.PHONY: sources srpm modules modules_install clean all cppcheck tools
.PHONY: modules modules_install clean all cppcheck flawfinder $(DIRS)
......@@ -83,7 +83,7 @@ ifeq ($(KEEP_TEMP), n)
@rm -f $(RPM_SPEC)
endif
clean:
clean cleanall:
@rm -rf $(BUILD) $(SOURCES) *.tar.gz $(RPM_SPEC)
.PHONY: sources sources-tar sources-build
......
......@@ -12,9 +12,22 @@ KERNELSRC ?= /lib/modules/$(shell uname -r)/build
export CONFIG_FMC=m
CPPCHECK ?= cppcheck
FLAWFINDER ?= flawfinder
all: modules
clean modules help modules_install coccicheck:
make -C $(KERNELSRC) M=$(shell pwd) $@
.PHONY: all modules clean help install modules_install
cleanall: clean
install: modules_install
cppcheck:
$(CPPCHECK) -q -I. -I$(KERNELSRC)/include --enable=all *.c *.h
flawfinder:
$(FLAWFINDER) -SQDC --error-level=5 .
.PHONY: all modules clean help install modules_install cppcheck flawfinder
......@@ -22,6 +22,7 @@ LDFLAGS = -L$(LIB)
LDLIBS = -lfmc
CPPCHECK ?= cppcheck
FLAWFINDER ?= flawfinder
all: $(TOOLS)
......@@ -31,7 +32,7 @@ $(TOOLS): $(COMMON_SRCS:.c=.o) $(LIB)/libfmc.a
$(LIB)/libfmc.a:
@$(MAKE) -C $(shell dirname $@)
clean:
clean cleanall:
@$(MAKE) -C $(LIB) $@
rm -f $(TOOLS)
......@@ -43,4 +44,7 @@ cppcheck:
@$(MAKE) -C $(LIB) $@
$(CPPCHECK) -q -I. -I$(LIB) --suppress=missingIncludeSystem --enable=all *.c *.h --error-exitcode=1
.PHONY=cppcheck
flawfinder:
$(FLAWFINDER) -SQDC --error-level=6 .
.PHONY: cppcheck clean cleanall install all
......@@ -23,7 +23,9 @@ CFLAGS += -DGIT_VERSION="\"$(GIT_VERSION)\""
CFLAGS += $(EXTRACFLAGS)
DESTDIR ?= /usr/local
CPPCHECK ?= cppcheck
FLAWFINDER ?= flawfinder
all: lib
......@@ -38,7 +40,7 @@ $(LIB): $(LOBJ)
$(LIBS_XYZ): $(LIB)
$(CC) -shared -o $@ -Wl,--whole-archive,-soname,$@ $^ -Wl,--no-whole-archive
clean:
clean cleanall:
rm -f $(LIB) $(LIBS_XYZ) .depend *.o *~
.depend: Makefile $(wildcard *.c *.h ../*.h)
......@@ -61,4 +63,10 @@ cppcheck:
-include .depend
.PHONY=cppcheck
cppcheck:
$(CPPCHECK) -q -I. --enable=all *.c *.h
flawfinder:
$(FLAWFINDER) -SQDC --error-level=6 .
.PHONY: cppcheck all lib clean clanall install modules_install flawfinder
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