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
8e306be0
Commit
8e306be0
authored
Sep 28, 2023
by
Dimitris Lampridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bld: use GNU make vars for installation/deployment
parent
5840323f
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
66 additions
and
66 deletions
+66
-66
.gitlab-ci.yml
.gitlab-ci.yml
+1
-1
Makefile
Makefile
+0
-22
Makefile
software/Makefile
+1
-2
Makefile
software/include/Makefile
+7
-13
Makefile
software/lib/Makefile
+31
-20
.gitignore
software/lib/PyMockTurtle/.gitignore
+1
-0
Makefile
software/lib/PyMockTurtle/Makefile
+18
-1
Makefile
software/tools/Makefile
+7
-7
No files found.
.gitlab-ci.yml
View file @
8e306be0
...
...
@@ -19,7 +19,7 @@ cppcheck:
image
:
name
:
gitlab-registry.cern.ch/coht/common-containers/static-analysis:latest
script
:
-
make cppcheck
-
make
-C software
cppcheck
software_build
:
extends
:
.build_fec_os_sw
...
...
Makefile
deleted
100644 → 0
View file @
5840323f
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# SPDX-FileCopyrightText: 2019 CERN
TOP_DIR
?=
$(
shell
pwd
)
TRTL
?=
$(TOP_DIR)
include
common.mk
all
:
$(MAKE)
-C
software
release
:
$
(
eval
TEMP_RELEASE_DIR :
=
$(
shell
mktemp
-d
)
)
$(MAKE)
PREFIX
=
$(TEMP_RELEASE_DIR)
-C
software/include
install
$(MAKE)
PREFIX
=
$(TEMP_RELEASE_DIR)
-C
software/lib
install
$(MAKE)
PREFIX
=
$(TEMP_RELEASE_DIR)
-C
software/lib/PyMockTurtle
install
$(MAKE)
PREFIX
=
$(TEMP_RELEASE_DIR)
-C
software/tools
install
@
cd
$(TEMP_RELEASE_DIR)
&&
tar
-czf
$(TOP_DIR)
/mockturtle-software-
$(VERSION)
.tar.gz
*
@
rm
-r
$(TEMP_RELEASE_DIR)
%
:
$(MAKE)
-C
software
$@
software/Makefile
View file @
8e306be0
...
...
@@ -13,7 +13,7 @@ TOP_DIR ?= $(shell pwd)/..
TRTL
?=
$(TOP_DIR)
include
$(TRTL)/common.mk
DIRS
=
kernel lib tools include
DIRS
=
kernel lib
lib/PyMockTurtle
tools include
all
:
lib tools include modules
clean install
:
$(DIRS)
...
...
@@ -26,7 +26,6 @@ tools: lib
.PHONY
:
all clean modules install modules_install $(DIRS)
.PHONY
:
prereq_install prereq_install_warn
.PHONY
:
gtags cppcheck
.PHONY
:
release
install modules_install
:
prereq_install_warn
...
...
software/include/Makefile
View file @
8e306be0
...
...
@@ -6,7 +6,9 @@ TOP_DIR ?= $(shell pwd)/../..
TRTL
?=
$(TOP_DIR)
include
$(TRTL)/common.mk
INCLUDEDESTDIR
?=
$(PREFIX)
/include
DESTDIR
?=
prefix
?=
/usr/local
includedir
?=
$(prefix)
/include
all
:
ifneq
($(wildcard
./mockturtle/hw/Makefile),)
# Removed during distribution
...
...
@@ -19,16 +21,8 @@ ifneq ($(wildcard ./mockturtle/hw/Makefile),) # Removed during distribution
endif
install
:
all
install
-d
$(INCLUDEDESTDIR)
/mockturtle
install
-m
0644 mockturtle/
*
.h
$(INCLUDEDESTDIR)
/mockturtle
install
-d
$(INCLUDEDESTDIR)
/mockturtle/hw
install
-m
0644 mockturtle/hw/
*
.h
$(INCLUDEDESTDIR)
/mockturtle/hw
mkdir
-m
0775
-p
$(DESTDIR)$(includedir)
/mockturtle/hw
install
-D
-t
$(DESTDIR)$(includedir)
/mockturtle
-m
0644 mockturtle/
*
.h
install
-D
-t
$(DESTDIR)$(includedir)
/mockturtle/hw
-m
0644 mockturtle/hw/
*
.h
uninstall
:
rm
-f
$(INCLUDEDESTDIR)
/mockturtle/hw/
*
rmdir
--ignore-fail-on-non-empty
$(INCLUDEDESTDIR)
/mockturtle/hw
rm
-f
$(INCLUDEDESTDIR)
/mockturtle/
*
rmdir
--ignore-fail-on-non-empty
$(INCLUDEDESTDIR)
/mockturtle
rmdir
--ignore-fail-on-non-empty
$(INCLUDEDESTDIR)
.PHONY
:
all clean install uninstall
.PHONY
:
all clean install
software/lib/Makefile
View file @
8e306be0
...
...
@@ -15,13 +15,25 @@ TOP_DIR ?= $(shell pwd)/../..
TRTL
?=
$(TOP_DIR)
include
$(TRTL)/common.mk
SO_VERSION_XYZ
:=
$(
shell
echo
$(VERSION)
|
grep
-o
-E
"[0-9]+
\.
[0-9]+
\.
[0-9]+"
)
SO_VERSION_X
:=
$(
shell
echo
$(SO_VERSION_XYZ)
|
cut
-d
"."
-f
1
)
GIT_VERSION
=
$(
shell
git describe
--dirty
--long
--tags
--always
|
tr
-d
"v"
)
VER_MAJOR
=
$
(
word 1,
$
(
subst ., ,
$(GIT_VERSION)
))
VER_MINOR
=
$
(
word 2,
$
(
subst ., ,
$(GIT_VERSION)
))
VER_PATCH
=
$
(
word 1,
$
(
subst -, ,
$
(
word 3,
$
(
subst ., ,
$(GIT_VERSION)
))))
DESTLIBDIR
?=
$(PREFIX)
/lib
SO_VERSION_XYZ
=
$(VER_MAJOR)
.
$(VER_MINOR)
.
$(VER_PATCH)
SO_VERSION_X
=
$(VER_MAJOR)
LIBS
=
libmockturtle.so
LIBS_XYZ
=
$(LIBS)
.
$(SO_VERSION_XYZ)
ifeq
($(SO_VERSION_X),)
SO_VERSION_X
:=
0
endif
DESTDIR
?=
prefix
?=
/usr/local
libdir
?=
$(prefix)
/lib
LIBSO
=
libmockturtle.so
LIBSO_XYZ
=
$(LIBSO)
.
$(SO_VERSION_XYZ)
LIBSO_X
=
$(LIBSO)
.
$(SO_VERSION_X)
LIB
=
libmockturtle.a
LOBJ
:=
libmockturtle.o
LOBJ
+=
libmockturtle-rt-msg.o
...
...
@@ -34,30 +46,29 @@ ARFLAGS = rcv
CPPCHECK
?=
cppcheck
all
:
$(LIB) $(LIBS_XYZ)
all
:
$(LIB) $(LIBS
O) $(LIBSO
_XYZ)
$(LIB)
:
$(LOBJ)
$(AR)
$(ARFLAGS)
$@
$^
$(LIBS_XYZ)
:
$(LIB)
$(CC)
-shared
-o
$@
-Wl
,--whole-archive,-soname,
$@
$^
-Wl
,--no-whole-archive
$(LIBSO_XYZ)
:
$(LOBJ)
$(CC)
-shared
$^
-Wl
,-soname,
$(LIBSO_X)
-o
$@
$(LIBSO)
:
$(LIBSO_XYZ)
ln
-sf
$<
$@
clean
:
rm
-f
$(LIB)
$(LIBS
)
$(LIBS_XYZ)
.depend
*
.o
*
~
rm
-f
$(LIB)
$(LIBS
O)
$(LIBSO_XYZ)
$(LOBJ)
.depend
*
.o
*
.so
*
*
~
.depend
:
Makefile $(wildcard *.c *.h)
$(CC)
$(CFLAGS)
-M
$
(
LOBJ:.o
=
.c
)
-o
$@
install
:
$(LIB) $(LIBS_XYZ)
install
-d
$(DESTLIBDIR)
install
-m
0644
$(LIB)
$(DESTLIBDIR)
install
-m
0755
$(LIBS_XYZ)
$(DESTLIBDIR)
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)
rmdir
--ignore-fail-on-non-empty
$(DESTLIBDIR)
deploy deploy-libmockturtle
:
install
install
:
$(LIB) $(LIBSO) $(LIBSO_XYZ)
mkdir
-m
0775
-p
$(DESTDIR)$(libdir)
install
-D
-t
$(DESTDIR)$(libdir)
-m
0755
$(LIBSO_XYZ)
install
-D
-t
$(DESTDIR)$(libdir)
-m
0644
$(LIB)
cp
-d
$(LIBSO)
$(DESTDIR)$(libdir)
modules_install
:
...
...
@@ -68,4 +79,4 @@ cppcheck:
--enable
=
warning,style,information,missingInclude
\
*
.c
*
.h
--error-exitcode
=
1
.PHONY
:
all clean cppcheck install
uninstall
modules_install
.PHONY
:
all clean cppcheck install modules_install
software/lib/PyMockTurtle/.gitignore
View file @
8e306be0
...
...
@@ -5,3 +5,4 @@
*.pyc
build
MANIFEST
PyMockTurtle.egg-info
software/lib/PyMockTurtle/Makefile
View file @
8e306be0
...
...
@@ -10,9 +10,26 @@ include $(TRTL)/common.mk
PYTHON
?=
python
GIT_VERSION
=
$(
shell
git describe
--dirty
--long
--tags
--always
|
tr
-d
"v"
)
VER_MAJOR
=
$
(
word 1,
$
(
subst ., ,
$(GIT_VERSION)
))
VER_MINOR
=
$
(
word 2,
$
(
subst ., ,
$(GIT_VERSION)
))
VER_PATCH
=
$
(
word 1,
$
(
subst -, ,
$
(
word 3,
$
(
subst ., ,
$(GIT_VERSION)
))))
VERSION
=
$(VER_MAJOR)
.
$(VER_MINOR)
.
$(VER_PATCH)
DESTDIR
?=
prefix
?=
/usr/local
libdir
?=
$(prefix)
/lib
pythondir
?=
$(libdir)
/python
all
:
clean
:
rm
-rf
dist
*
.egg-info
deploy deploy-pymockturtle
:
install
install
:
VERSION
=
$(VERSION)
$(PYTHON)
setup.py
install
--prefix
$(PREFIX)
python
-m
pip
install
build
VERSION
=
$(VERSION)
python
-m
build
-o
$(DESTDIR)$(pythondir)
.PHONY
:
all clean install
software/tools/Makefile
View file @
8e306be0
...
...
@@ -15,7 +15,10 @@ TOP_DIR ?= $(shell pwd)/../..
TRTL
?=
$(TOP_DIR)
include
$(TRTL)/common.mk
BINDESTDIR
?=
$(PREFIX)
/bin
DESTDIR
?=
prefix
?=
/usr/local
exec_prefix
?=
$(prefix)
bindir
?=
$(exec_prefix)
/bin
CFLAGS
+=
-Wall
-Werror
CFLAGS
+=
-I
$(TRTL_SW)
/include
...
...
@@ -37,13 +40,10 @@ CPPCHECK ?= cppcheck
all
:
$(PROGS)
deploy deploy-progs
:
install
install
:
$(PROGS)
install
-d
$(BINDESTDIR)
install
-m
0755
$(PROGS)
$(BINDESTDIR)
uninstall
:
rm
-f
$
(
addprefix
$(BINDESTDIR)
/,
$(PROGS)
)
rmdir
--ignore-fail-on-non-empty
$(BINDESTDIR)
mkdir
-m
0775
-p
$(DESTDIR)$(bindir)
install
-D
-t
$(DESTDIR)$(bindir)
-m
0555
$(PROGS)
%
:
%.c $(TRTL_SW)/lib/libmockturtle.a
$(CC)
$(CFLAGS)
$(LDFLAGS)
$^
-o
$@
$(LDLIBS)
...
...
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