Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
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
FMC DEL 1ns 4cha
Commits
392a10dc
Commit
392a10dc
authored
May 13, 2020
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib: build .so library
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
694a988d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
.gitignore
lib/.gitignore
+1
-0
Makefile
lib/Makefile
+17
-3
No files found.
lib/.gitignore
View file @
392a10dc
*.a
.depend
*.so*
\ No newline at end of file
lib/Makefile
View file @
392a10dc
...
...
@@ -13,7 +13,13 @@ REPO_PARENT=../..
ZIO
?=
../zio
ZIO_ABS
?=
$
(
abspath
$(ZIO)
)
VERSION
:=
$(
shell
git describe
--tags
--abbrev
=
0 |
tr
-d
'v'
)
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
)
LIB
=
libfdelay.a
LIBS
=
libfdelay.so
LIBS_XYZ
=
$(LIBS)
.
$(SO_VERSION_XYZ)
LOBJ
:=
fdelay-init.o
LOBJ
+=
fdelay-time.o
LOBJ
+=
fdelay-tdc.o
...
...
@@ -22,16 +28,18 @@ LOBJ += fdelay-output.o
GIT_VERSION
:=
$(
shell
git describe
--dirty
--long
--tags
)
ZIO_GIT_VERSION
:=
$(
shell
cd
$(ZIO_ABS)
;
git describe
--dirty
--long
--tags
)
CFLAGS
=
-Wall
-ggdb
-O2
-I
../kernel
-I
$(ZIO_ABS)
/include
$(EXTRACFLAGS)
CFLAGS
=
-Wall
-ggdb
-O2
-I
../kernel
-I
$(ZIO_ABS)
/include
CFLAGS
+=
-fPIC
CFLAGS
+=
-DGIT_VERSION
=
"
\"
$(GIT_VERSION)
\"
"
CFLAGS
+=
-DZIO_GIT_VERSION
=
"
\"
$(ZIO_GIT_VERSION)
\"
"
CFLAGS
+=
$(EXTRACFLAGS)
LDFLAGS
=
-L
.
-lfdelay
DESTDIR
?=
/usr/local
modules all
:
lib
lib
:
$(LIB)
lib
:
$(LIB)
$(LIBS_XYZ)
%
:
%.c $(LIB)
$(CC)
$(CFLAGS)
$*
.c
$(LDFLAGS)
-o
$@
...
...
@@ -39,8 +47,11 @@ lib: $(LIB)
$(LIB)
:
$(LOBJ)
$(AR)
r
$@
$^
$(LIBS_XYZ)
:
$(LIB)
$(CC)
-shared
-o
$@
-Wl
,--whole-archive,-soname,
$@
$^
-Wl
,--no-whole-archive
clean
:
rm
-f
$(LIB)
.depend
*
.o
*
~
rm
-f
$(LIB)
$(LIBS_XYZ)
.depend
*
.o
*
~
.depend
:
Makefile $(wildcard *.c *.h ../*.h)
$(CC)
$(CFLAGS)
-M
$
(
LOBJ:.o
=
.c
)
-o
$@
...
...
@@ -50,8 +61,11 @@ install:
install
-d
$(DESTDIR)
/include/fmc-fdelay
install
-m
644
-D
$(LIB)
$(DESTDIR)/lib
install
-m
0755
$(LIBS_XYZ)
$(DESTDIR)/lib
install
-m
644
-D
fdelay-lib.h
$(DESTDIR)/include/fmc-fdelay
install
-m
644
-D
../kernel/fine-delay.h
$(DESTDIR)/include/fmc-fdelay
ln
-sf
$(LIBS_XYZ)
$(DESTDIR)/lib/$(LIBS).$(SO_VERSION_X)
ln
-sf
$(LIBS).$(SO_VERSION_X)
$(DESTDIR)/lib/$(LIBS)
modules_install
:
...
...
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