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

Merge branch 'release/v4.0.0.beta8'

parents 627415b0 3f2b0516
...@@ -7,7 +7,6 @@ DIR_NAME := $(DRIVER_NAME)-$(VERSION) ...@@ -7,7 +7,6 @@ DIR_NAME := $(DRIVER_NAME)-$(VERSION)
KEEP_TEMP ?= n KEEP_TEMP ?= n
BUILD ?= $(abspath build) BUILD ?= $(abspath build)
BUILD_DKMS := $(BUILD)/dkms BUILD_DKMS := $(BUILD)/dkms
BUILD_TOOLS := $(BUILD)/tools
BUILD_DKMSSOURCE := $(BUILD_DKMS)/source BUILD_DKMSSOURCE := $(BUILD_DKMS)/source
BUILD_DKMSTREE := $(BUILD_DKMS)/tree BUILD_DKMSTREE := $(BUILD_DKMS)/tree
...@@ -17,11 +16,11 @@ SRC += $(TOP_DIR)/Makefile ...@@ -17,11 +16,11 @@ SRC += $(TOP_DIR)/Makefile
DKMS_OPT := --dkmstree $(BUILD_DKMSTREE) -m $(DRIVER_NAME)/$(VERSION) DKMS_OPT := --dkmstree $(BUILD_DKMSTREE) -m $(DRIVER_NAME)/$(VERSION)
all: kernel tools all: kernel userspace
kernel: dkms-tar dkms-rpm kernel: dkms-tar dkms-rpm
tools: tools-rpm userspace: userspace-rpm
clean: clean:
@rm -rf $(BUILD) @rm -rf $(BUILD)
...@@ -62,18 +61,31 @@ dkms-tar: dkms-add ...@@ -62,18 +61,31 @@ dkms-tar: dkms-add
dkms-rpm: dkms-add dkms-rpm: dkms-add
@dkms mkrpm $(DKMS_OPT) --source-only @dkms mkrpm $(DKMS_OPT) --source-only
# Build Binary RPM package for tools # Build Binary RPM package for libraries
tools-dir: build-dir userspace-dir: build-dir
@mkdir -p $(BUILD_TOOLS)/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} @mkdir -p $(BUILD)/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
tools-spec: mockturtle-tools.spec tools-dir userspace-spec: mockturtle-tools.spec mockturtle-lib.spec mockturtle-lib-static.spec userspace-dir
@cp $< $(BUILD_TOOLS)/SPECS @cp mockturtle-tools.spec $(BUILD)/SPECS
@cp mockturtle-lib.spec $(BUILD)/SPECS
@cp mockturtle-lib-static.spec $(BUILD)/SPECS
tools-tar: tools-spec userspace-tar: userspace-spec
spectool -g -C $(BUILD_TOOLS)/SOURCES --define "gittag $(VERSION)" $(BUILD_TOOLS)/SPECS/mockturtle-tools.spec spectool -g -C $(BUILD)/SOURCES --define "gittag $(VERSION)" $(BUILD)/SPECS/mockturtle-tools.spec
spectool -g -C $(BUILD)/SOURCES --define "gittag $(VERSION)" $(BUILD)/SPECS/mockturtle-lib.spec
spectool -g -C $(BUILD)/SOURCES --define "gittag $(VERSION)" $(BUILD)/SPECS/mockturtle-lib-static.spec
tools-rpm: tools-tar RPMBUILD_DEFINE := --define "%_topdir $(BUILD)" --define "arch $(shell uname -p)" --define "gittag $(VERSION)"
rpmbuild -vv --define "%_topdir $(BUILD_TOOLS)" --define "arch $(shell uname -p)" --define "gittag $(VERSION)" -ba $(BUILD_TOOLS)/SPECS/mockturtle-tools.spec
userspace-rpm: tools-rpm lib-static-rpm lib-rpm
.PHONY: dkmstree dkms-add kernel-dkms-tar tools-dir tools-spec tools-tar tools-rpm tools-rpm: userspace-tar
rpmbuild -vv $(RPMBUILD_DEFINE) -ba $(BUILD)/SPECS/mockturtle-tools.spec
lib-static-rpm: userspace-tar
rpmbuild -vv $(RPMBUILD_DEFINE) -ba $(BUILD)/SPECS/mockturtle-lib-static.spec
lib-rpm: userspace-tar
rpmbuild -vv $(RPMBUILD_DEFINE) -ba $(BUILD)/SPECS/mockturtle-lib.spec
.PHONY: dkmstree dkms-add kernel-dkms-tar userspace-dir userspace-spec userspace-tar userspace-rpm tools-rpm lib-static-rpm lib-rpm
%{?!gittag: %{error: You did not specify a version}}
%{?!arch: %{error: You did not specify an architecture}}
%global project_name mock-turtle
Summary: Static library to access Mock Turtle
Name: mockturtle-lib-static
Version: %{gittag}
License: GPL-3.0-or-later
Release: 1%{?dist}
Group: Applications/System
URL: https://ohwr.org/project/%{name}
BuildArch: %{arch}
Requires: mockturtle-driver
Source0: https://ohwr.org/project/%{project_name}/-/archive/%{gittag}/%{project_name}-%{gittag}.tar.bz2
%description
This package the Mock Turtle static library to access Mock Turtle instances on FPGA
%prep
%autosetup -n %{project_name}-%{gittag}
%build
make -C software/lib EXTRACFLAGS="$RPM_OPT_FLAGS"
%install
make -C software/lib DESTLIBDIR=%{buildroot}/%{_libdir}/ install
rm -f %{buildroot}/%{_libdir}/*.so*
%files
%license LICENSES/GPL-3.0-or-later.txt
%{_libdir}/libmockturtle.a
%changelog
# Nothing for the time being
%{?!gittag: %{error: You did not specify a version}}
%{?!arch: %{error: You did not specify an architecture}}
%global project_name mock-turtle
Summary: Library to access Mock Turtle
Name: mockturtle-lib
Version: %{gittag}
License: GPL-3.0-or-later
Release: 1%{?dist}
Group: Applications/System
URL: https://ohwr.org/project/%{name}
BuildArch: %{arch}
Requires: mockturtle-driver
Source0: https://ohwr.org/project/%{project_name}/-/archive/%{gittag}/%{project_name}-%{gittag}.tar.bz2
%description
This package the Mock Turtle library to access Mock Turtle instances on FPGA
%prep
%autosetup -n %{project_name}-%{gittag}
%build
make -C software/lib EXTRACFLAGS="$RPM_OPT_FLAGS"
%install
make -C software/lib DESTLIBDIR=%{buildroot}/%{_libdir}/ install
rm -f %{buildroot}/%{_libdir}/*.a
%files
%license LICENSES/GPL-3.0-or-later.txt
%{_libdir}/libmockturtle.so
%{_libdir}/libmockturtle.so.*
%changelog
# Nothing for the time being
...@@ -5,11 +5,11 @@ CURDIR:=$(shell /bin/pwd) ...@@ -5,11 +5,11 @@ CURDIR:=$(shell /bin/pwd)
REPO_PARENT ?= $(CURDIR)/.. REPO_PARENT ?= $(CURDIR)/..
-include $(REPO_PARENT)/parent_common.mk -include $(REPO_PARENT)/parent_common.mk
DIRS = kernel lib tools include/hw DIRS = kernel lib tools include/mockturtle/hw
all clean modules install modules_install: $(DIRS) all clean modules install modules_install: $(DIRS)
headers: include/hw headers: include/mockturtle/hw
kernel lib: headers kernel lib: headers
tools: lib tools: lib
......
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
#include <stdarg.h> #include <stdarg.h>
#include <generated/autoconf.h> #include <generated/autoconf.h>
#include <hw/mockturtle_addresses.h> #include mockturtle/hw/mockturtle_addresses.h>
#include <hw/mockturtle_queue.h> #include mockturtle/hw/mockturtle_queue.h>
#include <hw/mockturtle_endpoint.h> #include mockturtle/hw/mockturtle_endpoint.h>
#include <hw/mockturtle_cpu_lr.h> #include mockturtle/hw/mockturtle_cpu_lr.h>
#include <urv/riscv.h> #include <urv/riscv.h>
......
HEADERS := mockturtle_cpu_csr.h HEADERS := mockturtle_cpu_csr.h
HEADERS += mockturtle_cpu_lr.h HEADERS += mockturtle_cpu_lr.h
TRTL ?= ../../.. TRTL ?= ../../../..
TRTL_HDL = $(TRTL)/hdl/rtl/ TRTL_HDL = $(TRTL)/hdl/rtl/
WBGEN2 ?= wbgen2 WBGEN2 ?= wbgen2
......
...@@ -19,7 +19,7 @@ extern "C" { ...@@ -19,7 +19,7 @@ extern "C" {
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <poll.h> #include <poll.h>
#include "mockturtle.h" #include "mockturtle/mockturtle.h"
extern const unsigned int trtl_default_timeout_ms; extern const unsigned int trtl_default_timeout_ms;
......
...@@ -36,7 +36,7 @@ all modules: hw_header ...@@ -36,7 +36,7 @@ all modules: hw_header
hw_header: hw_header:
ifeq ($(DKMS), 0) ifeq ($(DKMS), 0)
$(MAKE) -C ../include/hw/ $(MAKE) -C ../include/mockturtle/hw/
endif endif
install modules_install: install modules_install:
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <hw/mockturtle_cpu_csr.h> #include <mockturtle/hw/mockturtle_cpu_csr.h>
#include <hw/mockturtle_queue.h> #include <mockturtle/hw/mockturtle_queue.h>
#include "mockturtle-drv.h" #include "mockturtle-drv.h"
#include "mockturtle-compat.h" #include "mockturtle-compat.h"
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <hw/mockturtle_cpu_csr.h> #include <mockturtle/hw/mockturtle_cpu_csr.h>
#include "mockturtle-drv.h" #include "mockturtle-drv.h"
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <hw/mockturtle_cpu_csr.h> #include <mockturtle/hw/mockturtle_cpu_csr.h>
#include "mockturtle-drv.h" #include "mockturtle-drv.h"
#include "mockturtle-compat.h" #include "mockturtle-compat.h"
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
#include <linux/circ_buf.h> #include <linux/circ_buf.h>
#include <linux/tty.h> #include <linux/tty.h>
#include "hw/mockturtle_addresses.h" #include "mockturtle/hw/mockturtle_addresses.h"
#include "hw/mockturtle_queue.h" #include "mockturtle/hw/mockturtle_queue.h"
#include "mockturtle.h" #include "mockturtle/mockturtle.h"
#define MAX_MQUEUE_SLOTS (TRTL_MAX_HMQ_SLOT / 2) #define MAX_MQUEUE_SLOTS (TRTL_MAX_HMQ_SLOT / 2)
#define TRTL_MAX_CPU_MINORS (TRTL_MAX_CPU * TRTL_MAX_CARRIER) #define TRTL_MAX_CPU_MINORS (TRTL_MAX_CPU * TRTL_MAX_CARRIER)
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/circ_buf.h> #include <linux/circ_buf.h>
#include <hw/mockturtle_queue.h> #include <mockturtle/hw/mockturtle_queue.h>
#include <hw/mockturtle_cpu_csr.h> #include <mockturtle/hw/mockturtle_cpu_csr.h>
#include "mockturtle-drv.h" #include "mockturtle-drv.h"
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <linux/tty_flip.h> #include <linux/tty_flip.h>
#include <linux/kallsyms.h> #include <linux/kallsyms.h>
#include <hw/mockturtle_cpu_csr.h> #include <mockturtle/hw/mockturtle_cpu_csr.h>
#include "mockturtle-drv.h" #include "mockturtle-drv.h"
......
...@@ -23,7 +23,7 @@ LOBJ := libmockturtle.o ...@@ -23,7 +23,7 @@ LOBJ := libmockturtle.o
LOBJ += libmockturtle-rt-msg.o LOBJ += libmockturtle-rt-msg.o
CFLAGS += -Wall -Werror -fPIC CFLAGS += -Wall -Werror -fPIC
CFLAGS += -I. -I$(TRTL_SW)/include CFLAGS += -I$(TRTL_SW)/include
CFLAGS += -DVERSION="\"$(GIT_VERSION)\"" CFLAGS += -DVERSION="\"$(GIT_VERSION)\""
CFLAGS += $(EXTRACFLAGS) CFLAGS += $(EXTRACFLAGS)
ARFLAGS = rcv ARFLAGS = rcv
...@@ -41,7 +41,7 @@ $(LIBSV): $(LIB) ...@@ -41,7 +41,7 @@ $(LIBSV): $(LIB)
$(CC) -shared -o $@ -Wl,--whole-archive,-soname,$@ $^ -Wl,--no-whole-archive $(CC) -shared -o $@ -Wl,--whole-archive,-soname,$@ $^ -Wl,--no-whole-archive
$(LIBS): $(LIBSV) $(LIBS): $(LIBSV)
ln -s $@ $(shell echo $@ | grep -o -E ".*\.so") ln -sf $< $@
clean: clean:
rm -f $(LIB) $(LIBS) $(LIBSV) .depend *.o *~ rm -f $(LIB) $(LIBS) $(LIBSV) .depend *.o *~
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef __LIBTRTL_INTERNAL_H__ #ifndef __LIBTRTL_INTERNAL_H__
#define __LIBTRTL_INTERNAL_H__ #define __LIBTRTL_INTERNAL_H__
#include "libmockturtle.h" #include <mockturtle/libmockturtle.h>
/** /**
* Maximum size for device name * Maximum size for device name
......
...@@ -13,7 +13,7 @@ TRTL_SW = $(TRTL)/software ...@@ -13,7 +13,7 @@ TRTL_SW = $(TRTL)/software
GIT_VERSION := $(shell git describe --dirty --long --tags) GIT_VERSION := $(shell git describe --dirty --long --tags)
CFLAGS += -Wall -Werror -I$(TRTL_SW)/lib CFLAGS += -Wall -Werror
CFLAGS += -I$(TRTL_SW)/include CFLAGS += -I$(TRTL_SW)/include
CFLAGS += $(EXTRACFLAGS) CFLAGS += $(EXTRACFLAGS)
LDFLAGS += -L$(TRTL_SW)/lib LDFLAGS += -L$(TRTL_SW)/lib
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <getopt.h> #include <getopt.h>
#include <errno.h> #include <errno.h>
#include <libmockturtle.h> #include <mockturtle/libmockturtle.h>
/** /**
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <stdio.h> #include <stdio.h>
#include <getopt.h> #include <getopt.h>
#include <errno.h> #include <errno.h>
#include <libmockturtle.h> #include <mockturtle/libmockturtle.h>
static void help(char *name) static void help(char *name)
{ {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <libmockturtle.h> #include <mockturtle/libmockturtle.h>
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <getopt.h> #include <getopt.h>
#include <errno.h> #include <errno.h>
#include <libmockturtle.h> #include <mockturtle/libmockturtle.h>
static void help() static void help()
{ {
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <assert.h> #include <assert.h>
#include <limits.h> #include <limits.h>
#include <hw/mockturtle_cpu_csr.h> #include <mockturtle/hw/mockturtle_cpu_csr.h>
#define TRTL_DBG_PORT_SIZE pagesize #define TRTL_DBG_PORT_SIZE pagesize
#define TRTL_GDB_PACKET_SIZE_MAX 2048 #define TRTL_GDB_PACKET_SIZE_MAX 2048
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <libmockturtle.h> #include <mockturtle/libmockturtle.h>
#include <getopt.h> #include <getopt.h>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <libmockturtle.h> #include <mockturtle/libmockturtle.h>
#include <getopt.h> #include <getopt.h>
#include <pthread.h> #include <pthread.h>
#include <unistd.h> #include <unistd.h>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <getopt.h> #include <getopt.h>
#include <errno.h> #include <errno.h>
#include <libmockturtle.h> #include <mockturtle/libmockturtle.h>
/** /**
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <libmockturtle.h> #include <mockturtle/libmockturtle.h>
#include <getopt.h> #include <getopt.h>
#include <pthread.h> #include <pthread.h>
#include <time.h> #include <time.h>
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <stdio.h> #include <stdio.h>
#include <getopt.h> #include <getopt.h>
#include <errno.h> #include <errno.h>
#include <libmockturtle.h> #include <mockturtle/libmockturtle.h>
static void help(char *name) static void help(char *name)
{ {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <libmockturtle.h> #include <mockturtle/libmockturtle.h>
#include <lib{{short_name}}-internal.h> #include <lib{{short_name}}-internal.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