###############################################################################
# Copyright (c) 2012-2012 Integrated Device Technology, Inc.
# All Rights Reserved
#
# This file is provided for use with IDT products only, and does not
# convey any license, whether express or implied, to any intellectual
# property rights of Integrated Device Technology, Inc.  Distribution,
# copying or modification of the contents of this file and/or any
# derivatives thereto is not permitted, except as specifically
# authorized in writing. This notice shall be included in its entirety
# on all copies made from this file.
#
# The contents herein are the proprietary and confidential information
# of Integrated Device Technology Inc. and shall not be distributed or
# furnished to third parties or made public without prior written
# permission by Integrated Device Technology Inc.  Disclosures of this
# file in any form to the United States Government may not be made
# without a written predetermination that it will be protected by
# limited or restricted rights as set forth in the applicable Federal
# Acquisition Regulations or other equivalent governmental rule or
# regulation.
#
# The contents herein are provided "as is" and without any express or
# implied warranties, including, without limitation, the implied
# warranties of merchantability and fitness for a particular purpose.
#
# Last modified: <lastCommitDate>
# Release: <releaseName>
# Id: <gitCommitHash>
#
###############################################################################

##############################################################################
# B U I L D    E N V I R O N M E N T
##############################################################################
HOST_PLATFORM := $(shell uname | cut -d _ -f 1 | tr [:upper:] [:lower:])

# If HARDWARE_TARGET is defined then we'll append it to the host platform 
# that we are running on.
ifdef HARDWARE_TARGET
TARGET := $(HOST_PLATFORM).$(HARDWARE_TARGET)
else
TARGET := $(HOST_PLATFORM)
endif

# Include host/target specific options
OSADAPT_PLATFORMDIR := ../../osAdaptation/$(TARGET)
include ../../osAdaptation/$(TARGET)/osConfig.mk

##############################################################################
# Include directories 
INCL_DIRS := \
             . \
             ../../common/include \
             ../../apll/include \
             $(OSADAPT_PLATFORMDIR)/include

# Compiler Options
CFLAGS += \
          $(foreach i,$(INCL_DIRS),-I$(i)) \
          -g \
          -Werror \
          -Wall \
          -pedantic

# Libraries
LIBS = 

# Library make targets 
LIB_MKTGTS := $(foreach i,$(LIBS), lib$(i))

# Library search paths
LD_DIRS = 

# Linker Options
LDFLAGS := \
           $(foreach i,$(LD_DIRS),-L$(i))
##############################################################################
# I N P U T    A R T I F A C T S
##############################################################################

VPATH := \
         .

SOURCE := \
          annotate.c \
          RegName.c

##############################################################################
# O U T P U T    A R T I F A C T S
##############################################################################

OBJ_DIR := .
OBJS := $(addprefix $(OBJ_DIR)/,$(notdir $(SOURCE:.c=.o)))

PROGNAME := annotate$(PROG_EXT)
##############################################################################
# M A K E F I L E    T A R G E T S
##############################################################################
all: $(PROGNAME)

$(OBJ_DIR)/%.o : %.c
	$(CC) $(CFLAGS) -c -o $@ $<

$(PROGNAME): $(OBJS)
	$(CC) $(LDFLAGS) $(OBJS) $(foreach i,$(LIBS),-l$(i)) -o $(PROGNAME)

clean:
	$(RM) $(OBJS) $(PROGNAME) *~

dep:

help:
	@echo "Makefile Help rbf file annotator"
