AMD64 - Enable module building, sync i386 headers etc as needed.
[dragonfly.git] / sys / dev / acpica5 / Makefile
CommitLineData
5ed44076 1# $FreeBSD: src/sys/modules/acpi/acpi/Makefile,v 1.3 2004/01/08 16:38:32 njl Exp $
745566f2 2# $DragonFly: src/sys/dev/acpica5/Makefile,v 1.23 2008/08/28 09:25:42 hasso Exp $
e1eeedd0
YT
3
4CONTRIBDIR= ${SYSDIR}/${ACPICA_DIR}
a9e3d6fe
YT
5# patches to fix problems in ACPI-CA code
6PATCHES= hardware,hwsleep.c.patch tables,tbxface.c.patch
7# patches to silence warnings
8PATCHES+= include,acglobal.h.patch debugger,dbstats.c.patch
67b2a2c8
YT
9
10SYSDIR?= ${.CURDIR}/../..
ebfbd8eb 11.if ACPI_DEBUG_LOCKS || ACPI_DEBUG_MEMMAP || ACPI_DEBUG_CACHE
e1eeedd0
YT
12CFLAGS+= -I${.OBJDIR}/include
13.if ACPI_DEBUG_LOCKS
14CFLAGS+= -DACPI_DEBUG_LOCKS=1
15.endif
16.if ACPI_DEBUG_MEMMAP
17CFLAGS+= -DACPI_DEBUG_MEMMAP=1
18.endif
ebfbd8eb
YT
19.if ACPI_DEBUG_CACHE
20CFLAGS+= -DACPI_DEBUG_CACHE=1
21.endif
e1eeedd0
YT
22PATCHES+= include,acpiosxf.h.patch
23.endif
24
67b2a2c8
YT
25.include "Makefile.inc"
26
e1eeedd0
YT
27.PATH: ${.OBJDIR} \
28 ${.OBJDIR}/include \
29 ${SYSDIR}/${OSACPI_MD_DIR} \
0955fd91 30 ${SYSDIR}/platform/${MACHINE_PLATFORM}/isa \
f6571408
YT
31 ${SYSDIR}/bus/pci \
32 ${.CURDIR}/Osd \
33 ${.CURDIR} \
34 ${ACPICA_KERN_PATHS}
5ed44076
MD
35
36KMOD = acpi
37
e1eeedd0 38SRCS+= ${PATCHES}
5ed44076 39# ACPI CA sources
5ed44076
MD
40SRCS+= dsfield.c dsinit.c dsmethod.c dsmthdat.c
41SRCS+= dsobject.c dsopcode.c dsutils.c dswexec.c dswload.c
42SRCS+= dswscope.c dswstate.c evevent.c evgpe.c evgpeblk.c
43SRCS+= evmisc.c evregion.c evrgnini.c evsci.c evxface.c
44SRCS+= evxfevnt.c evxfregn.c exconfig.c exconvrt.c excreate.c
45SRCS+= exdump.c exfield.c exfldio.c exmisc.c exmutex.c
46SRCS+= exnames.c exoparg1.c exoparg2.c exoparg3.c exoparg6.c
47SRCS+= exprep.c exregion.c exresnte.c exresolv.c exresop.c
48SRCS+= exstore.c exstoren.c exstorob.c exsystem.c exutils.c
49SRCS+= hwacpi.c hwgpe.c hwregs.c hwsleep.c hwtimer.c
50SRCS+= nsaccess.c nsalloc.c nsdump.c nseval.c nsinit.c
51SRCS+= nsload.c nsnames.c nsobject.c nsparse.c nssearch.c
52SRCS+= nsutils.c nswalk.c nsxfeval.c nsxfname.c nsxfobj.c
e1eeedd0 53SRCS+= psargs.c psloop.c psopcode.c psparse.c psscope.c
5ed44076 54SRCS+= pstree.c psutils.c pswalk.c psxface.c
e1eeedd0 55SRCS+= rsaddr.c rscalc.c rscreate.c rsdump.c rsinfo.c rsio.c
5ed44076 56SRCS+= rsirq.c rslist.c rsmemory.c rsmisc.c rsutils.c
e1eeedd0
YT
57SRCS+= rsxface.c tbfadt.c tbfind.c tbinstal.c
58SRCS+= tbutils.c tbxface.c tbxfroot.c utalloc.c
5ed44076 59SRCS+= utclib.c utcopy.c utdebug.c utdelete.c uteval.c
e1eeedd0
YT
60SRCS+= utglobal.c utinit.c utmath.c utmisc.c utmutex.c utobject.c
61SRCS+= utresrc.c utstate.c utxface.c
5ed44076
MD
62
63# OSD layer
64#
cc6e2b6e 65SRCS+= acpi.c acpi_acad.c acpi_battery.c acpi_button.c acpi_cmbat.c
c3a2c0df 66SRCS+= acpi_cpu.c acpi_cpu_cstate.c acpi_cpu_pstate.c
5ed44076 67SRCS+= acpi_ec.c acpi_isab.c acpi_lid.c
e34b79bf
JS
68SRCS+= acpi_package.c
69# The PCI part of ACPI5 doesn't work with the current infrastructure
70# SRCS+= acpi_pci.c acpi_pcib.c acpi_pcib_acpi.c acpi_pcib_pci.c
71# SRCS+= acpi_pci_link.c
72SRCS+= acpi_powerres.c acpi_resource.c acpi_thermal.c
bea6e278 73SRCS+= acpi_timer.c acpi_hpet.c acpi_if.c
5ed44076 74SRCS+= OsdDebug.c
e1eeedd0 75SRCS+= OsdHardware.c OsdInterface.c OsdInterrupt.c OsdMemory.c OsdSchedule.c
5ed44076
MD
76SRCS+= OsdStream.c OsdSynch.c OsdTable.c OsdEnvironment.c
77SRCS+= opt_acpi.h opt_bus.h opt_ddb.h
676159d4
HT
78SRCS+= device_if.h bus_if.h pci_if.h pcib_if.h isa_if.h acpi_if.h
79MFILES = kern/device_if.m kern/bus_if.m bus/pci/pci_if.m bus/pci/pcib_if.m
80MFILES+= bus/isa/isa_if.m dev/acpica5/acpi_if.m
5ed44076
MD
81
82# Debugging support
83DBSRC= dbcmds.c dbdisply.c dbexec.c dbfileio.c dbhistry.c
84DBSRC+= dbinput.c dbstats.c dbutils.c dbxface.c
85DBSRC+= dmbuffer.c dmnames.c dmopcode.c dmobject.c dmresrc.c dmresrcl.c
86DBSRC+= dmresrcs.c dmutils.c dmwalk.c
87
5ed44076
MD
88.if ACPI_NO_SEMAPHORES
89CFLAGS+=-DACPI_NO_SEMAPHORES
90.endif
91.if ACPI_DEBUG
92CFLAGS+=-DACPI_DEBUG
93SRCS+= ${DBSRC}
94opt_ddb.h: Makefile
95 echo "#define DDB 1" > ${.TARGET}
96.else
97opt_ddb.h: Makefile
98 echo -n > ${.TARGET}
99.endif
e1eeedd0
YT
100.if ACPI_USE_LOCAL_CACHE
101CFLAGS+= -DACPI_USE_LOCAL_CACHE
102SRCS+= utcache.c
103.else
104SRCS+= OsdCache.c
105.endif
5ed44076 106
7b46b972
SZ
107# Machine-specific code for P-State
108SRCS+= acpi_pstate_machdep.c
5ed44076 109# Machine-specific code such as sleep/wakeup
e774ca6d 110SRCS+= acpi_machdep.c acpi_wakecode.h
8c526244 111.if ${MACHINE_ARCH} == "i386"
e774ca6d
MD
112SRCS+= acpi_wakeup.c
113.endif
114.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
99e3d339
MD
115# APIC enumerators
116#SRCS+= madt.c
117SRCS+= pmtimer.c
49e48b8a 118.endif
5ed44076
MD
119CLEANFILES+= acpi_wakecode.h acpi_wakecode.o acpi_wakecode.bin ${DBSRC}
120CLEANFILES+= platform/acenv.h
121
122acpi_wakecode.h: acpi_wakecode.S
f6571408
YT
123 ${MAKE} -f ${SYSDIR}/${OSACPI_MD_DIR}/Makefile \
124 MAKESRCPATH=${SYSDIR}/${OSACPI_MD_DIR}
5ed44076 125
bf334cef 126SUBDIR= acpi_asus acpi_thinkpad acpi_toshiba acpi_video
f9d8cd12 127all: ${PROG} ${SUBDIR}
5ed44076 128
c34dd8ac
YT
129# *.o file for each patched *.c file is created under the same directory,
130# rather than right below ${.OBJDIR}.
131.for _p in ${PATCHES:M*.c.patch}
132SRCS:= ${SRCS:N${_p:C/^.*,//:R}}
133${_p:S|,|/|g:R:R}.o: ${_p}
134 ${CC} ${CFLAGS} -o ${.TARGET} -c ${.IMPSRC}
135.endfor
e1eeedd0 136
c34dd8ac 137.include <bsd.kmod.mk>