Makefile, compilation and linkage
Jacob Carlborg
doob at me.com
Thu Feb 9 06:26:48 PST 2012
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
More information about the Digitalmars-d-learn
mailing list