diff mbox series

xen/build: Fix dependency for the MAP rule

Message ID 20220414162348.4808-1-andrew.cooper3@citrix.com (mailing list archive)
State Superseded
Headers show
Series xen/build: Fix dependency for the MAP rule | expand

Commit Message

Andrew Cooper April 14, 2022, 4:23 p.m. UTC
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Anthony PERARD <anthony.perard@citrix.com>
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Anthony PERARD April 14, 2022, 5:49 p.m. UTC | #1
On Thu, Apr 14, 2022 at 05:23:48PM +0100, Andrew Cooper wrote:
> diff --git a/xen/Makefile b/xen/Makefile
> index dd05672ff42d..02a274f56dc0 100644
> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -599,7 +599,7 @@ cscope:
>  	cscope -k -b -q
>  
>  .PHONY: _MAP
> -_MAP:
> +_MAP: $(TARGET)-syms

That's not going to work well as make isn't going to know how to build
$(TARGET)-syms. I guess you want to have $(TARGET) as prerequisite or
add somewhere "$(TARGET)-syms: $(TARGET)".

>  	$(NM) -n $(TARGET)-syms | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' > System.map
>  
>  %.o %.i %.s: %.c tools_fixdep FORCE

Thanks,
Andrew Cooper April 14, 2022, 6:17 p.m. UTC | #2
On 14/04/2022 18:49, Anthony PERARD wrote:
> On Thu, Apr 14, 2022 at 05:23:48PM +0100, Andrew Cooper wrote:
>> diff --git a/xen/Makefile b/xen/Makefile
>> index dd05672ff42d..02a274f56dc0 100644
>> --- a/xen/Makefile
>> +++ b/xen/Makefile
>> @@ -599,7 +599,7 @@ cscope:
>>  	cscope -k -b -q
>>  
>>  .PHONY: _MAP
>> -_MAP:
>> +_MAP: $(TARGET)-syms
> That's not going to work well as make isn't going to know how to build
> $(TARGET)-syms.

Huh... It appears to work for me, but it's parallel build so who knows.

>  I guess you want to have $(TARGET) as prerequisite or
> add somewhere "$(TARGET)-syms: $(TARGET)".

That becomes cyclic with arch/*/Makefile which has:

$(TARGET): $(TARGET)-syms

The _install rule does make the implication that a dependency on
$(TARGET) builds $(TARGET)-syms so I guess that's good enough for _MAP too.

~Andrew
diff mbox series

Patch

diff --git a/xen/Makefile b/xen/Makefile
index dd05672ff42d..02a274f56dc0 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -599,7 +599,7 @@  cscope:
 	cscope -k -b -q
 
 .PHONY: _MAP
-_MAP:
+_MAP: $(TARGET)-syms
 	$(NM) -n $(TARGET)-syms | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' > System.map
 
 %.o %.i %.s: %.c tools_fixdep FORCE