1 ############################################################################
3 # A Generic sh config.arch that can be included by other platforms
4 # to reduce the number of places that need to be edited when something
5 # common changes. If you include this file you may provide:
7 # CPUFLAGS - cpu specific flags to pass to the compiler
8 # VENDOR_CFLAGS - vendor specific flags to pass to the compiler
9 # LOPT - library optimisation flags
10 # UOPT - user optimisation flags
11 # GLIBC_TARGET_OPTS - flags needed for gcc
12 # DISABLE_SHARED_SLL - Force openssl to not be shared.
14 # David McCullough <davidm@snapgear.com>
16 ############################################################################
18 ifndef CONSOLE_BAUD_RATE
19 CONSOLE_BAUD_RATE = 57600
22 ifndef EXTRA_MODULE_DIRS
23 ifeq ($(ROOTDIR)/modules,$(wildcard $(ROOTDIR)/modules))
24 ifneq ($(filter-out linux-2.0% linux-2.2% linux-2.4%, $(LINUXDIR)),)
25 EXTRA_MODULE_DIRS = $(ROOTDIR)/modules/
27 EXTRA_MODULE_DIRS = $(ROOTDIR)/modules
33 HW_PRODUCT = $(CONFIG_PRODUCT)
37 HW_VENDOR = $(CONFIG_VENDOR)
45 VERSIONSTR = $(CONFIG_VENDOR)/$(CONFIG_PRODUCT) Version $(VERSIONPKG)
49 RELFILES = boot/boot.bin,.sgb boot/boot.elf \
50 images/image.bin,.sgu images/sh.mot images/flash.bin $(LINUXDIR)/linux \
51 prop/config/metaconfig.conf
58 ############################################################################
60 # The makefiles need to know how to do things in different contexts
61 # To save some pain we put it all here
63 # First settings we always want for all build
69 CROSS_COMPILE = sh-linux-
70 ifneq ($(shell which sh-linux-gnu-gcc),)
71 CROSS_COMPILE = sh-linux-gnu-
73 ifneq ($(shell which sh-linux-20070413-gcc),)
74 CROSS_COMPILE = sh-linux-20070413-
77 KERNEL_CROSS_COMPILE = sh-linux-
78 ifneq ($(shell which sh-linux-gnu-gcc),)
79 KERNEL_CROSS_COMPILE = sh-linux-gnu-
81 ifeq ($(filter-out linux-2.0% linux-2.2% linux-2.4%, $(LINUXDIR)),)
82 ifneq ($(shell which sh-linux-20021008-gcc),)
83 KERNEL_CROSS_COMPILE = sh-linux-20021008-
87 CROSS = $(CROSS_COMPILE)
88 CONFIGURE_HOST = sh-linux
90 CC = $(ucfront_cc) $(CROSS_COMPILE)gcc $(CPUFLAGS)
91 AS = $(CROSS_COMPILE)as $(CPUFLAGS)
92 CXX = $(ucfront_cxx) $(CROSS_COMPILE)g++ $(CPUFLAGS)
93 AR = $(CROSS_COMPILE)ar
94 LD = $(ucfront_ld) $(CROSS_COMPILE)ld
95 OBJCOPY = $(CROSS_COMPILE)objcopy
96 RANLIB = $(CROSS_COMPILE)ranlib
98 STRIPTOOL = $(CROSS_COMPILE)strip
101 ############################################################################
103 # have we set a special config below
105 UCLINUX_BUILD_SET = 0
107 # These can be used by configure.
108 # Either configure $(CONFIGURE_OPTS)
109 # or configure --host=$(TARGETARCH) --build=$(HOSTARCH) --target=$(TARGETARCH)
111 TARGETARCH := sh-linux
112 HOSTARCH := $(shell sh $(ROOTDIR)/tools/config.guess)
113 CONFIGURE_OPTS := --host=$(TARGETARCH) --build=$(HOSTARCH) --target=$(TARGETARCH)
115 ############################################################################
117 # General purpose lib building rules, uClibc.config uses these when
121 ifdef UCLINUX_BUILD_LIB
122 ifdef CONFIG_LIB_DEBUG
123 CFLAGS := $(if $(LOPT),$(LOPT),-O1) -g
125 CFLAGS := $(if $(LOPT),$(LOPT),-O1) -g -fomit-frame-pointer
128 CFLAGS += -fno-common -fno-builtin -Wall #-Werror
129 CFLAGS += $(VENDOR_CFLAGS) -DEMBED
130 LDFLAGS += -fno-common -fno-builtin
132 # don't want all the CFLAGS for uClibc/Config
133 ARCH_CFLAGS := $(CFLAGS)
138 ############################################################################
140 # Settings for building user apps
143 ifdef UCLINUX_BUILD_USER
144 ifdef CONFIG_USER_DEBUG
145 CFLAGS := $(if $(UOPT),$(UOPT),-O1) -g
147 CFLAGS := $(if $(UOPT),$(UOPT),-O1) -g -fomit-frame-pointer
150 CFLAGS += -fno-common -fno-builtin -Wall #-Werror
151 CFLAGS += $(VENDOR_CFLAGS) -DEMBED
152 LDFLAGS += -fno-common -fno-builtin
154 CXXFLAGS = $(CFLAGS) -nostdinc++
155 CXXSUP := $(shell $(CXX) -print-file-name=libsupc++.a)
160 # for anyone still using it
166 ############################################################################
168 # fall through, do other config options perhaps
171 ifeq ($(UCLINUX_BUILD_SET),1)
172 EXTRA_CFLAGS := $(CPUFLAGS)
177 SH_LDFLAGS = $(LDFLAGS)
178 SH_LDLIBS = $(LDLIBS)
180 ucfront_cc := ucfront-gcc
181 ucfront_cxx := ucfront-g++
182 ucfront_ld := ucfront-ld
185 ############################################################################