#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#

#
# Copyright 2013 Nexenta Systems, Inc.   All rights reserved.
#

PROG=		acpinames
# common
OBJS +=		getopt.o
#
OBJS +=		anmain.o anstubs.o antables.o
OBJS +=		dbfileio.o
OBJS +=		dsfield.o dsmthdat.o dsobject.o dsutils.o dswload.o	\
		dswload2.o dswscope.o dswstate.o
OBJS +=		excreate.o exnames.o exresnte.o exresolv.o exutils.o
OBJS +=		nsaccess.o nsalloc.o nsdump.o nsinit.o nsload.o		\
		nsnames.o nsobject.o nsparse.o nssearch.o nsutils.o	\
		nswalk.o nsxfeval.o nsxfname.o nsxfobj.o
OBJS +=		osunixxf.o
OBJS +=		psargs.o psloop.o psopcode.o psparse.o psscope.o	\
		pstree.o psutils.o pswalk.o psxface.o psobject.o psopinfo.o
OBJS +=		tbfadt.o tbfind.o tbinstal.o tbutils.o tbxface.o	\
		tbxfroot.o tbprint.o tbxfload.o
OBJS +=		utalloc.o utcache.o utdebug.o utdecode.o utdelete.o	\
		utglobal.o utlock.o utmath.o utmisc.o utmutex.o		\
		utobject.o utstate.o utosi.o utxferror.o utxface.o	\
		utaddress.o uterror.o utexcep.o utownerid.o utstring.o	\
		utxfinit.o

ACPICA=		$(SRC)/common/acpica

include		$(SRC)/cmd/Makefile.cmd

C99MODE=	$(C99_ENABLE)
CPPFLAGS +=	-DACPI_NAMES_APP \
		-I$(ACPICA)/include -I$(ACPICA)/tools/acpinames
		

.KEEP_STATE:

all:		$(PROG)

clean:
		$(RM) $(OBJS)

install:	all $(ROOTPROG)

$(PROG):	$(OBJS)
		$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
		$(POST_PROCESS)

%.o:		$(ACPICA)/common/%.c
		$(COMPILE.c) -o $@ $<
		$(POST_PROCESS_O)

%.o:		$(ACPICA)/compiler/%.c
		$(COMPILE.c) -o $@ $<
		$(POST_PROCESS_O)

%.o:		$(ACPICA)/components/debugger/%.c
		$(COMPILE.c) -o $@ $<
		$(POST_PROCESS_O)

%.o:		$(ACPICA)/components/disassembler/%.c
		$(COMPILE.c) -o $@ $<
		$(POST_PROCESS_O)

%.o:		$(ACPICA)/components/dispatcher/%.c
		$(COMPILE.c) -o $@ $<
		$(POST_PROCESS_O)

%.o:		$(ACPICA)/components/events/%.c
		$(COMPILE.c) -o $@ $<
		$(POST_PROCESS_O)

%.o:		$(ACPICA)/components/executer/%.c
		$(COMPILE.c) -o $@ $<
		$(POST_PROCESS_O)

%.o:		$(ACPICA)/components/hardware/%.c
		$(COMPILE.c) -o $@ $<
		$(POST_PROCESS_O)

%.o:		$(ACPICA)/components/namespace/%.c
		$(COMPILE.c) -o $@ $<
		$(POST_PROCESS_O)

%.o:		$(ACPICA)/components/parser/%.c
		$(COMPILE.c) -o $@ $<
		$(POST_PROCESS_O)

%.o:		$(ACPICA)/components/resources/%.c
		$(COMPILE.c) -o $@ $<
		$(POST_PROCESS_O)

%.o:		$(ACPICA)/components/tables/%.c
		$(COMPILE.c) -o $@ $<
		$(POST_PROCESS_O)

%.o:		$(ACPICA)/components/utilities/%.c
		$(COMPILE.c) -o $@ $<
		$(POST_PROCESS_O)

%.o:		$(ACPICA)/os_specific/service_layers/%.c
		$(COMPILE.c) -o $@ $<
		$(POST_PROCESS_O)

%.o:		$(ACPICA)/tools/acpinames/%.c
		$(COMPILE.c) -o $@ $<
		$(POST_PROCESS_O)

include		$(SRC)/cmd/Makefile.targ
