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
12 # ---------------------------------------------------------------------------
\r
14 # CCFLAGS - compile flags
\r
16 CC = $(CROSS_COMPILE)gcc
\r
17 cflags-$(CFG_RELEASE) += -O3
\r
18 cflags-$(CFG_DEBUG) += -O0
\r
22 ifneq ($(filter -O2 -O3 -O1,$(cflags-y)),)
\r
23 cflags-y += -fno-schedule-insns -fno-schedule-insns2
\r
26 # Remove sections if needed.. may be problems with other compilers here.
\r
27 #cflags-$(CFG_MPC55XX) += -ffunction-sections
\r
31 #cflags-y += -fno-common
\r
32 cflags-y += -std=gnu99
\r
34 # Generate dependencies
\r
39 cflags-y += -Winline # warn if inline failed
\r
42 cflags-y += -fno-strict-aliasing
\r
43 cflags-y += -fno-builtin
\r
45 # Get machine cflags
\r
46 #cflags-y += $(cflags-$(ARCH))
\r
48 CFLAGS = $(cflags-y) $(cflags-yy)
\r
52 # ---------------------------------------------------------------------------
\r
59 space = $(empty) $(empty)
\r
62 # Libs related to GCC(libgcc.a, libgcov.a) is located under
\r
63 # lib/gcc/<machine>/<version>/<multilib>
\r
64 # Libs related to the library (libc.a,libm.a,etc) are under:
\r
65 # <machine>/lib/<multilib>
\r
67 # It seems some versions of make want "\=" and some "="
\r
68 # "=" - msys cpmake on windows 7
\r
69 gcc_lib_path := "$(subst /libgcc.a,,$(shell $(CC) $(CFLAGS) --print-libgcc-file-name))"
\r
70 lib_lib_path := "$(subst /libc.a,,$(shell $(CC) $(CFLAGS) --print-file-name=libc.a))"
\r
71 libpath-y += -L$(lib_lib_path)
\r
72 libpath-y += -L$(gcc_lib_path)
\r
73 # ---------------------------------------------------------------------------
\r
76 # LDFLAGS - linker flags
\r
77 # LDOUT - How to Generate linker output file
\r
78 # LDMAPFILE - How to generate mapfile
\r
79 # ldcmdfile-y - link cmd file
\r
80 # libpath-y - lib paths
\r
81 # libitem-y - the libs with path
\r
82 # lib-y - the libs, without path
\r
85 LD = $(CROSS_COMPILE)ld
\r
89 LDMAPFILE = -M > $(subst .$(TE),.map, $@)
\r
91 libitem-y += $(libitem-yy)
\r
93 # ---------------------------------------------------------------------------
\r
96 # ASFLAGS - assembler flags
\r
97 # ASOUT - how to generate output file
\r
99 AS = $(CROSS_COMPILE)as
\r
101 ASFLAGS += --gdwarf2
\r
104 # ---------------------------------------------------------------------------
\r
107 #DDUMP = $(Q)$(COMPILER_ROOT)/$(cross_machine-y)-objcopy
\r
108 #DDUMP_FLAGS = -O srec
\r
109 OBJCOPY = $(CROSS_COMPILE)objcopy
\r
111 # ---------------------------------------------------------------------------
\r
114 # AROUT - archiver flags
\r
116 AR = $(CROSS_COMPILE)ar
\r