[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to install makefiles and unix scripts?
From: |
Nicola Pero |
Subject: |
Re: How to install makefiles and unix scripts? |
Date: |
Tue, 30 Jul 2002 13:43:55 +0100 (BST) |
> > > And, is it ok (without confilct with makefile.postable) to use rules
> > > before-install:: and after-install:: in library makefiles (that are going
> > > to
> > > be installed)? Or is there some another way?
> >
> > Ahm - not sure - you can add stuff to before-install:: and
> > after-install::, and it shouldn't conflict with makefile.postamble - so
> > it's fine, except I'm not sure why you want to do it :-)
> >
> > If you provide me with some code or example or explanation of what you
> > need/want to do, I might be able to suggest how to best tackle the problem
> > (which in the end might perfectly well be to use before-install:: and
> > after-install:: :-)
>
> Well, I need to install something in a makefile provided by a library where I
> use before-install and after-install rules.
> But the problem is, if user wants to use same rules in makefile.postamble.
before-install:: and after-install:: are double-colon rules, which means
there can be multiple declaration of those rules (with different commands
to execute in each declaration), not necessarily a single one (as for
normal rules) - all the provided commands in the rules are executed
independently of each other - so it will always work.
They are double-colon rules precisely for that. They are already declared
(with empty commands) in standard makefiles.
> I have tested it and it seems to work like this:
>
> at the end of GNUmakefile:
> --
> -include makefile.preamble
> include my.make
> -include makefile.postamble
>From this code snippet, I think you are creating a new project type. In
that case, you are implementing the install rule yourself. Why don't you
just put your code in the install rule (more precisely, into the
internal-xxx-install_ rule) rather than in before-install:: and
after-install::. Anyway - I don't want to confuse you :-) if you are
doing something very simple (from a makefile point of view),
before-install:: and after-install:: should work fine.