tools/include/xen-foreign: avoid to rely on default .SUFFIXES
authorAnthony PERARD <anthony.perard@citrix.com>
Mon, 6 Dec 2021 17:02:04 +0000 (17:02 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 16 Dec 2021 20:27:12 +0000 (20:27 +0000)
When a rule isn't a pattern rule, and thus don't have a %, the
value of the automatic variable stem $* depends on .SUFFIXES. GNU make
manual explain that it is better to avoid this "bizarre" behavior
which exist for compatibility.

Use $(basename ) instead. So we can one day avoid make's build-in
rules and variables.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
tools/include/xen-foreign/Makefile

index e395011fdd77a29f64d4384fe87526dbd80635ff..6ce51daf5eedea35a50e7c270846ecc67ff91e17 100644 (file)
@@ -25,28 +25,28 @@ check-headers: checker
        rm tmp.size
 
 arm32.h: mkheader.py structs.py $(ROOT)/arch-arm.h $(ROOT)/xen.h
-       $(PYTHON) $< $* $@.tmp $(filter %.h,$^)
+       $(PYTHON) $< $(basename $@) $@.tmp $(filter %.h,$^)
        #Avoid mixing an alignment directive with a uint64_t cast or sizeof expression
        sed 's/(__align8__ \(uint64_t\))/(\1)/g' < $@.tmp > $@.tmp2
        rm $@.tmp
        $(call move-if-changed,$@.tmp2,$@)
 
 arm64.h: mkheader.py structs.py $(ROOT)/arch-arm.h $(ROOT)/xen.h
-       $(PYTHON) $< $* $@.tmp $(filter %.h,$^)
+       $(PYTHON) $< $(basename $@) $@.tmp $(filter %.h,$^)
        #Avoid mixing an alignment directive with a uint64_t cast or sizeof expression
        sed 's/(__align8__ \(uint64_t\))/(\1)/g' < $@.tmp > $@.tmp2
        rm $@.tmp
        $(call move-if-changed,$@.tmp2,$@)
 
 x86_32.h: mkheader.py structs.py $(ROOT)/arch-x86/xen-x86_32.h $(ROOT)/arch-x86/xen.h $(ROOT)/xen.h
-       $(PYTHON) $< $* $@.tmp $(filter %.h,$^)
+       $(PYTHON) $< $(basename $@) $@.tmp $(filter %.h,$^)
        #Avoid mixing an alignment directive with a uint64_t cast or sizeof expression
        sed 's/(__align8__ \(uint64_t\))/(\1)/g' < $@.tmp > $@.tmp2
        rm $@.tmp
        $(call move-if-changed,$@.tmp2,$@)
 
 x86_64.h: mkheader.py structs.py $(ROOT)/arch-x86/xen-x86_64.h $(ROOT)/arch-x86/xen.h $(ROOT)/xen.h
-       $(PYTHON) $< $* $@.tmp $(filter %.h,$^)
+       $(PYTHON) $< $(basename $@) $@.tmp $(filter %.h,$^)
        #Avoid mixing an alignment directive with a uint64_t cast or sizeof expression
        sed 's/(__align8__ \(uint64_t\))/(\1)/g' < $@.tmp > $@.tmp2
        rm $@.tmp