Simple I know, but could use some help compiling with make

Nick Sabalausky a at a.a
Thu Sep 29 14:11:04 PDT 2011


"Roderick Gibson" <kniteli at gmail.com> wrote in message 
news:j62d4i$1d8l$1 at digitalmars.com...
> It's my first foray into the arcana of makefiles and command line 
> compiling.
>
> My makefile looks like this:
>
> IMPORT = -IC:\Dlang\dmd2\src\ext\Derelict2\import
> LIB_PATHS = -LC:\Dlang\dmd2\src\ext\Derelict2\lib
> LIB_INCLUDES = DerelictSDL.lib DerelictGL.lib DerelictUtil.lib
>
> all:
> dmd src/main.d src/display.d src/renderdata.d src/vector2d.d\
> $(IMPORT) $(LIB_PATHS) $(LIB_INCLUDES)
>
> I think I just don't know how to give the compiler what it wants. I can 
> build it manually by simply including the full paths to each of those 
> libraries, but I'd rather avoid having to do that unless necessary. Is 
> there something I'm just missing?

build.bat:
@echo off
rdmd --build-only -ofmyApp -IC:\Dlang\dmd2\src\ext\Derelict2\import -L+C:\Dlang\dmd2\src\ext\Derelict2\lib\ 
DerelictSDL.lib DerelictGL.lib DerelictUtil.lib DerelictGLU.lib src/main.d

Note:

1. After the "@echo off", that's supposed to be one line.

2. "rdmd" instead of "dmd"

3. Only one ".d" file is given: The one with main()

4. The ".d" file is the *last* param.




More information about the Digitalmars-d-learn mailing list