Quote:
Originally Posted by knudfl
When coreutils-<version>/lib/configmake.h and ///src/version.h are generated,
just then it is possible to compile a standalone object, like :
gcc -std=gnu99 -I../lib -static -O2 -g -MT uniq.o -MD -MP -MF .deps/uniq.Tpo -c -o uniq.o uniq.c
But you can of course do make in the top directory, then you have the two files :
configmake.h, version.h, which you can use in another coreutils-<version>, same version.
|
So when I want compile particular binary I always must use ./configure && make in top of directory right ?
I tried just run ./configure in top of directory and neither configmake.h, version.h and neither *.o objects were generated.
It is strange for me that I also must compile whole package and only then I can compile particular binary.
Quote:
Originally Posted by gnashley
Yes you can compile individual bins from coreutils.
Jzs run configure, then cd into the various subdirs in the right order !-search the Makefile for the string 'subdir' to find the order.
Probably po m4 etc, the main ones are 'lib' which needs to be done before 'src'. Once lib and all other required ones are done, cd into src and run 'make stat(or whichever pro you want).
This is not always the case, but coreutils does have a separate Makefile rule for each binary.
|
What do you mean cd into various subdirs in the right order ? What is mp4 ?
Code:
[cepido@localhost coreutils-8.5]$ cat Makefile | grep subdir | head -3
subdir = .
# This directory's subdirectories are mostly independent; you can cd
list='$(SUBDIRS)'; for subdir in $$list; do \
[cepido@localhost coreutils-8.5]$ cat Makefile | grep SUBDIR | head -3
DIST_SUBDIRS = $(SUBDIRS)
SUBDIRS = lib src doc man po tests gnulib-tests
list='$(SUBDIRS)'; for subdir in $$list; do \
[cepido@localhost coreutils-8.5]$
You mean "lib src doc man po tests gnulib-tests" in this order ? so I tried
Code:
[cepido@localhost ~]$ cd coreutils-8.5
[cepido@localhost coreutils-8.5]$ ./configure
[cepido@localhost coreutils-8.5]$ cd lib/
[cepido@localhost lib]$ make
[cepido@localhost lib]$ cd ../src
[cepido@localhost src]$ make ls
CC ls.o
In file included from ls.c:85:0:
system.h:89:21: fatal error: version.h: No such file or directory
compilation terminated.
make: *** [ls.o] Error 1
[cepido@localhost src]$ find ../ | grep version.h
Seems version.h still missing
PS: what does mean $$list (double dolar sign in variable)