GHC: Discovery of source dependencies without --make

Hi everyone, I've got another problem in our – admittedly complex – build process (for context, see [0]). Anyway, I'm struggling with the following: I have an 'out' folder which contains .hi and .o files from previous compilation stages. I now want to compile a bunch of .hs files which depend on the modules from previous stages. I can just say ghc -c -iout -outputdir out File1.hs File2.hs ... which works nicely if File*.hs are independent of each other, or are already topologically sorted wrt dependencies. If not, compilation of 'File1.hs' will fail when importing 'File2'. However, I can't make it to work if I don't know their precise ordering in advance. I tried ghc -c --make -iout -outputdir out ... but apparently '--make' makes GHC ignore .hi files in the 'out' folder. (Not even '-hidir' makes it respect them.) Reading a bit further, I discovered the '-M' flag, however, not only does it output Makefile-formatted output, it also ignores .hi files. Is there any way to get the dependency discovery of '--make' without the rest? Or alternatively, to get '--make' to not just respect source files [1]? I know I could probably make it work if I made a package out of the previous build products, but I really want to avoid that in order to not increase the build complexity even further. Cheers Lars [0] http://article.gmane.org/gmane.comp.lang.haskell.cafe/113016 [1] After reading the section on "the search path" (§4.7.3, https://downloads.haskell.org/~ghc/7.6.3/docs/html/users_guide/separate-comp...), that doesn't seem to be possible.

Hi Lars, Am Montag, den 24.11.2014, 21:28 +0100 schrieb Lars Hupel:
Is there any way to get the dependency discovery of '--make' without the rest? Or alternatively, to get '--make' to not just respect source files [1]?
I don’t have an answer for you right now, but you might have more luck asking on the glasgow-haskell-users@haskell.org mailing list (more GHC experts, less other noise), and you might be able to motivate people to play around if you provide examples files and commands to reproduce the problem – after all, there might be a bug in GHC, and bug reports should be reproducible. Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org
participants (2)
-
Joachim Breitner
-
Lars Hupel