[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: how to use already existing .d files
From: |
Swapna Pawar |
Subject: |
RE: how to use already existing .d files |
Date: |
Fri, 6 Dec 2013 09:48:14 +0000 |
Hi,
>>Without a complete and reproducible example, I don't see how you can be
>>helped by others then.
We have attached one example with makefiles along with the sample .c file and
.h files.
Password for the attached zip is: 123
There are two makefiles in the zip,
- one with the dependency rule (filename - makefile1)
- the other one without the dependency rule (filename - makefile2)
We have added two includes in the source file
- one within the same directory structure where 'makefile' file exists
- the other one outside the directory structure. (please change the include
path in the source file as well as in the makefiles as per your directory
structure)
Keep the 'inside.h' header file in the same directory structure where
'makefile' file exists.
and the 'outside.h' header file need to be placed anywhere else (same as
mentioned in the source file) other than the makefile directory.
Step 1:
- Rename 'makefile1' to 'makefile'
- Run the first makefile(i.e.makefile1) using 'make all' command
- First, it will generate .o and .d files
Step 2:
- Rename 'makefile2' to 'makefile'
- Run the second makefile (i.e. makefile2) using 'make all' command
- this time, it will not generate the dependency (.d) files
- Now modify any header file (i.e. inside.h, outside.h)
- Then run 'make all' command
- Here, no file is re-built even after the .h files are modified
Regards,
Swapna
-----Original Message-----
From: Philip Guenther [mailto:address@hidden
Sent: 06 December 2013 AM 11:49
To: Swapna Pawar
Cc: address@hidden
Subject: Re: how to use already existing .d files
On Thu, Dec 5, 2013 at 9:25 PM, Swapna Pawar <address@hidden> wrote:
> Thank you for the quick response.
>
> We have already tried this by adding the following rule:
>
> %.o: %.c
> gcc -c -x c -o "$@" $<"
>
> Modifying the rule as above does not use the existing .d files and does not
> rebuild the .c file in case any required header is modified.
> In addition to the above rule, we also tried using '-include $(C_DEPS), not
> no luck..
Without a complete and reproducible example, I don't see how you can be helped
by others then.
Philip Guenther
This message contains information that may be privileged or confidential and is
the property of the KPIT Technologies Ltd. It is intended only for the person
to whom it is addressed. If you are not the intended recipient, you are not
authorized to read, print, retain copy, disseminate, distribute, or use this
message or any part thereof. If you receive this message in error, please
notify the sender immediately and delete all copies of this message. KPIT
Technologies Ltd. does not accept any liability for virus infected mails.
Makefile_Example.zip
Description: Makefile_Example.zip