Commit e3cb1806 authored by Federico Vaga's avatar Federico Vaga

Merge branch '44-use-new-container-to-build-all-softwares-in-ci-cd' into 'master'

Resolve "Use new container to build all softwares in CI/CD"

Closes #44

See merge request be-cem-edl/fec/hardware-modules/fmc-tdc-1ns-5cha!23
parents 1d143b4e 68a62356
......@@ -28,10 +28,10 @@ flawfinder:
script:
- make -C software/tools flawfinder
kernel_build_cc7:
extends: .kernel_build_cc7
software_build:
extends: .build_fec_os_sw
variables:
EDL_CI_KBUILD_PATHS: software/kernel
EDL_CI_SW_PATHS: software
kernel_build_validation:
extends: .kernel_build_validation
......
......@@ -4,7 +4,8 @@
# include parent_common.mk for buildsystem's defines
# use absolute path for REPO_PARENT
REPO_PARENT ?= $(shell /bin/pwd)/../../
TOPDIR ?= $(pwd)/..
REPO_PARENT ?= $(TOPDIR)/..
-include $(REPO_PARENT)/parent_common.mk
all: kernel lib tools
......@@ -16,8 +17,6 @@ kernel:
lib:
tools: lib
DESTDIR ?= /usr/local
.PHONY: all clean cppcheck flawfinder modules install modules_install $(DIRS)
install modules_install:
......
......@@ -66,7 +66,7 @@ tdc_buffer_control_regs.h: $(TDC_HDL)/rtl/wbgen/tdc_buffer_control_regs.wb
timestamp_fifo_regs.h: $(TDC_HDL)/rtl/wbgen/timestamp_fifo_wb.wb
$(WBGEN2) -s defines -C hw/$@ $<
modules: hw_headers
modules modules_install: hw_headers
$(MAKE) -C $(KERNELSRC) 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) \
......@@ -74,8 +74,7 @@ modules: hw_headers
GIT_VERSION=$(GIT_VERSION) \
$@
install modules_install: modules
$(MAKE) -C $(KERNELSRC) M=$(CURDIR) modules_install
install : modules modules_install
# be able to run the "clean" rule even if $(KERNELSRC) is not valid
clean:
......
......@@ -11,7 +11,8 @@
# include parent_common.mk for buildsystem's defines
IGNORE_CPU_SUFFIX := y
REPO_PARENT ?=$(shell pwd)/../../../
TOPDIR ?= $(shell pwd)/../..
REPO_PARENT ?=$(TOPDIR)/..
-include $(REPO_PARENT)/parent_common.mk
ifdef REPO_PARENT
......@@ -41,13 +42,12 @@ CFLAGS += -fPIC
CFLAGS += -DGIT_VERSION="\"$(GIT_VERSION)\""
CFLAGS += -DZIO_GIT_VERSION="\"$(ZIO_GIT_VERSION)\""
CFLAGS += $(EXTRACFLAGS)
DESTDIR ?= /usr/local
CPPCHECK ?= cppcheck
FLAWFINDER ?= flawfinder
modules all: lib
lib: $(LIB) $(LIBS_XYZ)
lib: $(LIB) $(LIBS) $(LIBS_XYZ)
%: %.c $(LIB)
$(CC) $(CFLAGS) $*.c $(LDFLAGS) -o $@
......@@ -56,7 +56,10 @@ $(LIB): $(LOBJ)
$(AR) r $@ $^
$(LIBS_XYZ): $(LIB)
$(CC) -shared -o $@ -Wl,--whole-archive,-soname,$@ $^ -Wl,--no-whole-archive
$(CC) -shared -o $@ -Wl,--whole-archive,-soname,$(LIBS).$(SO_VERSION_X) $^ -Wl,--no-whole-archive
$(LIBS): $(LIBS_XYZ)
ln -sf $< $@
clean:
rm -f $(LIB) $(LIBS_XYZ) .depend *.o *~
......@@ -64,15 +67,18 @@ clean:
.depend: Makefile $(wildcard *.c *.h ../*.h)
$(CC) $(CFLAGS) -M $(LOBJ:.o=.c) -o $@
install:
install -d $(DESTDIR)/lib
install -d $(DESTDIR)/include/fmc-tdc
install -m 644 -D $(LIB) $(DESTDIR)/lib
install -m 0755 $(LIBS_XYZ) $(DESTDIR)/lib
install -m 644 -D fmctdc-lib.h $(DESTDIR)/include/fmc-tdc
ln -sf $(LIBS_XYZ) $(DESTDIR)/lib/$(LIBS).$(SO_VERSION_X)
ln -sf $(LIBS).$(SO_VERSION_X) $(DESTDIR)/lib/$(LIBS)
DESTDIR ?=
prefix ?= /usr/local
libdir ?= $(prefix)/lib
includedir ?= $(prefix)/include
deploy install: $(LIB) $(LIBS) $(LIBS_XYZ)
mkdir -m 0775 -p $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)/fmc-tdc
install -D -t $(DESTDIR)$(libdir) -m 0644 $(LIB)
install -D -t $(DESTDIR)$(libdir) -m 0755 $(LIBS_XYZ)
install -D -t $(DESTDIR)$(includedir)/fmc-tdc -m 0644 fmctdc-lib.h
install -D -t $(DESTDIR)$(includedir)/fmc-tdc -m 0644 ../kernel/fmc-tdc.h
cp -d $(LIBS) $(DESTDIR)$(libdir)
modules_install:
......
......@@ -9,10 +9,11 @@
# include parent_common.mk for buildsystem's defines
IGNORE_CPU_SUFFIX := y
REPO_PARENT ?= $(shell pwd)/../../..
TOPDIR ?= $(shell pwd)/../..
REPO_PARENT ?= $(TOPDIR)/..
-include $(REPO_PARENT)/parent_common.mk
DESTDIR ?= /usr/local/
LIBTDC = ../lib/
TESTS = fmc-tdc-term \
......@@ -52,10 +53,15 @@ clean:
# make nothing for modules_install, but avoid errors
modules_install:
install:
install -d $(DESTDIR)/bin
install -D fmc-tdc-list $(DESTDIR)/bin
install -D $(TESTS) $(DESTDIR)/bin
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 fmc-tdc-list
install -D -t $(DESTDIR)$(bindir) -m 0755 $(TESTS)
cppcheck:
$(CPPCHECK) -q -I. -I../kernel -I$(LIBTDC) --suppress=missingIncludeSystem --enable=all fmc-tdc*.c *.h
......
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