4

Can someone please fill me in on how one would go about building a Makefile to compile *.d sources with gdc?

Specifically, I have built the Android NDK, gcc, binutils with D support via GDC (had to modify some of libphobos to support Bionic better), and I would like to use ndk-build to compile that, however I'm stuck on the Makefile part of it. Or specifically Android.mk... either way would be nice.

I've tried invoking the compiler directly, but none of the include/lib folders are obvious within the structure of the NDK.

dwerner
  • 6,462
  • 4
  • 30
  • 44
  • To clarify things: You want to know how to add support to the android ndk so that the usual Android.mk build process used for C/C++ projects will also work for D projects? Or are we talking about a makefile to build the compiler/binutils? – jpf Jul 19 '11 at 15:46
  • I got GDC compiled together with the NDK, with the intention of trying to use it with the NDK. The part I am trying to figure out currently is to hook it into ndk-build/gnumake system. (Though I'd also just like to be able to test the compiler.) So what does the compiler need at a minimum to go through the parse, assemble, link process? When I try to compile anything by executing the compiler directly, I get a different ld telling me it can't find -lrt (real time extensions, like pthreads, have been included in Bionic, so I'm not sure it needs to look for this) – dwerner Jul 19 '11 at 17:05
  • There's a STANDALONE-TOOLCHAIN.HTML file in the ndk which describes how to use the compiler without the android build system. Should be good enough to test small example programs.I don't know how to integrate d with the ndk-build system though. – jpf Jul 19 '11 at 19:01
  • Perhaps the issues I'm having directly invoking the compiler are to blame for me asking the question. I'll test the compiler and get this part of adding support to ndk-build done after. Thanks for the help. – dwerner Jul 19 '11 at 21:06

1 Answers1

3

I am far from an expert in GNU Make, but I don't see how it would be any different than building a C or C++ project. If you want an example of how to make it work in a non-trivial project, GtkD's makefile would probably be useful.

dsimcha
  • 67,514
  • 53
  • 213
  • 334