#******************************************************************************
#
# makefile - Rules for building the lightweight IPC library.
#
# Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
#  ALL RIGHTS RESERVED
#
#******************************************************************************

#
# Locating the root directory 
#
ROOT=../../../../../

#
# Device definition (EVM not required)
#
DEVICE=omapl138

#
# Include makefile definitions. 
#
include ${ROOT}/build/armv5/cgt/makedefs

#
# Source files for given target
#
SOURCE=${IPCLIB_SRC}/ipc.c    \
       ${IPCLIB_SRC}/notify.c \
       ${IPCLIB_SRC}/notify_driver_OMAPL138.c

#
# Rules for building the source files
#
all: debug release

debug: 
	mkdir -p Debug
	$(CC) $(CFLAGS) -g $(SOURCE)
	$(AR) $(ARFLAGS) Debug/ipclite.lib *.o*
	@mv *.o* Debug/
	@mkdir -p ${IPCLIB_BIN}/Debug
	@cp Debug/ipclite.lib ${IPCLIB_BIN}/Debug/ipclite.lib

release: 
	mkdir -p Release
	$(CC) $(CFLAGS) -O2 $(SOURCE)
	$(AR) $(ARFLAGS) Release/ipclite.lib *.o*
	@mv *.o* Release/
	@mkdir -p ${IPCLIB_BIN}/Release
	@cp Release/ipclite.lib ${IPCLIB_BIN}/Release/ipclite.lib

#
# Rules for cleaning 
#
clean:
	@rm -rf Debug Release ${IPCLIB_BIN}/Debug ${IPCLIB_BIN}/Release
