1 ############################################################################
3 # A Generic m68k 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 # DISABLE_XIP - set this to 1 to disable XIP code
10 # DISABLE_SHARED_LIBS - set this to 1 to disable shared libraries
11 # DISABLE_MOVE_RODATA - set this to 1 to disable moving rodata to text
12 # LOPT - library optimisation flags
13 # UOPT - user optimisation flags
15 # David McCullough <davidm@snapgear.com>
17 ############################################################################
22 ifndef CONSOLE_BAUD_RATE
23 CONSOLE_BAUD_RATE = 9600
26 ifndef EXTRA_MODULE_DIRS
27 ifeq ($(ROOTDIR)/modules,$(wildcard $(ROOTDIR)/modules))
28 ifneq ($(filter-out linux-2.0% linux-2.2% linux-2.4%, $(LINUXDIR)),)
29 EXTRA_MODULE_DIRS = $(ROOTDIR)/modules/
31 EXTRA_MODULE_DIRS = $(ROOTDIR)/modules
37 #define VERSIONPKG 1.0.0
41 VERSIONSTR = $(CONFIG_VENDOR)/$(CONFIG_PRODUCT) Version $(VERSIONPKG)
45 RELFILES = boot/boot.bin,.sgb boot/boot.elf images/imagez.bin,.sgu images/image.elf
52 ############################################################################
54 # The makefiles need to know how to do things in different contexts
55 # To save some pain we put it all here
57 # First settings we always want for all builds
60 # ARCH = kernel, TARGET_ARCH = uClibc
63 ifeq ($(shell egrep 'linux-2.[024]' $(ROOTDIR)/.config),)
69 ifneq ($(shell which m68k-uclinux-20060615-gcc),)
70 CROSS_COMPILE = m68k-uclinux-20060615-
72 CROSS_COMPILE = m68k-uclinux-
74 CROSS = $(CROSS_COMPILE)
75 CONFIGURE_HOST = m68k-elf
79 CC = ucfront-gcc $(CROSS_COMPILE)gcc $(CPUFLAGS)
80 AS = $(CROSS_COMPILE)as $(CPUFLAGS)
81 CXX = ucfront-g++ $(CROSS_COMPILE)g++ $(CPUFLAGS)
82 AR = $(CROSS_COMPILE)ar
83 LD = ucfront-ld $(CROSS_COMPILE)ld
84 OBJCOPY = $(CROSS_COMPILE)objcopy
85 RANLIB = $(CROSS_COMPILE)ranlib
87 STRIPTOOL = $(CROSS_COMPILE)strip
90 UCLINUX_BUILD_SET = 0 # have we set a special config below
92 ifndef DISABLE_SHARED_LIBS
93 ifeq ($(CONFIG_BINFMT_SHARED_FLAT),y)
98 # These can be used by configure.
99 # Either configure $(CONFIGURE_OPTS)
100 # or configure --host=$(TARGETARCH) --build=$(HOSTARCH) --target=$(TARGETARCH)
102 TARGETARCH := $(CROSS)linux
103 HOSTARCH := $(shell sh $(ROOTDIR)/tools/config.guess)
104 CONFIGURE_OPTS := --host=$(TARGETARCH) --build=$(HOSTARCH) --target=$(TARGETARCH)
106 ############################################################################
108 # General purpose lib building rules, uClibc.config uses these when
112 ifdef UCLINUX_BUILD_LIB
113 ifdef CONFIG_LIB_DEBUG
114 CFLAGS := $(if $(LOPT),$(LOPT),-O1) -g
116 CFLAGS := $(if $(LOPT),$(LOPT),-O2) -g -fomit-frame-pointer
119 CFLAGS += -fno-common -fno-builtin -Wall #-Werror
120 CFLAGS += $(VENDOR_CFLAGS) -DEMBED
123 CFLAGS += -mid-shared-library
130 # don't want all the CFLAGS for uClibc/Config
131 ARCH_CFLAGS := $(CPUFLAGS) $(CFLAGS)
133 CFLAGS += -Dlinux -D__linux__ -Dunix
134 CFLAGS += -D__uClinux__
135 LDFLAGS += -Wl,-elf2flt
136 ifndef DISABLE_MOVE_RODATA
137 LDFLAGS += -Wl,-move-rodata
141 LDFLAGS += -mid-shared-library -mshared-library-id=0 -Wl,-shared-lib-id,0
144 LDFLAGS += -msep-data
151 ############################################################################
153 # Settings for building user apps
156 ifdef UCLINUX_BUILD_USER
159 # We use a special shared libc
160 LIBC = -Wl,-R,$(ROOTDIR)/lib/libc.gdb $(SLIBC)
162 ifdef CONFIG_USER_DEBUG
163 CFLAGS := $(if $(UOPT),$(UOPT),-O1) -g
165 CFLAGS := $(if $(UOPT),$(UOPT),-Os) -g -fomit-frame-pointer
168 CFLAGS += -fno-common -fno-builtin -Wall #-Werror
169 CFLAGS += $(VENDOR_CFLAGS) -DEMBED
172 CFLAGS += -mid-shared-library -mshared-library-id=0
179 # don't want all the CFLAGS for uClibc/Config
180 ARCH_CFLAGS := $(CFLAGS)
182 CFLAGS += -Dlinux -D__linux__ -Dunix
183 CFLAGS += -D__uClinux__
185 CXXFLAGS = $(CFLAGS) -nostdinc++ -fno-exceptions
188 LDFLAGS += -Wl,-elf2flt
189 ifndef DISABLE_MOVE_RODATA
190 LDFLAGS += -Wl,-move-rodata
194 LDFLAGS += -mid-shared-library -mshared-library-id=0 -Wl,-shared-lib-id,0
197 LDFLAGS += -msep-data
206 # for anyone still using it
212 ############################################################################
214 # fall through, do other config options perhaps
217 ifeq ($(UCLINUX_BUILD_SET),1)
218 EXTRA_CFLAGS := $(CPUFLAGS)
225 ############################################################################