3 HOST := $(shell uname)
\r
6 # If we are using codesourcery and cygwin..
\r
7 ifneq ($(findstring CYGWIN,$(UNAME)),)
\r
8 cygpath:= $(shell cygpath -m $(shell which cygpath))
\r
9 export CYGPATH=$(cygpath)
\r
13 # Bin: PowerPC_EABI_Tools/Command_Line_Tools/mwXXXXXX
\r
14 # libs: PowerPC_EABI_Support/Runtime/Lib/Runtime.XXXX
\r
15 # PowerPC_EABI_Support/MSL/MSL_C/PPC_EABI/Lib
\r
17 CW_COMPILE=/c/devtools/cw_55xx
\r
18 CW_BIN=$(CW_COMPILE)/PowerPC_EABI_Tools/Command_Line_Tools
\r
19 CW_LIB=$(CW_COMPILE)/PowerPC_EABI_Support/Runtime/Lib
\r
22 # ---------------------------------------------------------------------------
\r
24 # CCFLAGS - compile flags
\r
26 CC = $(CW_BIN)/mwcceppc.exe
\r
27 #cflags-$(CFG_OPT_RELEASE) += -O3
\r
28 #cflags-$(CFG_OPT_DEBUG) += make -O0
\r
31 cflags-y += -dialect=c99
\r
32 cflags-y += -gccext=on
\r
33 cflags-y += -gdwarf-2
\r
36 # Generate dependencies
\r
37 cflags-y += -gccdepends -MMD
\r
43 cflags-y += -abi=eabi
\r
44 cflags-$(CFG_VLE) += -ppc_asm_to_vle # Convert ppc to vle ppc
\r
45 cflags-$(CFG_VLE) += -vle # Convert ppc to vle ppc
\r
46 cflags-y += -abi=eabi
\r
47 cflags-y += -proc=5565
\r
48 cflags-y += -fp=soft
\r
49 cflags-y += -use_isel=on
\r
50 cflags-y += -sdata=0xFFFF -sdata2=16
\r
52 #cflags-y += -fno-strict-aliasing
\r
53 #cflags-y += -fno-builtin
\r
55 # Get machine cflags
\r
56 #cflags-y += $(cflags-$(ARCH))
\r
58 CFLAGS = $(cflags-y) $(cflags-yy)
\r
62 # ---------------------------------------------------------------------------
\r
67 CPP_ASM_FLAGS += -ppopt noline -ppopt nopragma -dialect c
\r
71 space = $(empty) $(empty)
\r
74 cw_lib_path += -L$(CW_COMPILE)/PowerPC_EABI_Support/Runtime/Lib
\r
75 cw_lib_path += -L$(CW_COMPILE)/PowerPC_EABI_Support/MSL/MSL_C/PPC_EABI/Lib
\r
76 cc_inc_path += $(CW_COMPILE)/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include
\r
77 cc_inc_path += $(CW_COMPILE)/PowerPC_EABI_Support/MSL/MSL_C/PPC_EABI/Include
\r
78 inc-y += $(cc_inc_path)
\r
79 libpath-y += $(cw_lib_path)
\r
82 # libnames .bare - No operating system
\r
85 # S - software float
\r
86 # nothing really matches.......
\r
87 lib-$(CFG_VLE) += -lRuntime.PPCEABI.VS.a # is this VLE?
\r
88 lib-$(CFG_VLE) += -lMSL_C.PPCEABI.bare.SZ.VS.a
\r
89 ifneq ($(CFG_VLE),y)
\r
90 lib-y += -lRuntime.PPCEABI.S.a
\r
91 lib-y += -lMSL_C.PPCEABI.bare.SZ.S.a
\r
96 # ---------------------------------------------------------------------------
\r
99 # LDFLAGS - linker flags
\r
100 # LDOUT - How to Generate linker output file
\r
101 # LDMAPFILE - How to generate mapfile
\r
102 # ldcmdfile-y - link cmd file
\r
103 # libpath-y - lib paths
\r
104 # libitem-y - the libs with path
\r
105 # lib-y - the libs, without path
\r
108 LD = $(CW_BIN)/mwldeppc.exe
\r
112 # To make "rom" images (make LOAD() work)
\r
113 ldflags-y += -romaddr 0x0
\r
114 ldflags-y += -rambuffer 0x0
\r
115 #ldflags-y += -nodefaults
\r
116 ldflags-y += -gdwarf-2
\r
117 ldflags-y += -m _start
\r
119 ldflags-y += -map $(subst .$(TE),.map, $@)
\r
121 LDFLAGS += $(ldflags-y)
\r
126 libitem-y += $(libitem-yy)
\r
128 # ---------------------------------------------------------------------------
\r
131 # ASFLAGS - assembler flags
\r
132 # ASOUT - how to generate output file
\r
134 AS = $(CW_BIN)/mwasmeppc.exe
\r
136 asflags-y += -gnu_mode
\r
137 asflags-y += -proc e500 -gdwarf-2
\r
138 asflags-$(CFG_VLE) += -vle
\r
139 ASFLAGS += $(asflags-y)
\r
142 # ---------------------------------------------------------------------------
\r
145 #DDUMP = $(Q)$(COMPILER_ROOT)/$(cross_machine-y)-objcopy
\r
146 #DDUMP_FLAGS = -O srec
\r
147 #OBJCOPY = $(CROSS_COMPILE)objcopy
\r
149 # ---------------------------------------------------------------------------
\r
152 # AROUT - archiver flags
\r
154 #AR = $(CROSS_COMPILE)ar
\r