# This is makefile for E:\Pooh\release\examples\uclinux\uc2.0\app\errtestsa\errtest.mpj 
# Saturday, September 27, 2003 11:06:17

CC 	= arm-elf-gcc 
AS 	= arm-elf-as 
LD 	= arm-elf-ld 

CFG 	= Debug Ram

SYS_INCLUDE = -IE:\Pooh\qedit\Debug\libs/src 
SYS_LIB = 
SOURCES = errtest.c 

S_OBJECTS = $(OUTPUT_PATH)/errtest.o 

O_OBJECTS = 

OBJECTS = $(S_OBJECTS) $(O_OBJECTS)

ifeq ($(CFG),Debug Ram) 
TOPMEMORY=0x2400000
OUTPUT_PATH = ./DbgRam
OUTPUT_NAME = ./DbgRam/errtest.exe
CFLAGS = -mcpu=arm7tdmi -mapcs-32 -mlittle-endian -O0 -I. -gstabs+  
ASFLAGS = -mcpu=arm7tdmi -mapcs-32 -mlittle-endian  
LDFLAGS = -mcpu=arm7tdmi -mapcs-32 -mlittle-endian -lerr -LE:/Pooh/release/examples/uclinux/uc2.0/library/liberr/DbgRam -Wl,-Map -Wl,$(basename $@).map -static  
endif

ifeq ($(CFG),Release Ram) 
TOPMEMORY=0x2400000
OUTPUT_PATH = ./RelRam
OUTPUT_NAME = ./RelRam/errtest.exe
CFLAGS = -O2 -I. 
ASFLAGS = -Os 
LDFLAGS =  
endif


all: prebuild $(OUTPUT_NAME) postbuild 

MKDEPFILE= $(OUTPUT_PATH)/errtest.dep

-include $(MKDEPFILE) 

$(MKDEPFILE): dep

dep: $(SOURCES)
	@echo Make dependency...
	@if [ ! -d $(OUTPUT_PATH) ] ; then \
		mkdir -p $(OUTPUT_PATH);  \
	fi
	@$(CC) -E $(CFLAGS) -MM $(SOURCES) | sed  's/^\(.*:\)/$$(OUTPUT_PATH)\/\1/g' > $(MKDEPFILE)

$(OUTPUT_NAME): $(OBJECTS) 
	@echo "Linking... "
	@echo "Creating file $@..."
	@$(CC) -o $@ $^ -elf2flt $(LDFLAGS) $(EXTRA_LDFLAGS) $(SYS_LIB)

$(OUTPUT_PATH)/errtest.o:errtest.c
	@echo "Compiling $<"
	@$(CC) -c -o "$@" "$<" $(CFLAGS) $(EXTRA_CFLAGS) $(SYS_INCLUDE)

.PHONY: clean dep prebuild postbuild
clean:
	$(RM) -f $(S_OBJECTS) 
	$(RM) -f $(OUTPUT_NAME)
	$(RM) -f $(MKDEPFILE)
	$(RM) -f $(OUTPUT_NAME).exe*

postbuild:
ifeq ($(CFG),Debug Ram) 
	
endif

ifeq ($(CFG),Release Ram) 
	
endif


prebuild:
ifeq ($(CFG),Debug Ram) 
	
endif

ifeq ($(CFG),Release Ram) 
	
endif



# End of Makefile