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
a1d06d55
Commit
a1d06d55
authored
Sep 09, 2010
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ccanlint: print out compile targets for -vv.
parent
b41f7776
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
0 deletions
+13
-0
tools/ccanlint/ccanlint.c
tools/ccanlint/ccanlint.c
+2
-0
tools/compile.c
tools/compile.c
+9
-0
tools/tools.h
tools/tools.h
+2
-0
No files found.
tools/ccanlint/ccanlint.c
View file @
a1d06d55
...
...
@@ -413,6 +413,8 @@ int main(int argc, char *argv[])
if
(
optind
<
argc
)
usage
(
argv
[
0
]);
if
(
verbose
>=
2
)
compile_verbose
=
true
;
if
(
verbose
>=
3
)
tools_verbose
=
true
;
...
...
tools/compile.c
View file @
a1d06d55
...
...
@@ -2,11 +2,16 @@
#include <ccan/talloc/talloc.h>
#include <stdlib.h>
bool
compile_verbose
=
false
;
/* Compile multiple object files into a single. Returns errmsg if fails. */
char
*
link_objects
(
const
void
*
ctx
,
const
char
*
objs
,
char
**
errmsg
)
{
char
*
file
=
temp_file
(
ctx
,
".o"
);
if
(
compile_verbose
)
printf
(
"Linking objects into %s
\n
"
,
file
);
*
errmsg
=
run_command
(
ctx
,
NULL
,
"ld -r -o %s %s"
,
file
,
objs
);
if
(
*
errmsg
)
{
talloc_free
(
file
);
...
...
@@ -20,6 +25,8 @@ char *compile_object(const void *ctx, const char *cfile, const char *ccandir,
const
char
*
extra_cflags
,
const
char
*
outfile
)
{
if
(
compile_verbose
)
printf
(
"Compiling %s
\n
"
,
outfile
);
return
run_command
(
ctx
,
NULL
,
"cc "
CFLAGS
" -I%s %s -c -o %s %s"
,
ccandir
,
extra_cflags
,
outfile
,
cfile
);
}
...
...
@@ -30,6 +37,8 @@ char *compile_and_link(const void *ctx, const char *cfile, const char *ccandir,
const
char
*
objs
,
const
char
*
extra_cflags
,
const
char
*
libs
,
const
char
*
outfile
)
{
if
(
compile_verbose
)
printf
(
"Compiling and linking %s
\n
"
,
outfile
);
return
run_command
(
ctx
,
NULL
,
"cc "
CFLAGS
" -I%s %s -o %s %s %s %s"
,
ccandir
,
extra_cflags
,
outfile
,
cfile
,
objs
,
libs
);
}
tools/tools.h
View file @
a1d06d55
...
...
@@ -43,6 +43,8 @@ bool move_file(const char *oldname, const char *newname);
* These all compile into a temporary dir, and return the filename.
* On failure they return NULL, and errmsg is set to compiler output.
*/
/* If set, say what we're compiling to. */
extern
bool
compile_verbose
;
/* Compile multiple object files into a single. */
char
*
link_objects
(
const
void
*
ctx
,
const
char
*
objs
,
char
**
errmsg
);
/* Compile a single C file to an object file. Returns errmsg if fails. */
...
...
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