debuggers.hg

view tools/firmware/hvmloader/acpi/Makefile @ 20981:27f5ff8c0aa0

hvmloader: Fix parallel build of ACPI tables.

Make build.c dependency on ssdt_{pm,tpm}.h explicit, else they can be
built in the wrong order.

Also, improve naming of target DSDT structures, and specify -p option
to iasl so that all generated files for a given target have
target-unique names, hence build can proceed safely in parallel.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Feb 12 09:16:10 2010 +0000 (2010-02-12)
parents a259e779467c
children 2e7dc3421a52
line source
1 #
2 # Copyright (c) 2004, Intel Corporation.
3 #
4 # This program is free software; you can redistribute it and/or modify it
5 # under the terms and conditions of the GNU General Public License,
6 # version 2, as published by the Free Software Foundation.
7 #
8 # This program is distributed in the hope it will be useful, but WITHOUT
9 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 # more details.
12 #
13 # You should have received a copy of the GNU General Public License along with
14 # this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15 # Place - Suite 330, Boston, MA 02111-1307 USA.
16 #
18 XEN_ROOT = ../../../..
19 include $(XEN_ROOT)/tools/firmware/Rules.mk
21 C_SRC = build.c dsdt_anycpu.c dsdt_15cpu.c static_tables.c
22 OBJS = $(patsubst %.c,%.o,$(C_SRC))
24 CFLAGS += -I. -I.. $(CFLAGS_include)
26 vpath iasl $(PATH)
27 all: acpi.a
29 ssdt_pm.h ssdt_tpm.h: %.h: %.asl iasl
30 iasl -p $* -tc $<
31 sed -e 's/AmlCode/$*/g' $*.hex >$@
32 rm -f $*.hex $*.aml
34 dsdt_15cpu.c dsdt_anycpu.c: %.c: dsdt.asl mk_dsdt.c iasl
35 $(HOSTCC) $(HOSTCFLAGS) $(CFLAGS_include) -o mk_$* mk_dsdt.c
36 head -n -1 $< >$*.asl
37 ./mk_$* >>$*.asl
38 iasl -p $* -tc $*.asl
39 sed -e 's/AmlCode/$*/g' $*.hex >$@
40 echo "int $*_len=sizeof($*);" >>$@
41 rm -f $*.hex $*.aml $*.asl mk_$*
43 iasl:
44 @echo
45 @echo "ACPI ASL compiler (iasl) is needed"
46 @echo "Download and install Intel ACPI CA from"
47 @echo "http://acpica.org/downloads/"
48 @echo
49 @exit 1
51 build.o: ssdt_pm.h ssdt_tpm.h
53 acpi.a: $(OBJS)
54 $(AR) rc $@ $(OBJS)
56 clean:
57 rm -rf *.a *.o $(IASL_VER) $(IASL_VER).tar.gz $(DEPS)
58 rm -rf ssdt_*.h dsdt*.c *~ *.aml *.hex mk_dsdt mk_dsdt15 dsdt_*cpu.asl
60 install: all
62 -include $(DEPS)