#============================================================================
#  Name:
#    Makefile
#
#  Description:
#    Makefile for the Advanced CUnit Test(ACT) examples (Console Example)
#
#  The following nmake targets are available in this makefile:
#
#     all           - make .elf and .mod image files (default)
#     clean         - delete object directory and image files
#     new           - clean and make
#     filename.o    - make object file
#
#   The above targets can be made with the following command:
#
#     make [-f Makefile] [target]
#
#  Assumptions:
#    1. The version of gcc is 3.3 or above.
#    2. The version of GNU make is 3.80 or above.
#
#  Notes:
#    None.
#
#============================================================================

#------------------------------------------------------------------------------
# Software tool and Options
#------------------------------------------------------------------------------
CC = gcc
CFLAGS = -O
AR = ar
ARFLAGS = ru
RANLIB = ranlib
RM = rm

#------------------------------------------------------------------------------
# Path and Object Files
#------------------------------------------------------------------------------

OUTPUT = ../../../bin/
TARGET = exconsample

ALL_PATHS = ../src ../../../include
ALL_INCLUDES = $(addprefix -I, $(ALL_PATHS))

LIBSDIR = ../../../lib/
SRCSDIR = ../src/

LIBS_FILES = libact.a
LIBS = $(addprefix $(LIBSDIR),$(LIB_FILES))

OBJECTS = \
	counter.o \
	counterTest.o \
	exconsampletest.o \
	person.o \
	personTest.o \

OBJS = $(addprefix $(SRCSDIR), $(OBJECTS))

#------------------------------------------------------------------------------
# Target
#------------------------------------------------------------------------------

all: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) -o $@ $(OBJECTS) -L$(LIBSDIR) ../../../lib/libact.a

.c.o:	
	$(CC) $(CFLAGS) $(ALL_INCLUDES) $(INCLUDES) -c $<


clean:
	-$(RM) $(OBJECTS) $(TARGET)

new:
	$(MAKE) clean
	$(MAKE)

.PHONY: clean all

#------------------------------------------------------------------------------
# Dependencies
#------------------------------------------------------------------------------
