Automake: dist-hook uninstall
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Automake: dist-hook uninstall




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Automake: dist-hook uninstall  
Andrew Smith


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-07-07 06:38 AM

Hello

I have this in my Makefile.am:

dist-hook:
if test -d pixmaps; then \
mkdir $(distdir)/pixmaps; \
for pixmap in pixmaps/*; do \
if test -f $$pixmap; then \
cp -p $$pixmap $(distdir)/pixmaps; \
fi \
done \
fi

And it works fine, except when I do 'make uninstall' the icon doesn't
get deleted. Everything else gets deleted properly.

I don't have much experience with the autotools, so I am probably not
doing something really straightforward. Please help.

Andrew





[ Post a follow-up to this message ]



    Re: Automake: dist-hook uninstall  
diksa2005@fastermail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-07-07 06:38 AM

On Dec 7, 5:14 am, Andrew Smith <n...@whe.re> wrote:
> Hello
>
> I have this in my Makefile.am:
>
> dist-hook:
>         if test -d pixmaps; then \
>           mkdir $(distdir)/pixmaps; \
>           for pixmap in pixmaps/*; do \
>             if test -f $$pixmap; then \
>               cp -p $$pixmap $(distdir)/pixmaps; \
>             fi \
>           done \
>         fi
>
> And it works fine, except when I do 'make uninstall' the icon doesn't
> get deleted. Everything else gets deleted properly.
>
> I don't have much experience with the autotools, so I am probably not
> doing something really straightforward. Please help.
>
> Andrew


Hi
I love the way you are trying in your programming work and i really
want you to use this opportunity to introduce yourself to an online
company where you can get instant assistance in all ways with this
extend you have gone. There you meet alots of programmers in all
fields of knowlegde applying for jobs by signing up free of charge,i
expected you to join them because i saw so many you are far better
than collecting contract project on daily basis. Here's the site,
http://www.getafreelancer.com/affil...essage-sms.html






[ Post a follow-up to this message ]



    Re: Automake: dist-hook uninstall  
William Pursell


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-09-07 06:25 PM

On 7 Dec, 05:14, Andrew Smith <n...@whe.re> wrote:
> Hello
>
> I have this in my Makefile.am:
>
> dist-hook:
>         if test -d pixmaps; then \
>           mkdir $(distdir)/pixmaps; \
>           for pixmap in pixmaps/*; do \
>             if test -f $$pixmap; then \
>               cp -p $$pixmap $(distdir)/pixmaps; \
>             fi \
>           done \
>         fi
>
> And it works fine, except when I do 'make uninstall' the icon doesn't
> get deleted. Everything else gets deleted properly.
>
> I don't have much experience with the autotools, so I am probably not
> doing something really straightforward. Please help.


You can avoid using a dist-hook and get that file
to be installed by putting the following in Makefile.am:

pixdir = $(datadir)/pixmaps
pix_DATA = pixmaps/icon

($datadir, by default is, $prefix/share)

This is slightly less flexible in that you can't
specify "pixaps/*", but you can do something like:

pix_DATA = $(shell ls ${srcdir}/pixmaps | sed 's@^@${srcdir}/pixma
ps/
@')

I would highly recommend against doing that.  Let
me emphasize highly.  I'm not sure why I even
mention it here, it is so heinous.
A much better solution would be to generate the
list at configure time with the following in
configure.ac:

PIXMAP_LIST=${srcdir}/pixmaps/*
AC_SUBST([PIXMAP_LIST])


and then in Makefile.am:
pix_DATA = @PIXMAP_LIST@







[ Post a follow-up to this message ]



    Re: Automake: dist-hook uninstall  
William Pursell


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-10-07 12:21 AM

On 7 Dec, 05:14, Andrew Smith <n...@whe.re> wrote:

> dist-hook:
>         if test -d pixmaps; then \
>           mkdir $(distdir)/pixmaps; \
>           for pixmap in pixmaps/*; do \
>             if test -f $$pixmap; then \
>               cp -p $$pixmap $(distdir)/pixmaps; \
>             fi \
>           done \
>         fi
>
> And it works fine, except when I do 'make uninstall' the icon doesn't
> get deleted. Everything else gets deleted properly.
>
It just occurred to me that I missed a significant
point in my previous post.  I read your 'make uninstall'
and thought you'd written 'install-hook' instead
of 'dist-hook'.    What exactly do you think
the make uninstall should do here?  'make dist'
will create a distribution tarball, and your
dist-hook would seem to be better served by
EXTRA_DIST = @file_list@
where file_list is an AC_SUBST'ed list of files
in the pixmaps directory.  In other words, dist-hook
will effect the created tar ball, while
make uninstall works on the /usr/local ($prefix)
file system.

(Also, I omitted the EXTRA_DIST in my previous post.
You will need that to get the pixmaps files into
the distribution tarball.)

Make sure you use 'make distcheck' to ensure that
everything is okay.





[ Post a follow-up to this message ]



    Re: Automake: dist-hook uninstall  
Andrew Smith


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-17-07 06:42 AM

William Pursell a écrit :
> On 7 Dec, 05:14, Andrew Smith <n...@whe.re> wrote: 
>
>
> You can avoid using a dist-hook and get that file
> to be installed by putting the following in Makefile.am:
>
> pixdir = $(datadir)/pixmaps
> pix_DATA = pixmaps/icon
>
> ($datadir, by default is, $prefix/share)
>
> This is slightly less flexible in that you can't
> specify "pixaps/*", but you can do something like:
>
> pix_DATA = $(shell ls ${srcdir}/pixmaps | sed 's@^@${srcdir}/pix
maps/
> @')
>
> I would highly recommend against doing that.  Let
> me emphasize highly.  I'm not sure why I even
> mention it here, it is so heinous.
> A much better solution would be to generate the
> list at configure time with the following in
> configure.ac:
>
> PIXMAP_LIST=${srcdir}/pixmaps/*
> AC_SUBST([PIXMAP_LIST])
>
>
> and then in Makefile.am:
> pix_DATA = @PIXMAP_LIST@
>
>

Thanks William, that worked!

I don't know why dist-hook was being used. I didn't write the autotools
files for this project.

So I removed the dist-hook and instead added:

pixdir = $(datadir)/pixmaps
pix_DATA = pixmaps/asunder.png

EXTRA_DIST = asunder.desktop pixmaps/asunder.png

I don't know why, but it works. I kind of gave up on understanding the
autotools 

Thnaks again.

Cheers,

Andrew





[ Post a follow-up to this message ]



    Re: Automake: dist-hook uninstall  
William Pursell


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-18-07 12:22 AM

On Dec 17, 3:42 am, Andrew Smith <n...@whe.re> wrote:

> pixdir = $(datadir)/pixmaps
> pix_DATA = pixmaps/asunder.png
>
> EXTRA_DIST = asunder.desktop pixmaps/asunder.png
>
> I don't know why, but it works. I kind of gave up on understanding the
> autotools 

It takes awhile to grok, but once you get a feel for it,
it's really not so bad.

The EXTRA_DIST line just tells automake to construct
the Makefile so that the listed files are included
in the distribution tarball.   The pix_DATA line
tells it that the listed files are to be installed
in pixdir.   Without the EXTRA_DIST, make will
attempt to create the pix_DATA files, and
probably fail because there will be no rule
to use.





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:02 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register