digitalmars.D.learn - Simple makefile problem - implicit rule
- deed (12/12) Jan 09 2013 # makefile -----------
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (5/6) Jan 09 2013 Your post has spaces at the beginning on that line. (Thunderbird removes...
- deed (3/9) Jan 09 2013 Yeah, that's not the problem. Replacing %.obj and %.d with
- deed (1/3) Jan 09 2013 And $< with main.d
- Matthew Caron (24/27) Jan 09 2013 don't know what make you're using, but this works for me:
- deed (9/10) Jan 09 2013 I'am using the make.exe coming with the DMD 2.061 distro in
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (4/16) Jan 09 2013 Assuming that this is for GNU make, ensuring that the rule starts with a...
- deed (1/5) Jan 09 2013 It is Digital Mars Make Version 5.06 and it's on Windows 7.
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (8/13) Jan 09 2013 That's why you didn't mark the subject with [OT]. ;) It looks like the
OBJS = main.obj othermodule.obj DC = dmd DCFLAGS = -c all : $(OBJS) %.obj : %.d $(DC) $< $(DCFLAGS) Error on line 9: expecting target : dependencies * main.d, othermodule.d and makefile are in the same folder. * make is executed in this folder from the command line Anyone cares to explain what's wrong/missing?
Jan 09 2013
On 01/09/2013 09:51 AM, deed wrote:$(DC) $< $(DCFLAGS)Your post has spaces at the beginning on that line. (Thunderbird removes those when I reply. Curse!) Target rules must start with a tab character. Ali
Jan 09 2013
On Wednesday, 9 January 2013 at 17:57:28 UTC, Ali Çehreli wrote:On 01/09/2013 09:51 AM, deed wrote:Yeah, that's not the problem. Replacing %.obj and %.d with main.obj and main.d works.$(DC) $< $(DCFLAGS)Your post has spaces at the beginning on that line. (Thunderbird removes those when I reply. Curse!) Target rules must start with a tab character. Ali
Jan 09 2013
Yeah, that's not the problem. Replacing %.obj and %.d with main.obj and main.d works.And $< with main.d
Jan 09 2013
On 01/09/2013 01:13 PM, deed wrote: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 officeYeah, that's not the problem. Replacing %.obj and %.d with main.obj and main.d works.And $< with main.d
Jan 09 2013
don't know what make you're using, [...]I'am using the make.exe coming with the DMD 2.061 distro in D/dmd2/windows/bin/ Thought/hoped the GNU spec was applicable, but if it works with GNU make and not Digital Mars make, well.. make -man leads to http://digitalmars.com/ctg/make.html, which says: Implicit Definition lines Does this give a clue?
Jan 09 2013
On 01/09/2013 09:51 AM, deed wrote:OBJS = main.obj othermodule.obj DC = dmd DCFLAGS = -c all : $(OBJS) %.obj : %.d $(DC) $< $(DCFLAGS) Error on line 9: expecting target : dependencies * main.d, othermodule.d and makefile are in the same folder. * make is executed in this folder from the command line Anyone cares to explain what's wrong/missing?Assuming that this is for GNU make, ensuring that the rule starts with a tab characters, that file works with GNU Make 3.81. Ali
Jan 09 2013
Assuming that this is for GNU make, ensuring that the rule starts with a tab characters, that file works with GNU Make 3.81. AliIt is Digital Mars Make Version 5.06 and it's on Windows 7.
Jan 09 2013
On 01/09/2013 10:19 AM, deed wrote:That's why you didn't mark the subject with [OT]. ;) It looks like the syntax is different: .d.obj: $(DC) $(DFLAGS) -c $< I got that by clicking "makefile example" here: http://www.prowiki.org/wiki4d/wiki.cgi?DigitalMarsTools#DigitalMarsLinkerandUtilities AliAssuming that this is for GNU make, ensuring that the rule starts with a tab characters, that file works with GNU Make 3.81. AliIt is Digital Mars Make Version 5.06 and it's on Windows 7.
Jan 09 2013
.d.obj: $(DC) $(DFLAGS) -c $<AliWorks like a charm! Case solved. Thank you very much!
Jan 09 2013
.d.obj: $(DC) $(DFLAGS) -c $<Alifrom http://digitalmars.com/ctg/make.html: Implicit Definition lines Isn't targ_ext .obj and dep_ext .d? If so, either the example or the documentation seems incorrect. The example provided works. The .obj is updated when .d is modified. Using .obj.d: dmd $*.d -c or .obj.d: dmd $< -c don't work. My conclusion is that the documentation at http://digitalmars.com/ctg/make.html is incorrect. It should be: Implicit Definition lines
Jan 09 2013