# Project name: test program

SDTPath = f:/project/arm202u
PROCESSOR = ARM7
ARCH = 4
PATH = f:/project/test
TARGET = Debug
DEBUGGER = ANGEL


ARMARCH = $(ARCH)

CC = $(SDTPath)/bin/armcc
CCflags = -c -g -ARCH$(ARCH) -apcs 3/noswst/fp/softfp \
		-D$(DEBUGGER) \
		-I. -I../ucos-ii -I../ucos-ii/ARM -I../NedHAL \
		-I../NedHAL/Boards/AT91
# -fwcah -wda -wp
# -fah -fussy -zpc1
# -w -ff

ASM = $(SDTPath)/bin/armasm
ASMflags = -g -CPU $(PROCESSOR) -CheckReglist -apcs 3/nosw \
		-PD "ANGEL SETL {TRUE}" \
		-I.

LINK = $(SDTPath)/bin/armlink
LINKflags = -aif -nozeropad -MAP -LIST eg1.lst

LIB = $(SDTPath)/bin/armlib
LIBflags = -c


# ********************
# *** Core sources ***
# ********************
COREOBJS =	$(TARGET)/eg1.o

# *****************
# *** Libraries ***
# *****************
LIBS = f:/project/NedHAL/$(TARGET)/nedhal.alf f:/project/UCOS-II/$(TARGET)/ucosii.alf

CLIB = f:/project/CLib/armlib_cn.32l

TOTALOBJS = $(COREOBJS)

debug : $(TOTALOBJS) $(LIBS)
	$(LINK) $(LINKflags) -Base 0x02018000 -o $(TARGET)/eg1.axf $(COREOBJS) $(LIBS) $(CLIB)

release : $(TOTALOBJS) $(LIBS)
	$(LINK) $(LINKflags) -bin -Base 0x0 -Data 0x20000000 -o $(TARGET)/eg1.rom $(CLIB) $(COREOBJS) $(LIBS) 

clean :
	-del Debug\*.o
	-del Debug\eg1.axf
	del eg1.axf


# ********************
# *** Dependencies ***
# ********************
$(TARGET)/eg1.o : $(PATH)/eg1.c
	$(CC) $(CCflags) -o $@ $<

