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