Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.development.apps > #218
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | General Schvantzkoph <schvantzkoph@yahoo.com> |
| Newsgroups | comp.os.linux.development.apps |
| Subject | Re: Make file question about the .c.o rule |
| Date | 24 Jul 2011 18:23:15 GMT |
| Lines | 25 |
| Message-ID | <99368jFjekU2@mid.individual.net> (permalink) |
| References | <993582FjekU1@mid.individual.net> <yw1x8vrn8s5c.fsf@unicorn.mansr.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 8bit |
| X-Trace | individual.net s9s5EdLAuvkTXibc9CTs5we1+A9f2XQcdcIvYer3XCbX697xyN |
| Cancel-Lock | sha1:KrVHY3girhCatLGWJ8Q5JS5FMgA= |
| User-Agent | Pan/0.133 (House of Butterflies) |
| Xref | x330-a1.tempe.blueboxinc.net comp.os.linux.development.apps:218 |
Show key headers only | View raw
On Sun, 24 Jul 2011 19:12:15 +0100, Måns Rullgård wrote:
> General Schvantzkoph <schvantzkoph@yahoo.com> writes:
>
>> How do I use the .c.o rule when the sources are in subdirectories,
>>
>> for example
>>
>> foo/src2.c
>>
>> bar/src2.c
>>
>> In my Makefile I have
>>
>> .c.o: $(HDL_COMMON_INCLUDES) ${HDL_INCLUDES} $(PMACS_INCLUDES)
>> $(CC) $(CFLAGS) -c $<
>>
>> This compiles the sources and puts the .o files in the top directory
>> rather that the subdirectory. The problem is that Make doesn't realize
>> that the .o files exist so every invocation of make builds everything.
>
> Use this command:
> $(CC) $(CFLAGS) -c -o $@ $<
Thanks
Back to comp.os.linux.development.apps | Previous | Next — Previous in thread | Find similar
Make file question about the .c.o rule General Schvantzkoph <schvantzkoph@yahoo.com> - 2011-07-24 18:05 +0000
Re: Make file question about the .c.o rule Måns Rullgård <mans@mansr.com> - 2011-07-24 19:12 +0100
Re: Make file question about the .c.o rule General Schvantzkoph <schvantzkoph@yahoo.com> - 2011-07-24 18:23 +0000
csiph-web