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