############################################################################ # # A Generic sh config.arch that can be included by other platforms # to reduce the number of places that need to be edited when something # common changes. If you include this file you may provide: # # CPUFLAGS - cpu specific flags to pass to the compiler # VENDOR_CFLAGS - vendor specific flags to pass to the compiler # LOPT - library optimisation flags # UOPT - user optimisation flags # GLIBC_TARGET_OPTS - flags needed for gcc # DISABLE_SHARED_SLL - Force openssl to not be shared. # # David McCullough # ############################################################################ ifndef CONSOLE_BAUD_RATE CONSOLE_BAUD_RATE = 57600 endif ifndef EXTRA_MODULE_DIRS ifeq ($(ROOTDIR)/modules,$(wildcard $(ROOTDIR)/modules)) ifneq ($(filter-out linux-2.0% linux-2.2% linux-2.4%, $(LINUXDIR)),) EXTRA_MODULE_DIRS = $(ROOTDIR)/modules/ else EXTRA_MODULE_DIRS = $(ROOTDIR)/modules endif endif endif ifndef HW_PRODUCT HW_PRODUCT = $(CONFIG_PRODUCT) endif ifndef HW_VENDOR HW_VENDOR = $(CONFIG_VENDOR) endif ifndef VERSIONPKG VERSIONPKG := 1.0.0 endif ifndef VERSIONSTR VERSIONSTR = $(CONFIG_VENDOR)/$(CONFIG_PRODUCT) Version $(VERSIONPKG) endif ifndef RELFILES RELFILES = boot/boot.bin,.sgb boot/boot.elf \ images/image.bin,.sgu images/sh.mot images/flash.bin $(LINUXDIR)/linux \ prop/config/metaconfig.conf endif ifndef NFIMAGE NFIMAGE=image.bin endif ############################################################################ # # The makefiles need to know how to do things in different contexts # To save some pain we put it all here # # First settings we always want for all build ENDIAN ?= little MACHINE = sh ARCH = sh CROSS_COMPILE = sh-linux- ifneq ($(shell which sh-linux-gnu-gcc),) CROSS_COMPILE = sh-linux-gnu- endif ifneq ($(shell which sh-linux-20070413-gcc),) CROSS_COMPILE = sh-linux-20070413- endif KERNEL_CROSS_COMPILE = sh-linux- ifneq ($(shell which sh-linux-gnu-gcc),) KERNEL_CROSS_COMPILE = sh-linux-gnu- endif ifeq ($(filter-out linux-2.0% linux-2.2% linux-2.4%, $(LINUXDIR)),) ifneq ($(shell which sh-linux-20021008-gcc),) KERNEL_CROSS_COMPILE = sh-linux-20021008- endif endif CROSS = $(CROSS_COMPILE) CONFIGURE_HOST = sh-linux CC = $(ucfront_cc) $(CROSS_COMPILE)gcc $(CPUFLAGS) AS = $(CROSS_COMPILE)as $(CPUFLAGS) CXX = $(ucfront_cxx) $(CROSS_COMPILE)g++ $(CPUFLAGS) AR = $(CROSS_COMPILE)ar LD = $(ucfront_ld) $(CROSS_COMPILE)ld OBJCOPY = $(CROSS_COMPILE)objcopy RANLIB = $(CROSS_COMPILE)ranlib ELF2FLT = : STRIPTOOL = $(CROSS_COMPILE)strip STRIP = $(STRIPTOOL) ############################################################################ # # have we set a special config below UCLINUX_BUILD_SET = 0 # These can be used by configure. # Either configure $(CONFIGURE_OPTS) # or configure --host=$(TARGETARCH) --build=$(HOSTARCH) --target=$(TARGETARCH) # TARGETARCH := sh-linux HOSTARCH := $(shell sh $(ROOTDIR)/tools/config.guess) CONFIGURE_OPTS := --host=$(TARGETARCH) --build=$(HOSTARCH) --target=$(TARGETARCH) ############################################################################ # # General purpose lib building rules, uClibc.config uses these when # possible # ifdef UCLINUX_BUILD_LIB ifdef CONFIG_LIB_DEBUG CFLAGS := $(if $(LOPT),$(LOPT),-O1) -g else CFLAGS := $(if $(LOPT),$(LOPT),-O1) -g -fomit-frame-pointer endif CFLAGS += -pipe CFLAGS += -fno-common -fno-builtin -Wall #-Werror CFLAGS += $(VENDOR_CFLAGS) -DEMBED LDFLAGS += -fno-common -fno-builtin # don't want all the CFLAGS for uClibc/Config ARCH_CFLAGS := $(CFLAGS) UCLINUX_BUILD_SET=1 endif ############################################################################ # # Settings for building user apps # ifdef UCLINUX_BUILD_USER ifdef CONFIG_USER_DEBUG CFLAGS := $(if $(UOPT),$(UOPT),-O1) -g else CFLAGS := $(if $(UOPT),$(UOPT),-O1) -g -fomit-frame-pointer endif CFLAGS += -pipe CFLAGS += -fno-common -fno-builtin -Wall #-Werror CFLAGS += $(VENDOR_CFLAGS) -DEMBED LDFLAGS += -fno-common -fno-builtin CXXFLAGS = $(CFLAGS) -nostdinc++ CXXSUP := $(shell $(CXX) -print-file-name=libsupc++.a) FLTFLAGS := export FLTFLAGS # for anyone still using it CONVERT = /bin/true UCLINUX_BUILD_SET=1 endif ############################################################################ # # fall through, do other config options perhaps # ifeq ($(UCLINUX_BUILD_SET),1) EXTRA_CFLAGS := $(CPUFLAGS) CXXLIBS = LDLIBS = $(LIBBIND) SH_LDFLAGS = $(LDFLAGS) SH_LDLIBS = $(LDLIBS) ucfront_cc := ucfront-gcc ucfront_cxx := ucfront-g++ ucfront_ld := ucfront-ld endif ############################################################################