LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-21-2010, 02:17 PM   #1
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Rep: Reputation: 30
Getting a list of file install locations with make install?


I have a bit of a problem and the only solution I can think of at the moment is a very tedious one, so I was hoping there would be a better way. What I am trying to do is cross compile the PPPD program so that I can install it on an embedded system (this system does not have make/gcc on it). It was easy to cross compile it, but I can not run "make install" since I'm compiling on a secondary machine. I don't want to install PPPD on this secondary machine (I couldn't anyway, because it was compiled for a different architecture) and I can't run make install on the target machine because there is no make/build system for it.


So it seems like what I would have to do is to manually copy over each compiled file from the build machine to the appropriate location of the target machine. And the only way (that I know of) to figure out how to do this is to manually examine the Makefiles (yes, there are several for PPPD) and figure out which file should go where on the target system. This isn't trivial because it uses a hierarchy of makefiles and the probability of human error for this method is high.


Is it possible that I could run another command that would give me a list of all the commands that make install would perform? Or a list of all files and their target location for "make install"? Or possibly some other solution that I am completely unaware of that would make this task not so painful and error prone?
 
Old 12-21-2010, 02:30 PM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by R00ts View Post
I have a bit of a problem and the only solution I can think of at the moment is a very tedious one, so I was hoping there would be a better way. What I am trying to do is cross compile the PPPD program so that I can install it on an embedded system (this system does not have make/gcc on it). It was easy to cross compile it, but I can not run "make install" since I'm compiling on a secondary machine. I don't want to install PPPD on this secondary machine (I couldn't anyway, because it was compiled for a different architecture) and I can't run make install on the target machine because there is no make/build system for it.


So it seems like what I would have to do is to manually copy over each compiled file from the build machine to the appropriate location of the target machine. And the only way (that I know of) to figure out how to do this is to manually examine the Makefiles (yes, there are several for PPPD) and figure out which file should go where on the target system. This isn't trivial because it uses a hierarchy of makefiles and the probability of human error for this method is high.


Is it possible that I could run another command that would give me a list of all the commands that make install would perform? Or a list of all files and their target location for "make install"? Or possibly some other solution that I am completely unaware of that would make this task not so painful and error prone?
Export your embedded system filesystem through NFS - then you'll be able to install running 'make install'; you'll need to give 'configure'

Code:
--prefix=/embedded/system/nfs/mount/point/desired/location
.
 
Old 12-21-2010, 02:33 PM   #3
tsg
Member
 
Registered: Mar 2008
Posts: 155

Rep: Reputation: 30
You could try using something like CheckInstall which creates a package from a "make install".
 
Old 12-21-2010, 02:52 PM   #4
ordinary
Member
 
Registered: Apr 2007
Location: the Rocket City
Distribution: Debian, Ubuntu, CentOS; in days past Fedora, Solaris, SunOS, 4.2BSD, 4.3BSD, SVR4, AIX, HP-UX
Posts: 101

Rep: Reputation: Disabled
According to the make man page:
Quote:
-n, --just-print, --dry-run, --recon
Print the commands that would be executed, but do not execute them.
Would that help?

What I mean is, run make install -n on the development machine to figure out what make install moves where, then reproduce that on the target machine manually or by some script.

Last edited by ordinary; 12-21-2010 at 02:56 PM. Reason: typo
 
Old 12-21-2010, 02:58 PM   #5
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Original Poster
Rep: Reputation: 30
Ack, can't believe I failed to find that in the man page. FML RTFM Thanks everyone, all great solutions to my problem. I believe I can take care of this now.
 
Old 12-21-2010, 05:02 PM   #6
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by R00ts View Post
Ack, can't believe I failed to find that in the man page. FML RTFM Thanks everyone, all great solutions to my problem. I believe I can take care of this now.
Since I'm building from source more than 300 targets, I know that 'make install' is not always just copying files, sometimes pretty sophisticated commands are run, including compilation and linking. So, as I suggested, you better run 'make install' for real.

An excerpt of 'make install' screen output for ImageMagick:


Code:
libtool: install: (cd /mnt/sdb8/sergei/AFSWD_debug/build/ImageMagick-6.6.4-10; /mnt/sdb8/sergei/AFSWD_debug/20101209/bash-4.1/bin/bash /mnt/sdb8/sergei/AFSWD_debug/build/Imag
eMagick-6.6.4-10/libtool  --silent --tag CC --mode=relink gcc -std=gnu99 -std=gnu99 -fopenmp -g -O2 -Wall -pthread -no-undefined -export-symbols-regex ".*" -version-info 4:0:
0 -L/mnt/sdb8/sergei/AFSWD_debug/20101209/GConf-2.24.0/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/ORBit2-2.14.18/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/XML-Parser-2.40/
lib/perl5/site_perl/5.10.0/i586-linux-thread-multi/auto/XML/Parser/Expat -L/mnt/sdb8/sergei/AFSWD_debug/20101209/atk-1.30.0/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/autoge
n-5.10/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/binutils-2.21/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/bison-2.4.3/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/bzip2-1.0
.6/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/c-ares-1.7.3/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/cairo-1.8.10/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/cloog-ppl-0.1
5.9/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/cups-1.4.5-source/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/curl-7.21.3/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/dbus-1.2
.24/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/dbus-glib-0.86/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/djvulibre-3.5.22/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/expat-
2.0.1/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/fftw3_sse2-3.2.2/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/flex-2.5.35/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/fontcon
fig-2.8.0/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/freetype-2.4.4/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/gcc-4.4.5/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/gcc-4.4
.5/lib/gcc/i686-pc-linux-gnu/4.4.5 -L/mnt/sdb8/sergei/AFSWD_debug/20101209/gd-2.0.35/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/gettext-0.18/lib -L/mnt/sdb8/sergei/AFSWD_deb
ug/20101209/ghostscript-8.71/lib/ghostscript/8.71 -L/mnt/sdb8/sergei/AFSWD_debug/20101209/glib-2.24.2/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/glpk-4.44/lib -L/mnt/sdb8/se
rgei/AFSWD_debug/20101209/gmp-4.3.2/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/gnome-vfs-2.24.3/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/gnutls-2.10.4/lib -L/mnt/sdb8/ser
gei/AFSWD_debug/20101209/graphviz-2.26.3/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/gtk+-2.20.1/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/gtk+-2.20.1/lib/gtk-2.0/2.10.0/en
gines -L/mnt/sdb8/sergei/AFSWD_debug/20101209/gtk+-2.20.1/lib/gtk-2.0/2.10.0/immodules -L/mnt/sdb8/sergei/AFSWD_debug/20101209/gtk+-2.20.1/lib/gtk-2.0/2.10.0/loaders -L/mnt/s
db8/sergei/AFSWD_debug/20101209/gtk+-2.20.1/lib/gtk-2.0/2.10.0/printbackends -L/mnt/sdb8/sergei/AFSWD_debug/20101209/gtk+-2.20.1/lib/gtk-2.0/modules -L/mnt/sdb8/sergei/AFSWD_
debug/20101209/guile-1.8.7/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/ilmbase-1.0.1/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/jasper-1.900.1/lib -L/mnt/sdb8/sergei/AFSWD_d
ebug/20101209/jbig2dec-0.11/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/jbigkit-2.0/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/lcms-2.0/lib -L/mnt/sdb8/sergei/AFSWD_debug/20
101209/libIDL-0.8.14/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/libart_lgpl-2.3.21/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/libbonobo-2.24.3/lib -L/mnt/sdb8/sergei/AFSWD_
debug/20101209/libcroco-0.6.2/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/libelf-0.8.13/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/libfpx-1.3.0-0/lib -L/mnt/sdb8/sergei/AFSW
D_debug/20101209/libgcrypt-1.4.6/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/libgpg-error-1.8/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/libgsf-1.14.18/lib -L/mnt/sdb8/serge
i/AFSWD_debug/20101209/libiconv-1.13.1/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/libiconv_pre-1.13.1/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/libjpeg-8b/lib -L/mnt/sdb8/
sergei/AFSWD_debug/20101209/libpng-1.4.5/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/librsvg-2.32.1/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/libtasn1-2.9/lib -L/mnt/sdb8/s
ergei/AFSWD_debug/20101209/libtool-2.4/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/libwmf-0.2.8.4/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/libwmf-0.2.8.4/lib/gtk-2.0/2.10.
0/loaders -L/mnt/sdb8/sergei/AFSWD_debug/20101209/libxml2-2.7.8/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/lzo-2.03/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/mpc-0.8.2/lib
 -L/mnt/sdb8/sergei/AFSWD_debug/20101209/mpeg2dec-0.4.1/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/mpfr-2.4.2/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/ncurses-5.7/lib -L/
mnt/sdb8/sergei/AFSWD_debug/20101209/ocaml-3.12.0/lib/ocaml -L/mnt/sdb8/sergei/AFSWD_debug/20101209/ocaml-3.12.0/lib/ocaml/camlp4 -L/mnt/sdb8/sergei/AFSWD_debug/20101209/ocam
l-3.12.0/lib/ocaml/labltk -L/mnt/sdb8/sergei/AFSWD_debug/20101209/ocaml-3.12.0/lib/ocaml/ocamlbuild -L/mnt/sdb8/sergei/AFSWD_debug/20101209/ocaml-3.12.0/lib/ocaml/ocamldoc -L
/mnt/sdb8/sergei/AFSWD_debug/20101209/ocaml-3.12.0/lib/ocaml/site-lib/findlib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/ocaml-3.12.0/lib/ocaml/stublibs -L/mnt/sdb8/sergei/AFSWD
_debug/20101209/ocaml-3.12.0/lib/ocaml/threads -L/mnt/sdb8/sergei/AFSWD_debug/20101209/ocaml-3.12.0/lib/ocaml/vmthreads -L/mnt/sdb8/sergei/AFSWD_debug/20101209/openexr-1.6.1/
lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/openssl-1.0.0c/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/openssl-1.0.0c/lib/engines -L/mnt/sdb8/sergei/AFSWD_debug/20101209/pang
o-1.28.1/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/pango-1.28.1/lib/pango/1.6.0/modules -L/mnt/sdb8/sergei/AFSWD_debug/20101209/pcre-8.10/lib -L/mnt/sdb8/sergei/AFSWD_debug
/20101209/pixman-0.18.2/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/poppler-0.14.5/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/popt-1.16/lib -L/mnt/sdb8/sergei/AFSWD_debug/20
101209/ppl-0.10.2/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/readline-6.1/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/tcl-8.5.9/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/t
cl-8.5.9/lib/expect5.44.1.14 -L/mnt/sdb8/sergei/AFSWD_debug/20101209/tiff-3.9.1/lib -L/mnt/sdb8/sergei/AFSWD_debug/20101209/zlib-1.2.5/lib -L/mnt/sdb8/sergei/AFSWD_debug/2010
1209/libxml2-2.7.8/lib -o wand/libMagickWand.la -rpath /mnt/sdb8/sergei/AFSWD_debug/20101209/ImageMagick-6.6.4-10/lib wand/wand_libMagickWand_la-animate.lo wand/wand_libMagic
kWand_la-compare.lo wand/wand_libMagickWand_la-composite.lo wand/wand_libMagickWand_la-conjure.lo wand/wand_libMagickWand_la-convert.lo wand/wand_libMagickWand_la-deprecate.l
o wand/wand_libMagickWand_la-display.lo wand/wand_libMagickWand_la-drawing-wand.lo wand/wand_libMagickWand_la-identify.lo wand/wand_libMagickWand_la-import.lo wand/wand_libMa
gickWand_la-magick-image.lo wand/wand_libMagickWand_la-magick-property.lo wand/wand_libMagickWand_la-magick-wand.lo wand/wand_libMagickWand_la-mogrify.lo wand/wand_libMagickW
and_la-montage.lo wand/wand_libMagickWand_la-pixel-iterator.lo wand/wand_libMagickWand_la-pixel-wand.lo wand/wand_libMagickWand_la-stream.lo wand/wand_libMagickWand_la-wand.l
o wand/wand_libMagickWand_la-wand-view.lo magick/libMagickCore.la -lSM -lICE -lX11 -lgomp -lm )
 
Old 12-22-2010, 01:55 AM   #7
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
src2pkg might be the solution for you. It configures, compiles and builds packages from many different kinds of sources. It uses a forked version of installwatch(libsentry) to track file creation and modification. libsentry includes a utility which will simply list all files created or modified, if you prefer to handle packaging/copying yourself. It really shines for sources which don't support DESTDIR and handles python, perl, tcl, qmake, imake, jam, scons and lots of other weird config methods:
http://distro.ibiblio.org/pub/linux/...nload/src2pkg/
 
Old 12-22-2010, 12:44 PM   #8
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Run
Code:
./configure --prefix=/some/special/directory/that/exists
make 
make install
Everything should be installed at the specified target directory, from where it can be copied/moved.

--- rod.
 
Old 12-22-2010, 01:12 PM   #9
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by theNbomr View Post
Run
Code:
./configure --prefix=/some/special/directory/that/exists
make 
make install
Everything should be installed at the specified target directory, from where it can be copied/moved.

--- rod.
Well, your suggestion is essentially equivalent to mine; sometimes library paths are absolute, so on target system one will have to make symbolic links to resolve directory paths.

The OP can also export his/her development machine directories through NFS and import them in the embedded system. In such a case he/she has practically unlimited disk space and native compiler (residing in the exported NFS) can be used for everything, though it will be slower.
 
  


Reply

Tags
makefile



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting a list of file install locations with make install? R00ts Linux - General 3 12-22-2010 03:48 AM
Shell script to install list of packages in a file jayasekar Linux - Software 4 01-22-2010 01:56 AM
how to install rpm packages of the same version in multiple locations bvpurandare Linux - General 2 03-18-2009 04:14 PM
Rtirq script install locations?? stratotak Linux - Newbie 0 02-25-2009 12:39 AM
install perl File::List module on sarge cccc Debian 1 05-31-2006 06:43 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration