discuss-gnustep
[Top][All Lists]
Advanced

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

Configuration at "make-time"


From: Stefan Kleine Stegemann
Subject: Configuration at "make-time"
Date: Tue, 7 Jun 2005 18:10:07 +0200

Hi,

I had a discussion with Nicola about GNUmakefiles and detection of
external libraries.
He pointed out that this might be interesting for others too so I
forward my mail together
with his answer to the list.

Original Mail from me:
----------------------------------
as you are a makefile expert :-), would you mind revisiting one of my
GNUmakefiles?
You can access it at
http://svn.gna.org/viewcvs/gsimageapps/trunk/Frameworks/PopplerKit/

Background:
I'm using a little script "config.sh" that generates a file
"config.make" which is then included by the GNUmakefile. config.sh
detects the poppler and freetype libraries.
Rationale from "docs/Installation.text"

PopplerKit uses a shell-script "config.sh" to detect the required libraries.
This script writes a file called "config.make" which is included by the 
GNUmakefiles. It's a simpler approach than the usual autgen/automake
based approach with the "configure" script. PoppleKit does not use
configure because the GNUstep build process is nice, clean and simple
and I didn't wanted to "pollute" it by adding a configure script. The
shell-script
is the simples approach that works and it also works on all Unix
platforms (even on Windows, if you have a Unix-shell installed).

However, I have the feeling that the way this is currently solved is
somewhat akward. I would prefer to run config.sh every time make is
invoked but I don't now how to achieve this.

as you are a makefile expert :-), would you mind revisiting one of my
GNUmakefiles?
You can access it at
http://svn.gna.org/viewcvs/gsimageapps/trunk/Frameworks/PopplerKit/

Background:
I'm using a little script "config.sh" that generates a file
"config.make" which is then included by the GNUmakefile. config.sh
detects the poppler and freetype libraries.
Rationale from "docs/Installation.text"

PopplerKit uses a shell-script "config.sh" to detect the required
libraries. This script writes a file called "config.make" which is
included by the
GNUmakefiles. It's a simpler approach than the usual autgen/automake based
approach with the "configure" script. PoppleKit does not use configure because
the GNUstep build process is nice, clean and simple and I didn't
wanted to "pollute"
it by adding a configure script. The shell-script is the simples
approach that works
and it also works on all Unix platforms (even on Windows, if you have
a Unix-shell
installed).

However, I have the feeling that the way this is currently solved is
somewhat akward. I would prefer to run config.sh every time make is
invoked but I don't now how to achieve this.

Answer from Nicola:
----------------------------------
> However, I have the feeling that the way this is currently solved is
> somewhat akward. I would prefer to run config.sh every time make is
> invoked but I don't now how to achieve this.

Ahm ... actually I think the solution you currently have is pretty good.
:-)

I feel it would be a lot more clumsy to run config.sh every time you
compile.

If you run config.sh every time that make is invoked, you slow down
compilation a lot.  config.sh is very slow.  Imagine you recompile just
because you changed a line in a file, you want things to get compiled very
fast ... you don't want to run config.sh every time ... the library flags
won't change.

Obviously you are entitled to have a different opionion ;-) or maybe there
is a special reason (eg, the library flags do change extremely often) why
you want to run config.sh every time 'make' is done, but as a user and
assuming there are no other things I don't know about, I prefer the config
step to be done once at the beginning (preferably automatically, but your
code already does that!), and then compilation to go fast without
reconfiguring.

Currently, you create config.make when 'make' is typed for the first time
... then you delete it when 'make clean' or 'make distclean' is used.

Maybe you could even delete it only on 'make distclean', but I understand
if you want to delete it on 'make clean' as well.

Anyway, it looks really good to me ... so I would recommend keeping what
you have :-)

... but if you really want to reconfigure everything every time 'make' is
run, you can remove the line creating config.make, then add

before-all::
       ./config.sh

That should work ;-)

PS: if you have after-clean::, you don't need after-distclean::.  'make
distclean' runs 'make clean' first, then does the additional distclean
operations. ;-)

---------------------------------------------

I finally decided to go with the current approach described in the
first mail.

greets
Stefan

-- 
Stefan Kleine Stegemann
Mail: stefankst at gmail.com
Home: http://rzserv2.fhnon.de/~lg017420




reply via email to

[Prev in Thread] Current Thread [Next in Thread]