3 HOST := $(shell uname)
\r
7 # Bin: PowerPC_EABI_Tools/Command_Line_Tools/mwXXXXXX
\r
8 # libs: PowerPC_EABI_Support/Runtime/Lib/Runtime.XXXX
\r
9 # PowerPC_EABI_Support/MSL/MSL_C/PPC_EABI/Lib
\r
11 #CW_COMPILE=/c/devtools/cw_55xx
\r
12 CW_BIN = $(CW_COMPILE)/PowerPC_EABI_Tools/Command_Line_Tools
\r
13 CW_LIB = $(CW_COMPILE)/PowerPC_EABI_Support/Runtime/Lib
\r
16 # ---------------------------------------------------------------------------
\r
18 # CCFLAGS - compile flags
\r
20 CC = $(CW_BIN)/mwcceppc.exe
\r
22 cflags-y += -cpp_exceptions=off
\r
23 cflags-y += -readonlystrings
\r
24 cflags-y += -RTTI=off
\r
25 cflags-y += -dialect=c99
\r
26 cflags-y += -gccext=on
\r
27 cflags-y += -gdwarf-2
\r
29 cflags-y += -cwd explicit
\r
30 cflags-y += -msgstyle gcc
\r
31 cflags-$(CFG_OPT_RELEASE) += -opt level=2
\r
32 cflags-$(CFG_OPT_DEBUG) += -opt off
\r
34 # Generate dependencies,
\r
35 # Should be -MMD here but it only gives the *.c files (for some reason
\r
36 # the compiler thinks all include files are system file, option?)
\r
37 cflags-y += -gccdepends -MD
\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
51 cflags-y += -sdata=0 -sdata2=0
\r
53 #cflags-y += -fno-strict-aliasing
\r
54 #cflags-y += -fno-builtin
\r
56 # Get machine cflags
\r
57 #cflags-y += $(cflags-$(CFG_ARCH))
\r
59 CFLAGS = $(cflags-y) $(cflags-yy)
\r
63 # ---------------------------------------------------------------------------
\r
67 CPPOUT = -precompile
\r
69 CPP_ASM_FLAGS += -ppopt noline -ppopt nopragma -dialect c
\r
73 space = $(empty) $(empty)
\r
76 cw_lib_path += -L$(CW_COMPILE)/PowerPC_EABI_Support/Runtime/Lib
\r
77 cw_lib_path += -L$(CW_COMPILE)/PowerPC_EABI_Support/MSL/MSL_C/PPC_EABI/Lib
\r
78 cc_inc_path += $(CW_COMPILE)/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include
\r
79 cc_inc_path += $(CW_COMPILE)/PowerPC_EABI_Support/MSL/MSL_C/PPC_EABI/Include
\r
80 inc-y += $(cc_inc_path)
\r
81 libpath-y += $(cw_lib_path)
\r
84 # libnames .bare - No operating system
\r
87 # S - software float
\r
88 # nothing really matches.......
\r
89 lib-$(CFG_VLE) += -lRuntime.PPCEABI.VS.a # is this VLE?
\r
90 lib-$(CFG_VLE) += -lMSL_C.PPCEABI.bare.SZ.VS.a
\r
91 ifneq ($(CFG_VLE),y)
\r
92 lib-y += -lRuntime.PPCEABI.S.a
\r
93 lib-y += -lMSL_C.PPCEABI.bare.SZ.S.a
\r
98 # ---------------------------------------------------------------------------
\r
101 # LDFLAGS - linker flags
\r
102 # LDOUT - How to Generate linker output file
\r
103 # LDMAPFILE - How to generate mapfile
\r
104 # ldcmdfile-y - link cmd file
\r
105 # libpath-y - lib paths
\r
106 # libitem-y - the libs with path
\r
107 # lib-y - the libs, without path
\r
110 LD = $(CW_BIN)/mwldeppc.exe
\r
114 # To make "rom" images (make LOAD() work)
\r
115 ldflags-y += -romaddr 0x0
\r
116 ldflags-y += -rambuffer 0x0
\r
117 #ldflags-y += -nodefaults
\r
118 ldflags-y += -gdwarf-2
\r
119 ldflags-y += -m _start
\r
121 ldflags-y += -map $(subst .$(TE),.map, $@)
\r
123 LDFLAGS += $(ldflags-y)
\r
128 libitem-y += $(libitem-yy)
\r
130 # ---------------------------------------------------------------------------
\r
133 # ASFLAGS - assembler flags
\r
134 # ASOUT - how to generate output file
\r
136 AS = $(CW_BIN)/mwasmeppc.exe
\r
138 asflags-y += -gnu_mode
\r
139 asflags-y += -proc e500 -gdwarf-2
\r
140 asflags-$(CFG_VLE) += -vle
\r
141 ASFLAGS += $(asflags-y)
\r
145 define do-memory-footprint
\r
146 @gawk --non-decimal-data -f $(ROOTDIR)/scripts/memory_footprint_$(COMPILER).awk $(subst .elf,.map,$@)
\r
149 # Dependency generation
\r
150 define do-compile-post
\r
151 @sed -e "/.*PowerPC_EABI_Support/d;s/ \\\/ qqaass/;s/\\\/\//g;s/qqaass/\\\/" $(subst .o,.d,$@) > $(subst .o,.d,$@)d
\r
152 @mv $(subst .o,.d,$@)d $(subst .o,.d,$@)
\r
155 define do-memory-footprint2-$(CFG_MEMORY_FOOTPRINT2)
\r
156 @gawk -f $(ROOTDIR)/scripts/memory_footprint2_$(COMPILER).awk $(subst .$(TE),.map, $@)
\r