www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Makefile, compilation and linkage

reply Pedro Lacerda <pslacerda gmail.com> writes:
--0015175cd130a2618404b888401a
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: base64

SGkgYWxsLAoKTXkgZGlyZWN0b3J5IHRyZWU6Cgpwcm9qLwrilJzilIDilIAgTWFrZWZpbGUK4pSc
4pSA4pSAIGJpbi8K4pSc4pSA4pSAIEMvCuKUgiAgIOKUlOKUgOKUgCBldi5oCuKUnOKUgOKUgCBk
ZWltb3MvCuKUgiAgIOKUlOKUgOKUgCBldi5kCuKUlOKUgOKUgCBwcm9qLwogICAg4pSU4pSA4pSA
IG1haW4uZAoKSW4gbXkgbWFrZWZpbGUgSSB3YW50OgoKICAgLSBjb21waWxlIGRlaW1vcy9ldi5k
CiAgIC0gY29tcGlsZSBwcm9qL21haW4uZAogICAtIGxpbmsgYWxsIHRvZ2V0aGVyIGluIGJpbi8K
CkRvIHlvdSBoYXZlIHNvbWUgc3VnZXN0aW9uPwo=
--0015175cd130a2618404b888401a
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi all,<div><br></div><div>My directory tree:</div><div><br></div><div><div=
proj/</div><div>=E2=94=9C=E2=94=80=E2=94=80 Makefile</div><div>=E2=94=9C=

=E2=94=82 =C2=A0 =E2=94=94=E2=94=80=E2=94=80 ev.h</div><div>=E2=94=9C=E2=94= =80=E2=94=80 deimos/</div><div>=E2=94=82 =C2=A0 =E2=94=94=E2=94=80=E2=94=80= ev.d</div><div>=E2=94=94=E2=94=80=E2=94=80 proj/</div> <div>=C2=A0 =C2=A0 =E2=94=94=E2=94=80=E2=94=80 main.d</div></div><div><div>= <br></div><div>In my makefile I want:</div><div><ul><li>compile deimos/ev.d= </li><li>compile proj/main.d</li><li>link all together in bin/</li></ul></d= iv><div>Do you have some sugestion?</div> <br> </div> --0015175cd130a2618404b888401a--
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