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 | # |
---|
17 | |
---|
18 | override XEN_TARGET_ARCH = x86_32 |
---|
19 | XEN_ROOT = ../../../.. |
---|
20 | CFLAGS := -I. -I.. -I$(XEN_ROOT)/tools/libxc |
---|
21 | include $(XEN_ROOT)/tools/Rules.mk |
---|
22 | |
---|
23 | C_SRC = build.c dsdt.c static_tables.c |
---|
24 | H_SRC = $(wildcard *.h) |
---|
25 | OBJS = $(patsubst %.c,%.o,$(C_SRC)) |
---|
26 | |
---|
27 | IASL_VER = acpica-unix-20060707 |
---|
28 | IASL_URL = http://developer.intel.com/technology/iapc/acpi/downloads/$(IASL_VER).tar.gz |
---|
29 | |
---|
30 | # Disable PIE/SSP if GCC supports them. They can break us. |
---|
31 | CFLAGS += $(call cc-option,$(CC),-nopie,) |
---|
32 | CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,) |
---|
33 | CFLAGS += $(call cc-option,$(CC),-fno-stack-protector-all,) |
---|
34 | |
---|
35 | CFLAGS += -fno-builtin -O2 -msoft-float |
---|
36 | |
---|
37 | vpath iasl $(PATH) |
---|
38 | all: acpi.a |
---|
39 | |
---|
40 | ssdt_tpm.h: ssdt_tpm.asl |
---|
41 | $(MAKE) iasl |
---|
42 | iasl -tc ssdt_tpm.asl |
---|
43 | mv ssdt_tpm.hex ssdt_tpm.h |
---|
44 | rm -f *.aml |
---|
45 | |
---|
46 | dsdt.c: dsdt.asl |
---|
47 | $(MAKE) iasl |
---|
48 | iasl -tc dsdt.asl |
---|
49 | mv dsdt.hex dsdt.c |
---|
50 | echo "int DsdtLen=sizeof(AmlCode);" >> dsdt.c |
---|
51 | rm -f *.aml |
---|
52 | |
---|
53 | iasl: |
---|
54 | @echo |
---|
55 | @echo "ACPI ASL compiler(iasl) is needed" |
---|
56 | @echo "Download Intel ACPI CA" |
---|
57 | @echo "If wget failed, please download and compile manually from" |
---|
58 | @echo "http://developer.intel.com/technology/iapc/acpi/downloads.htm" |
---|
59 | @echo |
---|
60 | wget $(IASL_URL) |
---|
61 | tar xzf $(IASL_VER).tar.gz |
---|
62 | make -C $(IASL_VER)/compiler |
---|
63 | $(INSTALL_PROG) $(IASL_VER)/compiler/iasl /usr/bin/iasl |
---|
64 | |
---|
65 | acpi.a: $(OBJS) |
---|
66 | $(AR) rc $@ $(OBJS) |
---|
67 | |
---|
68 | %.o: %.c $(H_SRC) |
---|
69 | $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< |
---|
70 | |
---|
71 | clean: |
---|
72 | rm -rf *.a *.o $(IASL_VER) $(IASL_VER).tar.gz |
---|
73 | |
---|
74 | install: all |
---|