#######################################################################
#
#   Copyright 2007 by FunChip
#	www.fcdpj.com
#   All rights reserved.
#   
#   ZhengXingJ 2007-09-18
#   
#######################################################################

# the Project's name
APP = rmimg

# Configure the Makefile the Buildroot's path
BUILDROOT_PATH =

# Configure the Makefile the user's application install path
INSTALL_PATH =

# Configure the Makefile the user's lib install path 
INSTALL_LIB_PATH =

# Configure the Makefile CROSS Compiler
# CROSS = arm-linux-

# Configure the Makefile ARCH
# ARCH = arm

# Configure the Makefile the libs of user's application used
LIBNAME =

# link the lib
LIBS = -L. -L/usr/lib $(LIBNAME)

# Configure the Makefile *.h *.hpp search path
INCLUDE = -I.

# Configure the Makefile Compiler
CC = $(CROSS)gcc
LDD = $(CROSS)ldd
SIZE = $(CROSS)size

#CFLAGS = -DLINUX
CFLAGS = 
LDFLAGS = -Wl -lc

# Configure the Makefile message

MSG_BEGIN = -------- begin --------
MSG_APP = Make the $(APP)
MSG_END = --------  end  --------
MSG_FC	= ZhengXingjian
MSG_SIZE = Application Size
MSG_LDD = Application ldd

# c or .S sources
COBJS := $(APP).o 
SOBJS := 

OBJ := $(COBJS)

.c.o:
	$(CC) $(CFLAGS) $(INCLUDE) -c -o $@ $<

all: begin welcome version $(APP) ssize sldd end
test: begin welcome version $(APP) ssize sldd end

$(APP):	$(OBJ)
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS)
	$(CROSS)strip $@

install:
	cp -f $(APP) $(INSTALL_PATH)

buildroot:
	$(MAKE) -C $(BUILDROOT_PATH)

clean:
	rm -f *.o *.gdb $(APP) $(INSTALL_PATH)/$(APP)

# same makefile message
begin:
	@echo
	@echo $(MSG_BEGIN)

end:
	@echo
	@echo $(MSG_END)	

welcome:
	@echo
	@echo $(MSG_FC)
	@echo $(MSG_APP)
	@echo	
	
version:
	$(CC) --version
	@echo	

ssize:
	@echo
	$(SIZE) $(APP)
	@echo		

sldd:
	@echo
	$(LDD) $(APP)
	@echo
