Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
8bffc641
Commit
8bffc641
authored
Jul 31, 2008
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libccan.a: simple way to use all of ccan.
parent
a1adc2a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
14 deletions
+11
-14
Makefile
Makefile
+9
-9
tools/run_tests.c
tools/run_tests.c
+2
-5
No files found.
Makefile
View file @
8bffc641
...
@@ -6,9 +6,12 @@ CFLAGS=-g -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes
...
@@ -6,9 +6,12 @@ CFLAGS=-g -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes
ALL
=
$(
patsubst
ccan/%/test, %,
$(
wildcard
ccan/
*
/test
))
ALL
=
$(
patsubst
ccan/%/test, %,
$(
wildcard
ccan/
*
/test
))
ALL_DIRS
=
$(
patsubst
%, ccan/%,
$(ALL)
)
ALL_DIRS
=
$(
patsubst
%, ccan/%,
$(ALL)
)
ALL_DEPENDS
=
$(
patsubst
%, ccan/%/.depends,
$(ALL)
)
ALL_DEPENDS
=
$(
patsubst
%, ccan/%/.depends,
$(ALL)
)
ALL_LIBS
=
$(
patsubst
%, ccan/
lib%.a
,
$(ALL)
)
ALL_LIBS
=
$(
patsubst
%, ccan/
%.o
,
$(ALL)
)
test
:
$(ALL_DIRS:%=test-%)
libccan.a
:
$(ALL_LIBS)
$(AR)
r
$@
$^
check
:
$(ALL_DIRS:%=test-%)
distclean
:
clean
distclean
:
clean
rm
-f
*
/_info
rm
-f
*
/_info
...
@@ -19,13 +22,10 @@ $(ALL_DEPENDS): $(ALL_DIRS:=/_info)
...
@@ -19,13 +22,10 @@ $(ALL_DEPENDS): $(ALL_DIRS:=/_info)
$(ALL_DEPENDS)
:
%/.depends: tools/ccan_depends
$(ALL_DEPENDS)
:
%/.depends: tools/ccan_depends
tools/ccan_depends
$*
>
$@
||
(
rm
-f
$@
;
exit
1
)
tools/ccan_depends
$*
>
$@
||
(
rm
-f
$@
;
exit
1
)
foo
:
echo
$(ALL_LIBS)
$(ALL_LIBS)
:
$(ALL_LIBS)
:
$(
AR)
r
$@
$^
$(
LD)
-r
-o
$@
$^
/dev/null
test-ccan/%
:
tools/run_tests ccan/
lib%.a
test-ccan/%
:
tools/run_tests ccan/
%.o
@
echo
Testing
$*
...
@
echo
Testing
$*
...
@
if
tools/run_tests
$(V)
ccan/
$*
|
grep
^
'not ok'
;
then
exit
1
;
else
exit
0
;
fi
@
if
tools/run_tests
$(V)
ccan/
$*
|
grep
^
'not ok'
;
then
exit
1
;
else
exit
0
;
fi
...
@@ -36,13 +36,13 @@ clean: tools-clean
...
@@ -36,13 +36,13 @@ clean: tools-clean
$(RM)
inter-depends lib-depends test-depends
$(RM)
inter-depends lib-depends test-depends
inter-depends
:
$(ALL_DEPENDS)
inter-depends
:
$(ALL_DEPENDS)
for
f
in
$(ALL_DEPENDS)
;
do
echo
test-ccan/
`
basename
\`
dirname
$$
f
\`
`
:
`
sed
-n
's,ccan/\(.*\),ccan/
lib\1.a
,p'
<
$$
f
`
;
done
>
$@
for
f
in
$(ALL_DEPENDS)
;
do
echo
test-ccan/
`
basename
\`
dirname
$$
f
\`
`
:
`
sed
-n
's,ccan/\(.*\),ccan/
\1.o
,p'
<
$$
f
`
;
done
>
$@
test-depends
:
$(ALL_DEPENDS)
test-depends
:
$(ALL_DEPENDS)
for
f
in
$(ALL_DEPENDS)
;
do
echo
test-ccan/
`
basename
\`
dirname
$$
f
\`
`
:
`
sed
-n
's,ccan/\(.*\),test-ccan/\1,p'
<
$$
f
`
;
done
>
$@
for
f
in
$(ALL_DEPENDS)
;
do
echo
test-ccan/
`
basename
\`
dirname
$$
f
\`
`
:
`
sed
-n
's,ccan/\(.*\),test-ccan/\1,p'
<
$$
f
`
;
done
>
$@
lib-depends
:
$(foreach D
,
$(ALL)
,
$(wildcard $D/*.[ch]))
lib-depends
:
$(foreach D
,
$(ALL)
,
$(wildcard $D/*.[ch]))
for
c
in
$(ALL)
;
do
echo
ccan/
lib
$$
c.a
:
`
ls
ccan/
$$
c/
*
.c |
grep
-v
/_info.c |
sed
's/.c$$/.o/'
`
;
done
>
$@
for
c
in
$(ALL)
;
do
echo
ccan/
$$
c.o
:
`
ls
ccan/
$$
c/
*
.c |
grep
-v
/_info.c |
sed
's/.c$$/.o/'
`
;
done
>
$@
include
tools/Makefile
include
tools/Makefile
-include
inter-depends
-include
inter-depends
...
...
tools/run_tests.c
View file @
8bffc641
...
@@ -106,14 +106,11 @@ static int build(const char *dir, const char *name, int fail)
...
@@ -106,14 +106,11 @@ static int build(const char *dir, const char *name, int fail)
char
**
deps
;
char
**
deps
;
for
(
deps
=
get_deps
(
objs
,
dir
);
*
deps
;
deps
++
)
{
for
(
deps
=
get_deps
(
objs
,
dir
);
*
deps
;
deps
++
)
{
char
*
end
;
if
(
!
strstarts
(
*
deps
,
"ccan/"
))
if
(
!
strstarts
(
*
deps
,
"ccan/"
))
continue
;
continue
;
end
=
strrchr
(
*
deps
,
'/'
)
+
1
;
/* ccan/foo -> ccan/foo.o */
/* ccan/foo -> ccan/libfoo.a */
externals
=
talloc_asprintf_append
(
externals
,
" %s.o"
,
*
deps
);
externals
=
talloc_asprintf_append
(
externals
,
" ccan/lib%s.a"
,
end
);
}
}
cmd
=
talloc_asprintf
(
name
,
"gcc "
CFLAGS
" %s -o %s %s %s%s%s"
,
cmd
=
talloc_asprintf
(
name
,
"gcc "
CFLAGS
" %s -o %s %s %s%s%s"
,
...
...
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