#*****************************************************************************
#						Copyright(c) 2010 DTS INSIGHT CORPORATION
# Function:Makefile for building System Macro Trace driver
#
# Modification history
# +-------------- Historical number (000 to 999)
# |	  +--------- Modified System Version
# |	  | 	+--- Classification of New, Modify, Append, Delete
# v	  v 	v
# No  Ver  Class Date	  Name			Description
#---+-----+----+----------+-------------+--------------------------------------
# 000 00.00 New 2011/04/25 K.Ohta		New document
# *****************************************************************************/

#
# Set the tool chain.
#
CROSS_COMPILE=linux-gnu-

#
# Set the library file name.
#
TARGET = libsmt.a

#
#	You don't need to make change hereafter.
#
CC = $(CROSS_COMPILE)gcc
AR = $(CROSS_COMPILE)ar
LD = $(CROSS_COMPILE)ld

sources := SMTInit.c SMTPortOut.c SMTUsrMsgTag.c SMTPrintf.c SMTDebugLevel.c \
		   TRQHook.c SMTCP.c

objects = $(subst .c,.o,$(sources))
dependencies = $(subst .c,.d,$(sources))



CMNFLAGS = -Wall -O2 -fomit-frame-pointer

#
CFLAGS += $(CMNFLAGS) $(COMMON_CFLAGS)
CXXFLAGS += $(CMNFLAGS) $(COMMON_CFLAGS)

all:

.PHONY: all
all: $(TARGET)

.PHONY: clean
clean:
	$(RM) $(objects) $(TARGET) $(dependencies)

ifneq "$(MAKECMDGOALS)" "clean"
	-include $(dependencies)
endif

$(TARGET):$(objects)
	$(AR) $(ARFLAGS) $@ $^
