#-----[ Usual commands ]----------------------------------------------------------
RM			= rm -fr
MKDIR			= mkdir -p
ECHO			= echo
CCACHE			=
LS			= ls
TEST			= test
CAT			= cat
READ			= read
SED			= sed
MAKE			= make -s
CD			= cd
PWD			= pwd

#-----[ Directory ]---------------------------------------------------------------
DIR_LDSCRIPT		= $(TOOLS)/newlib/libgloss/or32

DIR_INCLUDE		= -I$(TOOLS)/newlib/newlib/libc/include/	\
			  -I$(TOOLS)/newlib/libgloss/or32/include/
DIR_LIBRARY		= -L$(TOOLS)/newlib/or32-elf/newlib/ 		\
			  -L$(TOOLS)/newlib/or32-elf/libgloss/or32/ 	\
			  -L$(TOOLS)/or1k/lib/gcc/or32-elf/3.4.4/

#-----[ To the compilation ]------------------------------------------------------
OPTIMIZE		= -O3 -fomit-frame-pointer -fdelayed-branch -mror -mcmov -msext -mhard-mul -msoft-div -msoft-float
#Option :
# -fomit-frame-pointer 			: n'utilise pas le pointeur de frame
# -fdelayed-branch   			: utilise les delayed slot
# ON		OFF
# -mror   	-mno-ror              	: utilisation de l'instruction l.ror
# -mcmov   	-mno-cmov       	: utilisation de l'instruction l.cmov
# -msext	-mno-sext		: utilisation des instructions l.extXX
# -mhard-mul	-msoft-mul	        : utilisation du multiplieur materiel
# -mhard-div	-msoft-div              : utilisation du diviseur materiel
# -mhard-float	-msoft-float      	: utilisation du flottant materiel
# -msibcall     -mno-sibcall            : Enable sibcall optimization
# -mlogue	-mno-logue 		: Schedule pro/epi-logue.
# -maj		-mno-aj     		: Use aligned jumps.

# Tools
CC			= $(CCACHE) or32-elf-gcc
AS			=           or32-elf-as
LD			=           or32-elf-ld
OBJDUMP			=           or32-elf-objdump
NM           		=           or32-elf-nm

# Tools's option
CC_OPT			= $(DIR_INCLUDE) $(OPTIMIZE) -Wlong-long -D__or32__ -DHAVE_LIBC -D__DYNAMIC_REENT__
# -DHAVE_LIBC
AS_OPT			=
LD_OPT			= -T$(DIR_LDSCRIPT)/or32.ld $(DIR_LIBRARY)  -lor32 -lc -lor32 -lc -lm -lgcc
OBJDUMP_OPT		= -D
NM_OPT			= -n
