how to compile only one module from the coreutils source?



Hello everybody,

I have downloaded GNU "coreutils" source, and wondering how to compile
only one module manually?
Example, the module for the command: "cp -R " which would do a
recursive copy of a directory.
Since part of my application is to do a recursive copy of multiple
folders, thus, if I could compile only just the module I need and then
link it to my program it'll be great.!
I have looked into the file "cp.c" and it has the main() function
which I thought I could compile only the file "cp.c" using "gcc -g
-Wall -o copy cp.c -I ."
but I got a long list of error messages like:

cp.c:20:20: error: config.h: No such file or directory
In file included from cp.c:25:
system.h:57:21: error: pathmax.h: No such file or directory
system.h:59:24: error: configmake.h: No such file or directory
system.h:126:22: error: exitfail.h: No such file or directory
In file included from cp.c:25:
system.h: In function 'initialize_exit_failure':
system.h:133: error: 'exit_failure' undeclared (first use in this function)
system.h:133: error: (Each undeclared identifier is reported only once
system.h:133: error: for each function it appears in.)
system.h:239:25: error: stat-macros.h: No such file or directory
...
.....

Could anyone tell me how to compile only one module out from the
coreutils source?

Thanks,
Soulivanh



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]