mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
acpi: Makefile should better tolerate interrupts
Intermediate stages of building a target should be made with temporary files that are copied to final target in the end. Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
dbfe4e221d
commit
837b5eefa7
1 file changed
+13
-7
@@ -22,6 +22,9 @@ OBJS = $(patsubst %.c,%.o,$(C_SRC))
|
||||
|
||||
CFLAGS += $(CFLAGS_xeninclude)
|
||||
|
||||
# Suffix for temporary files.
|
||||
TMP_SUFFIX = tmp
|
||||
|
||||
vpath iasl $(PATH)
|
||||
all: acpi.a
|
||||
|
||||
@@ -34,18 +37,21 @@ mk_dsdt: mk_dsdt.c
|
||||
$(HOSTCC) $(HOSTCFLAGS) $(CFLAGS_xeninclude) -o $@ mk_dsdt.c
|
||||
|
||||
dsdt_anycpu_qemu_xen.asl: dsdt.asl mk_dsdt
|
||||
awk 'NR > 1 {print s} {s=$$0}' $< > $@
|
||||
./mk_dsdt --debug=$(debug) --dm-version qemu-xen >> $@
|
||||
awk 'NR > 1 {print s} {s=$$0}' $< > $@.$(TMP_SUFFIX)
|
||||
./mk_dsdt --debug=$(debug) --dm-version qemu-xen >> $@.$(TMP_SUFFIX)
|
||||
mv -f $@.$(TMP_SUFFIX) $@
|
||||
|
||||
# NB. awk invocation is a portable alternative to 'head -n -1'
|
||||
dsdt_%cpu.asl: dsdt.asl mk_dsdt
|
||||
awk 'NR > 1 {print s} {s=$$0}' $< > $@
|
||||
./mk_dsdt --debug=$(debug) --maxcpu $* >> $@
|
||||
awk 'NR > 1 {print s} {s=$$0}' $< > $@.$(TMP_SUFFIX)
|
||||
./mk_dsdt --debug=$(debug) --maxcpu $* >> $@.$(TMP_SUFFIX)
|
||||
mv -f $@.$(TMP_SUFFIX) $@
|
||||
|
||||
$(filter dsdt_%.c,$(C_SRC)): %.c: iasl %.asl
|
||||
iasl -vs -p $* -tc $*.asl
|
||||
sed -e 's/AmlCode/$*/g' $*.hex >$@
|
||||
echo "int $*_len=sizeof($*);" >>$@
|
||||
sed -e 's/AmlCode/$*/g' $*.hex >$@.$(TMP_SUFFIX)
|
||||
echo "int $*_len=sizeof($*);" >>$@.$(TMP_SUFFIX)
|
||||
mv -f $@.$(TMP_SUFFIX) $@
|
||||
rm -f $*.aml $*.hex
|
||||
|
||||
iasl:
|
||||
@@ -63,7 +69,7 @@ acpi.a: $(OBJS)
|
||||
|
||||
clean:
|
||||
rm -rf *.a *.o $(IASL_VER) $(IASL_VER).tar.gz $(DEPS)
|
||||
rm -rf ssdt_*.h dsdt*.c *~ *.aml *.hex mk_dsdt dsdt_*.asl
|
||||
rm -rf ssdt_*.h dsdt*.c *~ *.aml *.hex mk_dsdt dsdt_*.asl *.$(TMP_SUFFIX)
|
||||
|
||||
distclean: clean
|
||||
|
||||
|
||||