]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/blob - sys/modules/acpi/acpi/Makefile
MFC r362623:
[FreeBSD/stable/8.git] / sys / modules / acpi / acpi / Makefile
1 # $FreeBSD$
2
3 .if ${MACHINE_ARCH} == "ia64"
4 .error "ACPI can only be compiled into the kernel on the ia64 platform"
5 .endif
6
7 .if ${MACHINE} != "amd64" && ${MACHINE} != "i386"
8 .error "The ACPI module is only for amd64 and i386"
9 .endif
10
11 .PATH:  ${.CURDIR}/../../../contrib/dev/acpica/debugger \
12         ${.CURDIR}/../../../contrib/dev/acpica/disassembler \
13         ${.CURDIR}/../../../contrib/dev/acpica/dispatcher \
14         ${.CURDIR}/../../../contrib/dev/acpica/events \
15         ${.CURDIR}/../../../contrib/dev/acpica/executer \
16         ${.CURDIR}/../../../contrib/dev/acpica/hardware \
17         ${.CURDIR}/../../../contrib/dev/acpica/namespace \
18         ${.CURDIR}/../../../contrib/dev/acpica/parser \
19         ${.CURDIR}/../../../contrib/dev/acpica/resources \
20         ${.CURDIR}/../../../contrib/dev/acpica/tables \
21         ${.CURDIR}/../../../contrib/dev/acpica/utilities \
22         ${.CURDIR}/../../../pci \
23         ${.CURDIR}/../../../dev/acpica \
24         ${.CURDIR}/../../../dev/acpica/Osd \
25         ${.CURDIR}/../../../${MACHINE_ARCH}/acpica
26
27 KMOD=   acpi
28
29 # ACPI CA sources
30 SRCS+=  dbcmds.c dbdisply.c dbexec.c dbfileio.c dbhistry.c dbinput.c dbstats.c
31 SRCS+=  dbutils.c dbxface.c
32 SRCS+=  dmbuffer.c dmnames.c dmopcode.c dmobject.c dmresrc.c dmresrcl.c
33 SRCS+=  dmresrcs.c dmutils.c dmwalk.c
34 SRCS+=  dsfield.c dsinit.c dsmethod.c dsmthdat.c dsobject.c dsopcode.c
35 SRCS+=  dsutils.c dswexec.c dswload.c dswscope.c dswstate.c
36 SRCS+=  evevent.c evgpe.c evgpeblk.c evgpeinit.c evgpeutil.c evmisc.c
37 SRCS+=  evregion.c evrgnini.c evsci.c evxface.c evxfevnt.c evxfregn.c
38 SRCS+=  exconfig.c exconvrt.c excreate.c exdebug.c exdump.c exfield.c
39 SRCS+=  exfldio.c exmisc.c exmutex.c exnames.c exoparg1.c exoparg2.c
40 SRCS+=  exoparg3.c exoparg6.c exprep.c exregion.c exresnte.c exresolv.c
41 SRCS+=  exresop.c exstore.c exstoren.c exstorob.c exsystem.c exutils.c
42 SRCS+=  hwacpi.c hwgpe.c hwpci.c hwregs.c hwsleep.c hwtimer.c hwvalid.c
43 SRCS+=  hwxface.c
44 SRCS+=  nsaccess.c nsalloc.c nsdump.c nseval.c nsinit.c nsload.c nsnames.c
45 SRCS+=  nsobject.c nsparse.c nspredef.c nsrepair.c nsrepair2.c nssearch.c
46 SRCS+=  nsutils.c nswalk.c nsxfeval.c nsxfname.c nsxfobj.c
47 SRCS+=  psargs.c psloop.c psopcode.c psparse.c psscope.c pstree.c psutils.c
48 SRCS+=  pswalk.c psxface.c
49 SRCS+=  rsaddr.c rscalc.c rscreate.c rsdump.c rsinfo.c rsio.c rsirq.c rslist.c
50 SRCS+=  rsmemory.c rsmisc.c rsutils.c rsxface.c
51 SRCS+=  tbfadt.c tbfind.c tbinstal.c tbutils.c tbxface.c tbxfroot.c
52 SRCS+=  utalloc.c utcache.c utcopy.c utdebug.c utdelete.c uteval.c utglobal.c
53 SRCS+=  utids.c utinit.c utlock.c utmath.c utmisc.c utmutex.c utobject.c
54 SRCS+=  utosi.c utresrc.c utstate.c utxface.c utxferror.c
55
56 # OSPM layer and core hardware drivers
57 SRCS+=  acpi.c acpi_button.c acpi_isab.c acpi_package.c acpi_pci.c acpi_pcib.c
58 SRCS+=  acpi_pcib_acpi.c acpi_pcib_pci.c acpi_powerres.c acpi_quirk.c
59 SRCS+=  acpi_resource.c acpi_timer.c acpi_pci_link.c acpi_thermal.c
60
61 # ACPI hardware drivers, mostly used for mobile systems.
62 SRCS+=  acpi_acad.c acpi_battery.c acpi_cmbat.c acpi_cpu.c acpi_ec.c
63 SRCS+=  acpi_hpet.c acpi_lid.c acpi_perf.c acpi_smbat.c acpi_throttle.c
64
65 # OSD layer
66 SRCS+=  OsdDebug.c
67 SRCS+=  OsdHardware.c OsdInterrupt.c OsdMemory.c OsdSchedule.c OsdStream.c
68 SRCS+=  OsdSynch.c OsdTable.c OsdEnvironment.c
69 SRCS+=  opt_acpi.h opt_bus.h opt_ddb.h acpi_if.h acpi_quirks.h bus_if.h
70 SRCS+=  cpufreq_if.h device_if.h isa_if.h pci_if.h pcib_if.h
71
72 # XXX ACPI should not depend on the following headers but this is currently
73 # needed for the build of assym.s.
74 # This obviously needs a better and more structural fix.
75 SRCS+=  opt_kstack_pages.h opt_nfs.h opt_apic.h opt_compat.h opt_hwpmc_hooks.h
76
77 .if !defined(KERNBUILDDIR)
78 .if KTR
79 CFLAGS+=-DKTR
80 .endif
81 .if ACPI_MAX_TASKS
82 CFLAGS+=-DACPI_MAX_TASKS=${ACPI_MAX_TASKS}
83 .endif
84 .if ACPI_MAX_THREADS
85 CFLAGS+=-DACPI_MAX_THREADS=${ACPI_MAX_THREADS}
86 .endif
87 .if ACPI_DEBUG
88 CFLAGS+=-DACPI_DEBUG
89 opt_ddb.h: Makefile
90         echo "#define DDB 1" > ${.TARGET}
91 .else
92 opt_ddb.h: Makefile
93         echo -n > ${.TARGET}
94 .endif
95 .endif
96
97 # Machine-specific code such as sleep/wakeup
98 SRCS+=  acpi_machdep.c acpi_wakecode.h acpi_wakeup.c
99 SRCS+=  assym.s madt.c
100 CLEANFILES+=    acpi_wakecode.bin acpi_wakecode.h acpi_wakecode.o
101
102 .if ${MACHINE_ARCH} == "amd64"
103 .if !defined(KERNBUILDDIR)
104 CFLAGS+=-DSMP
105 .endif
106 SRCS+=  acpi_switch.S acpi_wakedata.h
107 CLEANFILES+=    acpi_wakedata.h
108 ASM_CFLAGS=     -x assembler-with-cpp -DLOCORE ${CFLAGS}
109 acpi_switch.o:  acpi_switch.S
110         ${CC} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}
111 acpi_wakecode.o: acpi_wakecode.S assym.s
112         ${CC} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}
113 acpi_wakecode.bin: acpi_wakecode.o
114         objcopy -S -O binary acpi_wakecode.o ${.TARGET}
115 acpi_wakecode.h: acpi_wakecode.bin
116         file2c -sx 'static char wakecode[] = {' '};' < acpi_wakecode.bin > \
117             ${.TARGET}
118 acpi_wakedata.h: acpi_wakecode.o
119         nm -n --defined-only ${.ALLSRC} | while read offset dummy what; do \
120             echo "#define       $${what}        0x$${offset}"; done > ${.TARGET}
121 .else
122 acpi_wakecode.h: acpi_wakecode.S assym.s
123         ${MAKE} -f ${.CURDIR}/../../../${MACHINE_ARCH}/acpica/Makefile \
124                 MAKESRCPATH=${.CURDIR}/../../../${MACHINE_ARCH}/acpica
125 .endif
126
127 .include <bsd.kmod.mk>