#------------------------------------------------------------------------	       
#  Copyright (C) 2006-2009 by Embedded and Real-Time Systems Laboratory
#              Graduate School of Information Science, Nagoya Univ., JAPAN
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# -------------------------------------------------------------------------
CXX       = g++
TOP_DIR   = ../..
TARGET    = skyeye.exe
COM_OBJS  = main.o com_support.o
LIB_FILES = $(TOP_DIR)/binary/libarm.a $(TOP_DIR)/binary/libdev.a $(TOP_DIR)/binary/libutils.a

# AT[go
MY_DEBUG  = 1 
# fobOo
#MY_DEBUG  = 2
#INCLUDE   = -I$(TOP_DIR)/arch/arm -I$(TOP_DIR)/arch/arm/common -I$(TOP_DIR)/arch/arm/common/mmu -I $(TOP_DIR)/arch/arm/mach -I $(TOP_DIR)/arch/bfin/common -I $(TOP_DIR)/arch/bfin/mach -I $(TOP_DIR)/arch/coldfire/common -I $(TOP_DIR)/arch/ppc/common -I $(TOP_DIR)/device -I $(TOP_DIR)/device/net -I $(TOP_DIR)/device/lcd -I $(TOP_DIR)/device/flash -I $(TOP_DIR)/device/uart -I $(TOP_DIR)/device/nandflash -I $(TOP_DIR)/utils -I $(TOP_DIR)/utils/share -I$(TOP_DIR)/utils/main -I$(TOP_DIR)/utils/config -I$(TOP_DIR)/utils/debugger

# Skyeye{̂COM̃RpC
all: top $(TARGET) 

# COM݂̂̃RpC
com:$(TARGET)

# COM̃RpC
$(COM_OBJS:.o): %.cpp Makefile
	$(CXX) -c $< -DMY_DEBUG=$(MY_DEBUG)	

# N
$(TARGET): $(COM_OBJS) $(TOP_DIR)/binary/skyeye.o $(LIB_FILES)
	$(CXX) -g -O2 -D_FILE_OFFSET_BITS=64 -DSTANDALONE -DDEFAULT_INLINE=0 -DMODET  -mms-bitfields -DMODET $(INCLUDE) -DARM  -I$(TOP_DIR)/. -DWIN32_LCD -o $(TARGET) $(TOP_DIR)/binary/skyeye.o $(COM_OBJS) \
	--start-group -L$(TOP_DIR)/binary -larm -ldev -lutils -lbfin -lcoldfire -lppc -lmips  -lc -lbfd -liberty -lintl --end-group  -lm -L /usr/lib/w32api -lwinmm -ladvapi32 -lgdi32 -lkernel32 -luser32 \
	-lole32 -loleaut32 -luuid

# Skyeye{̂̃RpC
top:
	$(MAKE) -C $(TOP_DIR)

# COM̂݃N[
clean:
	rm -f $(COM_OBJS) $(TARGET)

# Skyeye{̂COM̃N[
cleanall:
	rm -f $(COM_OBJS) $(TARGET)
	$(MAKE) clean -C $(TOP_DIR)
