www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Makefile, compilation and linkage

reply Pedro Lacerda <pslacerda gmail.com> writes:
SGkgYWxsLAoKTXkgZGlyZWN0b3J5IHRyZWU6Cgpwcm9qLwrilJzilIDilIAgTWFrZWZpbGUK4pSc
4pSA4pSAIGJpbi8K4pSc4pSA4pSAIEMvCuKUgiAgIOKUlOKUgOKUgCBldi5oCuKUnOKUgOKUgCBk
ZWltb3MvCuKUgiAgIOKUlOKUgOKUgCBldi5kCuKUlOKUgOKUgCBwcm9qLwogICAg4pSU4pSA4pSA
IG1haW4uZAoKSW4gbXkgbWFrZWZpbGUgSSB3YW50OgoKICAgLSBjb21waWxlIGRlaW1vcy9ldi5k
CiAgIC0gY29tcGlsZSBwcm9qL21haW4uZAogICAtIGxpbmsgYWxsIHRvZ2V0aGVyIGluIGJpbi8K
CkRvIHlvdSBoYXZlIHNvbWUgc3VnZXN0aW9uPwo=
Feb 09 2012
parent Jacob Carlborg <doob me.com> writes:
On 2012-02-09 14:47, Pedro Lacerda wrote:
 Hi all,

 My directory tree:

 proj/
 ├── Makefile
 ├── bin/
 ├── C/
 │   └── ev.h
 ├── deimos/
 │   └── ev.d
 └── proj/
      └── main.d

 In my makefile I want:

   * compile deimos/ev.d
   * compile proj/main.d
   * link all together in bin/

 Do you have some sugestion?

Use a shell script together with RDMD. Something like: #!/bin/sh rdmd --build-only -ofbin/main -deimos "$ " proj/main.d RDMD will track all dependencies and automatically build them. If you drop the --build-only flag RDMD will run the resulting binary as well. You can pass in additional flags to the compiler as well through the shell script. -- /Jacob Carlborg
Feb 09 2012