#  
# Copyright 2007, 2008, QNX Software Systems. 
#  
# Licensed under the Apache License, Version 2.0 (the "License"). You 
# may not reproduce, modify or distribute this software except in 
# compliance with the License. You may obtain a copy of the License 
# at: http://www.apache.org/licenses/LICENSE-2.0 
#  
# Unless required by applicable law or agreed to in writing, software 
# distributed under the License is distributed on an "AS IS" basis, 
# WITHOUT WARRANTIES OF ANY KIND, either express or implied.
# 
# This file may contain contributions from others, either as 
# contributors under the License or as licensors under other terms.  
# Please review this entire file for other proprietary rights or license 
# notices, as well as the QNX Development Suite License Guide at 
# http://licensing.qnx.com/license-guide/ for other information.
# 
#
# General purpose makefile for building a Neutrino character device driver
#
ifndef QCONFIG
QCONFIG=qconfig.mk
endif
include $(QCONFIG)

NAME=devc-$(SECTION)
EXTRA_SILENT_VARIANTS+=$(subst -, ,$(SECTION))

LIBS+=io-char smmu drvr secpol

INSTALLDIR=sbin

define PINFO
PINFO DESCRIPTION=
endef

CCFLAGS += $(CCFLAGS_$(SECTION)_$(CPU))

include $(MKFILES_ROOT)/qmacros.mk
include $(SECTION_ROOT)/pinfo.mk
-include $(SECTION_ROOT)/extra.mk

# Generate a dynamic use file
# Common io-char use file
IOCHAR_USEFILE=$(PROJECT_ROOT)/devc.use
# Generate usefile name and path
USEFILE_NAME=$(addsuffix $(VARIANT_TAG),$(NAME)).use
USEFILE=$(PWD)/$(USEFILE_NAME)
# SOC usefile
SOC_USEFILE=$(PROJECT_ROOT)/$(SECTION)/$(SECTION).use
# Print SOC usefile if exists
ifneq ($(wildcard $(SOC_USEFILE)),)
$(shell cat $(SOC_USEFILE) > $(USEFILE))
endif
# io-char use file
$(shell cat $(IOCHAR_USEFILE) >> $(USEFILE))
# Clean up
EXTRA_CLEAN += $(USEFILE)


#####AUTO-GENERATED by packaging script... do not checkin#####
   INSTALL_ROOT_nto = $(PROJECT_ROOT)/../../../install
   USE_INSTALL_ROOT=1
##############################################################

include $(MKFILES_ROOT)/qtargets.mk


-include $(PROJECT_ROOT)/roots.mk

ifndef LIBIOCHAR_ROOT
LIBIOCHAR_ROOT=$(PRODUCT_ROOT)
endif