Simple makefile problem - implicit rule

Matthew Caron matt.caron at redlion.net
Wed Jan 9 10:25:11 PST 2013


On 01/09/2013 01:13 PM, deed wrote:
>> Yeah, that's not the problem. Replacing %.obj and %.d with main.obj
>> and main.d works.
>
> And $< with main.d

  don't know what make you're using, but this works for me:

OBJS    = hello.obj hello_loop.obj
DC      = gdc
DCFLAGS =

all : $(OBJS)

%.obj : %.d
	$(DC) $< $(DCFLAGS) -o $@

Output:
gdc hello.d  -o hello.obj
gdc hello_loop.d  -o hello_loop.obj

and hello.obj and hello_loop.obj both exist

Note that there is a tab before $(DC).

make --version says:
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for x86_64-pc-linux-gnu

-- 
Matthew Caron, Software Build Engineer
Sixnet, a Red Lion business | www.sixnet.com
+1 (518) 877-5173 x138 office


More information about the Digitalmars-d-learn mailing list