help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem generating dependency files


From: Philip Guenther
Subject: Re: Problem generating dependency files
Date: Wed, 5 May 2010 13:59:49 -0700

On Wed, May 5, 2010 at 2:47 AM, nature <address@hidden> wrote:
> I am trying to generate dependency files.
>
> here is a part of my makefile
>
> ###################Dependency file generation##############################
> #$(call make-depend,source-file,object-file,depend-file)
> define make-depend
...
> $(OBJ1):%.o:%.c
>       address@hidden "Compling $<"
>        $(call make-depend,$<,$@,$(subst .o,.d,$@))
>        $(CC) -c $< -o $@
>
> Somehow it is unable to generate .d files. When i execute the make file, it
> throws the following error
> : No such file or directoryh: line 1: aes.d.tmp
> c:\WINNT\gmake.exe: *** [aes.o] Error 1
>
> I am unable to figure out what is causing this error..
>
> Can anyone help me identify the problem?

Looks to me like the main problem is complexity.  To quote Brian
Kernighan of K&R fame: "Debugging is twice as hard as writing the code
in the first place. Therefore, if you write the code as cleverly as
possible, you are, by definition, not smart enough to debug it."

Step 1) figure out what commands you can *manually* invoke at the
shell to get the desired behavior.

Step 2) make those commands work for a single file with just an
explicit rule and no $(call)ing of macros.

Step 3) make that work with a pattern rule.

Step 4) decide whether there's some problem with the Makefile that
requires additional changes.


Philip Guenther




reply via email to

[Prev in Thread] Current Thread [Next in Thread]