extending --make
S.D.Mechveliani
mechvel@math.botik.ru
Thu, 31 May 2001 12:31:39 +0400
Hello,
I have a whish for the GHC `making' possibilities.
ghc-5* -package-name --make
is said trying to replace Makefile. But it is half-successful.
* First, it needs -ohi option working
(to move .hi -s to chosen directory).
* Second, could GHC provide options for creating libraries,
adding to library?
Explanation.
With ghc-4, I used Makefile and -odir, -ohi options to provide
the project installation.
Makefile contained
(1)
the project directory tree description,
variables holding the list of names for the .hs, .hi, .o files,
rules to convert .hs --> .o, and such.
Also it contained the library creation part:
(2)
foo: $(objectFiles)
ar -q export/libHSfoo.a `ls export/*.o`
ranlib export/libHSfoo.a
rm -f `ls export/*.o`
-------------------
Now, with ghc-5, I apply
ghc -package-name foo -odir export ... --make ..
The part (1) cancels due to --make.
Further, as ghc-5 observes in the package specification
library_dirs = [".../export"]
hs_libraries = ["libHSfoo"],
then, it can understand what library file is to be created - on
demand.
If ghc -c provided also the options like -addto-lib -a,
-addto-lib -o,
...
then it could `make' for the given package _with_ adding to
library. So, GHC would be able to simplify Makefile to package
setting.
The matter is that Makefile has a strange language, far from
Haskell. Also why the Haskell user has to study library creation
with `ar', `ranlib, `ld'? This, and Makefile look rather like a
system hackering.
Regards,
-----------------
Serge Mechveliani
mechvel@botik.ru