Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
Mock Turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
Mock Turtle
Commits
0cb1424e
Commit
0cb1424e
authored
Oct 18, 2019
by
Federico Vaga
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dist: distribution improvements
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
24b7a73e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
170 additions
and
87 deletions
+170
-87
.gitignore
distribution/.gitignore
+1
-0
Makefile
distribution/Makefile
+52
-13
mockturtle.spec
distribution/mockturtle.spec
+93
-63
Makefile
software/kernel/Makefile
+18
-3
dkms.conf
software/kernel/dkms.conf
+2
-2
Makefile
software/lib/Makefile
+4
-6
No files found.
distribution/.gitignore
View file @
0cb1424e
...
...
@@ -3,3 +3,4 @@
# SPDX-FileCopyrightText: 2019 CERN
build
sources
distribution/Makefile
View file @
0cb1424e
...
...
@@ -2,33 +2,38 @@
#
# SPDX-FileCopyrightText: 2019 CERN
TOP_DIR
?=
..
TOP_DIR
?=
$(
shell
pwd
)
/../
NAME
:=
mockturtle
VERSION
:=
$(
shell
git describe
--abbrev
=
0 |
tr
-d
'v'
)
DIR_NAME
:=
$(NAME)
-
$(VERSION)
KEEP_TEMP
?=
n
BUILD
?=
$
(
abspath build
)
SOURCES
?=
$
(
abspath sources
)
PKG_SOURCES
:=
$(SOURCES)
/
$(DIR_NAME)
TRTL
?=
$(TOP_DIR)
TRTL_SW
:=
$(TRTL)
/software
DRIVER_NAME
:=
mockturtle
VERSION
:=
$(
shell
git describe
--abbrev
=
0
)
DIR_NAME
:=
$(DRIVER_NAME)
-
$(VERSION)
KEEP_TEMP
?=
n
BUILD
?=
$
(
abspath build
)
BUILD_DKMS
:=
$(BUILD)
/dkms
BUILD_DKMSSOURCE
:=
$(BUILD_DKMS)
/source
BUILD_DKMSTREE
:=
$(BUILD_DKMS)
/tree
RPM_SPEC
:=
$(
shell
mktemp
/tmp/
$(NAME)
-
$(VERSION)
-XXXXXX
.spec
)
SRC
:=
$(TOP_DIR)
/Makefile
SRC
+=
$(TOP_DIR)
/Makefile
DKMS_OPT
:=
--dkmstree
$(BUILD_DKMSTREE)
-m
$(DRIVER_NAME)
/
$(VERSION)
all
:
kernel userspace
kernel
:
dkms-tar dkms-rpm
GIT
?=
git
userspace
:
userspace-rpm
clean
:
@
rm
-rf
$(BUILD)
A
?=
$(
shell
which
$(GIT))
ifeq
(,$(shell
which
$(GIT)))
$(error
"Missing git"
)
endif
all
:
srpm
wbgen2-headers
:
$(MAKE)
-C
../software/include/mockturtle/hw/
...
...
@@ -97,3 +102,37 @@ devel-rpm: userspace-tar
rpmbuild
-vv
$(RPMBUILD_DEFINE)
--define
"debug_package %{nil}"
-bb
$(BUILD)
/SPECS/mockturtle-devel.spec
.PHONY
:
dkmstree dkms-add kernel-dkms-tar userspace-dir userspace-spec userspace-tar userspace-rpm tools-rpm lib-static-rpm lib-rpm
sources-tar
:
mkdir
-p
$(SOURCES)
cd
$(TRTL)
&&
$(GIT)
archive
--format
=
tar.gz
-o
$(SOURCES)
/
$(DIR_NAME)
.tar.gz
--prefix
=
$(DIR_NAME)
/ HEAD
sources
:
sources-tar
@
tar
-C
$(SOURCES)
-xvf
$(SOURCES)
/
$(DIR_NAME)
.tar.gz
$(DIR_NAME)
/CHANGELOG.rst
@
mv
$(SOURCES)
/
$(DIR_NAME)
/CHANGELOG.rst
$(SOURCES)
/CHANGELOG
srpm-changelog
:
sources
$
(
eval
$@
_pattern :
=
^
\[
([
0-9]+
\.
[
0-9]+
\.
[
0-9]+
)
\]\s
-
\s
([
0-9]
{
4
}
-[0-9]
{
2
}
-[0-9]
{
2
})
$
)
$
(
eval
$@
_replace :
=
echo
-e
"
\n
"
\\
*
`
date
--date
=
"
\2
"
"+%a %b %d %Y"
`
"
\1
"
)
@
sed
-r
-i
-e
"/^[.]{2}/d"
-e
"/^
\s
{2}.*
$$
/d"
$(SOURCES)
/CHANGELOG
@
sed
-r
-i
-e
"/Change Log/d"
-e
"/^(=|-|
\s
)*
$$
/d"
$(SOURCES)
/CHANGELOG
@
sed
-r
-i
-e
's,$($@_pattern),$($@_replace),e'
$(SOURCES)
/CHANGELOG
rpm-spec
:
mockturtle.spec
# The fmc.spec file is good when we can define variables. With tools like
# koji it is not possible, so we need to create a .spec file without using
# package-specific variables.
@cp
$<
$(RPM_SPEC)
@sed
-i
-e
"s/%{?_build_version}/$(VERSION)/"
$(RPM_SPEC)
srpm
:
sources rpm-spec srpm-changelog
@
rpmbuild
-bs
--define
"_topdir
$(BUILD)
"
\
--define
'_sourcedir
$(SOURCES)
'
\
--define
"_build_version
$(VERSION)
"
\
$(RPM_SPEC)
ifeq
($(KEEP_TEMP),
n)
@rm
-f
$(RPM_SPEC)
endif
clean
:
@
rm
-rf
$(BUILD)
$(SOURCES)
*
.tar.gz
$(RPM_SPEC)
distribution/mockturtle.spec
View file @
0cb1424e
%{?!gittag: %{error: You did not specify a version}}
%{?!arch: %{error: You did not specify an architecture}}
%global project_name mock-turtle
# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2019 CERN
Summary: Mock Turtle
Name: mockturtle
Version: %{
gittag
}
Version: %{
?_build_version
}
License: GPL-3.0-or-later
Release: 1%{?dist}
URL: https://
ohwr.org/project/%{name}
URL: https://
www.ohwr.org/projects/mock-turtle/
BuildArch: %{arch}
BuildRequires: make, gcc
# Binary libraries are necessary to develop, just headers is not enough
# Requires: mockturtle-lib, mockturtle-lib-static
BuildRequires: make, gcc, git
#BuildRequires: wbgen2
Requires: %{name}-lib
Requires: %{name}-tools
Requires: %{name}-lib
Requires: %{name}-tools
Requires: dkms-%{name}
Source0: https://ohwr.org/project/%{project_name}/-/archive/%{gittag}/%{project_name}-%{gittag}.tar.bz2
Source0: %{name}-%{version}.tar.gz
Source1: CHANGELOG
%description
This package is a meta package that install the Mock Turtle distribution
%package devel
Summary: Libraries and header files for mock turtle development
Group: Development/Libraries
Requires: %{name}-lib = %{version}-%{release}
#Requires: fixme
#BuildRequires: fixme
%description devel
The mockturtle-devel package contains the header files and mockturtle library
necessary for developing programs using mockturtle.
%prep
%autosetup -n %{name}-%{version}
%package lib
Summary: mock turtle runtime library
#Requires: fixme
#BuildRequires: fixme
%description lib
The mockturtle-libs package contains
%build
make -C software/include
make -C software/lib
make -C software/tools
%package libstatic
Summary: mock turtle static library
#Requires: fixme
#BuildRequires: fixme
%description libstatic
The mockturtle-libs package contains
%install
make -C software/include PREFIX=%{buildroot}/ install
make -C software/lib PREFIX=%{buildroot}/ install
make -C software/tools PREFIX=%{buildroot}/ install
make -C software/kernel PREFIX=%{buildroot}/ dkms_install
%changelog
%include %{SOURCE1}
#
# tools
#
%package tools
Summary:
mock t
urtle tools
#Requires:
Summary:
Mock T
urtle tools
#Requires:
%description tools
This package contains the Mock Turtle tools
%package -n dkms-%{name}
Summary: mockturtle kernel module(s)
Requires: dkms
%description -n dkms-%{name}
The dkms-mockturtle kernel module.
%prep
%autosetup -n %{project_name}-%{gittag}
%build
make -C software/
%install
make -C software PREFIX=%{buildroot}/ install
%files
%license LICENSES/GPL-3.0-or-later.txt
%files tools
%license LICENSES/GPL-3.0-or-later.txt
/usr/local/bin/mockturtle-count
/usr/local/bin/lsmockturtle
/usr/local/bin/mockturtle-loader
...
...
@@ -86,18 +63,75 @@ make -C software PREFIX=%{buildroot}/ install
/usr/local/bin/mockturtle-buffer
/usr/local/bin/mockturtle-gdbserver
#%files -n dkms-%{name}
#
# dkms
#
%package -n dkms-%{name}
Summary: Mock Turtle DKMS module
BuildRequires: dkms
Requires: dkms
%description -n dkms-%{name}
The dkms-mockturtle kernel module.
%post -n dkms-%{name}
dkms add -m %{name} -v %{version} --rpm_safe_upgrade
dkms build -m %{name} -v %{version} --rpm_safe_upgrade
dkms install -m %{name} -v %{version} --rpm_safe_upgrade
%preun -n dkms-%{name}
dkms remove -m %{name} -v %{version} --rpm_safe_upgrade --all ||:
%files -n dkms-%{name}
%license LICENSES/GPL-2.0.txt
/usr/src/%{name}-%{version}/
#
# lib
#
%package lib
Summary: Mock Turtle runtime library
%description lib
The mockturtle-libs package contains
%files lib
%license LICENSES/GPL-3.0-or-later.txt
/usr/local/lib/libmockturtle.so.
%license LICENSES/LGPL-3.0-or-later.txt
/usr/local/lib/libmockturtle.so.*
#
# libstatic
#
%package libstatic
Summary: Mock Turtle static library
%description libstatic
The mockturtle-libs package contains
%files libstatic
%license LICENSES/GPL-3.0-or-later.txt
%license LICENSES/
L
GPL-3.0-or-later.txt
/usr/local/lib/libmockturtle.a
#
# devel
#
%package devel
Summary: Libraries and header files for Mock Turtle development
Group: Development/Libraries
Requires: %{name}-lib = %{version}-%{release}
%description devel
The mockturtle-devel package contains the header files and mockturtle library
necessary for developing programs using mockturtle.
%files devel
%license LICENSES/GPL-3.0-or-later.txt
%license LICENSES/LGPL-3.0-or-later.txt
%license LICENSES/BSD-3-Clause.txt
/usr/local/lib/libmockturtle.so
/usr/local/include/mockturtle/libmockturtle.h
/usr/local/include/mockturtle/mockturtle.h
...
...
@@ -106,7 +140,3 @@ make -C software PREFIX=%{buildroot}/ install
/usr/local/include/mockturtle/hw/mockturtle_cpu_lr.h
/usr/local/include/mockturtle/hw/mockturtle_endpoint.h
/usr/local/include/mockturtle/hw/mockturtle_queue.h
%changelog
* Mon May 06 2019 Federico Vaga <federico.vaga at cern.ch> - 4.0.0
- First public release
software/kernel/Makefile
View file @
0cb1424e
...
...
@@ -2,12 +2,17 @@
#
# SPDX-FileCopyrightText: 2019 CERN
TOP_DIR
?=
$(
shell
pwd
)
/../../
TRTL
?=
$(TOP_DIR)
TRTL_SW
:=
$(TRTL)
/software
PREFIX
?=
/
KVERSION
?=
$(
shell
uname
-r
)
LINUX
?=
/lib/modules/
$(KVERSION)
/build
DKMS
?=
0
VERSION
=
$(
shell
cd
$(src)
;
git describe
--always
--dirty
--long
--tags
)
GIT_VERSION
=
$(
shell
cd
$(src)
;
git describe
--always
--dirty
--long
--tags
)
VERSION
:=
$(
shell
git describe
--tags
--abbrev
=
0 |
tr
-d
'v'
)
# For this CSM_VERSION, please see ohwr.org/csm documentation
ifdef
CONFIG_CSM_VERSION
...
...
@@ -16,7 +21,7 @@ else
ccflags-y
+=
-DCERN_SUPER_MODULE
=
""
endif
ccflags-y
+=
-DGIT_VERSION
=
\"
$(VERSION)
\"
ccflags-y
+=
-DGIT_VERSION
=
\"
$(
GIT_
VERSION)
\"
ccflags-y
+=
-I
$(src)
ifeq
($(DKMS),
0)
ccflags-y
+=
-I
$(src)
/../include
...
...
@@ -42,13 +47,23 @@ all modules: hw_header
hw_header
:
ifeq
($(DKMS),
0)
$(MAKE)
-C
..
/include/mockturtle/hw/
$(MAKE)
-C
$(TRTL_SW)
/include/mockturtle/hw/
endif
install
:
modules_install
modules_install
:
$(MAKE)
-C
$(LINUX)
M
=
$(
shell
/bin/pwd
)
INSTALL_MOD_PATH
=
$(PREFIX)
$@
dkms_install
:
hw_header
$
(
eval
$@
_dir :
=
$(PREFIX)
/usr/src/mockturtle-
$(VERSION)
/
)
@mkdir
-p
$($@_dir)
@cp
mockturtle-*.[ch]
Makefile
dkms.conf
$(TRTL)/LICENSES/GPL-2.0.txt
$($@_dir)
@cp
-a
$(TRTL_SW)/include/mockturtle
$($@_dir)
@sed
-r
-i
-e
"s/^VERSION\s=\s.*/VERSION = $(VERSION)/"
$($@_dir)/Makefile
@sed
-r
-i
-e
"s/^DKMS\s[?]=\s0/DKMS ?= 1/"
$($@_dir)/Makefile
@sed
-r
-i
-e
"s/@PKGVER@/$(VERSION)/"
$($@_dir)/dkms.conf
# 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
\
...
...
distribution
/dkms.conf
→
software/kernel
/dkms.conf
View file @
0cb1424e
...
...
@@ -2,10 +2,10 @@
#
# SPDX-FileCopyrightText: 2019 CERN
PACKAGE_NAME
=
"
@PKGNAME@
"
PACKAGE_NAME
=
"
mockturtle
"
PACKAGE_VERSION
=
"@PKGVER@"
CLEAN
=
"make clean"
MAKE
[
0
]=
"make KVERSION=$kernelver all"
BUILT_MODULE_NAME
[
0
]=
"
@PKGNAME@
"
BUILT_MODULE_NAME
[
0
]=
"
mockturtle
"
DEST_MODULE_LOCATION
[
0
]=
"/updates"
AUTOINSTALL
=
"yes"
software/lib/Makefile
View file @
0cb1424e
...
...
@@ -13,6 +13,7 @@ REPO_PARENT ?= ../..
GIT_VERSION
:=
$(
shell
git describe
--dirty
--long
--tags
)
SO_VERSION_XYZ
:=
$(
shell
git describe
--abbrev
=
0 |
grep
-o
-E
"[0-9]+
\.
[0-9]+
\.
[0-9]"
)
SO_VERSION_X
:=
$(
shell
echo
$(SO_VERSION_XYZ)
|
cut
-d
"."
-f
1
)
PREFIX
?=
/
DESTLIBDIR
?=
$(PREFIX)
/usr/local/lib
...
...
@@ -31,8 +32,7 @@ CFLAGS += -DVERSION="\"$(GIT_VERSION)\""
CFLAGS
+=
$(EXTRACFLAGS)
ARFLAGS
=
rcv
modules all
:
$(LIB) $(LIBS)
all
:
$(LIB) $(LIBS_XYZ)
%
:
%.c $(LIB)
$(CC)
$(CFLAGS)
$*
.c
$(LDFLAGS)
$(LDLIBS)
-o
$@
...
...
@@ -43,9 +43,6 @@ $(LIB): $(LOBJ)
$(LIBS_XYZ)
:
$(LIB)
$(CC)
-shared
-o
$@
-Wl
,--whole-archive,-soname,
$@
$^
-Wl
,--no-whole-archive
$(LIBS)
:
$(LIBS_XYZ)
ln
-sf
$<
$@
clean
:
rm
-f
$(LIB)
$(LIBS)
$(LIBS_XYZ)
.depend
*
.o
*
~
...
...
@@ -56,7 +53,8 @@ install: $(LIB) $(LIBS_XYZ)
install
-d
$(DESTLIBDIR)
install
-m
0644
$(LIB)
$(DESTLIBDIR)
install
-m
0755
$(LIBS_XYZ)
$(DESTLIBDIR)
test
-e
$(DESTLIBDIR)
/
$(LIBS)
||
ln
-s
$(LIBS_XYZ)
$(DESTLIBDIR)
/
$(LIBS)
ln
-sf
$(LIBS_XYZ)
$(DESTLIBDIR)
/
$(LIBS)
.
$(SO_VERSION_X)
ln
-sf
$(LIBS)
.
$(SO_VERSION_X)
$(DESTLIBDIR)
/
$(LIBS)
uninstall
:
rm
-f
$(DESTLIBDIR)
/
$(LIB)
$(DESTLIBDIR)
/
$(LIBS_XYZ)
...
...
Dimitris Lampridis
@dlampridis
mentioned in issue
#10 (closed)
·
Oct 17, 2022
mentioned in issue
#10 (closed)
mentioned in issue #10
Toggle commit list
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