xref: /OK3568_Linux_fs/kernel/arch/m68k/Makefile (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun#
2*4882a593Smuzhiyun# m68k/Makefile
3*4882a593Smuzhiyun#
4*4882a593Smuzhiyun# This file is included by the global makefile so that you can add your own
5*4882a593Smuzhiyun# architecture-specific flags and dependencies. Remember to do have actions
6*4882a593Smuzhiyun# for "archclean" and "archdep" for cleaning up and making dependencies for
7*4882a593Smuzhiyun# this architecture
8*4882a593Smuzhiyun#
9*4882a593Smuzhiyun# This file is subject to the terms and conditions of the GNU General Public
10*4882a593Smuzhiyun# License.  See the file "COPYING" in the main directory of this archive
11*4882a593Smuzhiyun# for more details.
12*4882a593Smuzhiyun#
13*4882a593Smuzhiyun# Copyright (C) 1994 by Hamish Macdonald
14*4882a593Smuzhiyun# Copyright (C) 2002,2011 Greg Ungerer <gerg@snapgear.com>
15*4882a593Smuzhiyun#
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunKBUILD_DEFCONFIG := multi_defconfig
18*4882a593Smuzhiyun
19*4882a593Smuzhiyunifneq ($(SUBARCH),$(ARCH))
20*4882a593Smuzhiyun	ifeq ($(CROSS_COMPILE),)
21*4882a593Smuzhiyun		CROSS_COMPILE := $(call cc-cross-prefix, \
22*4882a593Smuzhiyun			m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
23*4882a593Smuzhiyun	endif
24*4882a593Smuzhiyunendif
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun#
27*4882a593Smuzhiyun#	Enable processor type. Ordering of these is important - we want to
28*4882a593Smuzhiyun#	use the minimum processor type of the range we support. The logic
29*4882a593Smuzhiyun#	for 680x0 will only allow use of the -m68060 or -m68040 if no other
30*4882a593Smuzhiyun#	680x0 type is specified - and no option is specified for 68030 or
31*4882a593Smuzhiyun#	68020. The other m68k/ColdFire types always specify some type of
32*4882a593Smuzhiyun#	compiler cpu type flag.
33*4882a593Smuzhiyun#
34*4882a593Smuzhiyunifndef CONFIG_M68040
35*4882a593Smuzhiyuncpuflags-$(CONFIG_M68060)	= -m68060
36*4882a593Smuzhiyunendif
37*4882a593Smuzhiyunifndef CONFIG_M68060
38*4882a593Smuzhiyuncpuflags-$(CONFIG_M68040)	= -m68040
39*4882a593Smuzhiyunendif
40*4882a593Smuzhiyuncpuflags-$(CONFIG_M68030)	=
41*4882a593Smuzhiyuncpuflags-$(CONFIG_M68020)	=
42*4882a593Smuzhiyuncpuflags-$(CONFIG_M68000)	= -m68000
43*4882a593Smuzhiyuncpuflags-$(CONFIG_M5441x)	= $(call cc-option,-mcpu=54455,-mcfv4e)
44*4882a593Smuzhiyuncpuflags-$(CONFIG_M54xx)	= $(call cc-option,-mcpu=5475,-m5200)
45*4882a593Smuzhiyuncpuflags-$(CONFIG_M5407)	= $(call cc-option,-mcpu=5407,-m5200)
46*4882a593Smuzhiyuncpuflags-$(CONFIG_M532x)	= $(call cc-option,-mcpu=532x,-m5307)
47*4882a593Smuzhiyuncpuflags-$(CONFIG_M537x)	= $(call cc-option,-mcpu=537x,-m5307)
48*4882a593Smuzhiyuncpuflags-$(CONFIG_M5307)	= $(call cc-option,-mcpu=5307,-m5200)
49*4882a593Smuzhiyuncpuflags-$(CONFIG_M528x)	= $(call cc-option,-mcpu=528x,-m5307)
50*4882a593Smuzhiyuncpuflags-$(CONFIG_M5275)	= $(call cc-option,-mcpu=5275,-m5307)
51*4882a593Smuzhiyuncpuflags-$(CONFIG_M5272)	= $(call cc-option,-mcpu=5272,-m5307)
52*4882a593Smuzhiyuncpuflags-$(CONFIG_M5271)	= $(call cc-option,-mcpu=5271,-m5307)
53*4882a593Smuzhiyuncpuflags-$(CONFIG_M523x)	= $(call cc-option,-mcpu=523x,-m5307)
54*4882a593Smuzhiyuncpuflags-$(CONFIG_M525x)	= $(call cc-option,-mcpu=5253,-m5200)
55*4882a593Smuzhiyuncpuflags-$(CONFIG_M5249)	= $(call cc-option,-mcpu=5249,-m5200)
56*4882a593Smuzhiyuncpuflags-$(CONFIG_M520x)	= $(call cc-option,-mcpu=5208,-m5200)
57*4882a593Smuzhiyuncpuflags-$(CONFIG_M5206e)	= $(call cc-option,-mcpu=5206e,-m5200)
58*4882a593Smuzhiyuncpuflags-$(CONFIG_M5206)	= $(call cc-option,-mcpu=5206,-m5200)
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun# Evaluate tune cc-option calls now
61*4882a593Smuzhiyuncpuflags-y := $(cpuflags-y)
62*4882a593Smuzhiyun
63*4882a593SmuzhiyunKBUILD_AFLAGS += $(cpuflags-y)
64*4882a593SmuzhiyunKBUILD_CFLAGS += $(cpuflags-y)
65*4882a593Smuzhiyun
66*4882a593SmuzhiyunKBUILD_CFLAGS += -pipe -ffreestanding
67*4882a593Smuzhiyun
68*4882a593Smuzhiyunifdef CONFIG_MMU
69*4882a593Smuzhiyun# without -fno-strength-reduce the 53c7xx.c driver fails ;-(
70*4882a593SmuzhiyunKBUILD_CFLAGS += -fno-strength-reduce -ffixed-a2
71*4882a593Smuzhiyunelse
72*4882a593Smuzhiyun# we can use a m68k-linux-gcc toolchain with these in place
73*4882a593SmuzhiyunKBUILD_CPPFLAGS += -DUTS_SYSNAME=\"uClinux\"
74*4882a593SmuzhiyunKBUILD_CPPFLAGS += -D__uClinux__
75*4882a593Smuzhiyunendif
76*4882a593Smuzhiyun
77*4882a593SmuzhiyunKBUILD_LDFLAGS := -m m68kelf
78*4882a593Smuzhiyun
79*4882a593Smuzhiyunifdef CONFIG_SUN3
80*4882a593SmuzhiyunLDFLAGS_vmlinux = -N
81*4882a593Smuzhiyunendif
82*4882a593Smuzhiyun
83*4882a593SmuzhiyunCHECKFLAGS += -D__mc68000__
84*4882a593Smuzhiyun
85*4882a593Smuzhiyun
86*4882a593Smuzhiyunifdef CONFIG_KGDB
87*4882a593Smuzhiyun# If configured for kgdb support, include debugging infos and keep the
88*4882a593Smuzhiyun# frame pointer
89*4882a593SmuzhiyunKBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
90*4882a593Smuzhiyunendif
91*4882a593Smuzhiyun
92*4882a593Smuzhiyun#
93*4882a593Smuzhiyun# Select the assembler head startup code. Order is important. The default
94*4882a593Smuzhiyun# head code is first, processor specific selections can override it after.
95*4882a593Smuzhiyun#
96*4882a593Smuzhiyunhead-y				:= arch/m68k/kernel/head.o
97*4882a593Smuzhiyunhead-$(CONFIG_SUN3)		:= arch/m68k/kernel/sun3-head.o
98*4882a593Smuzhiyunhead-$(CONFIG_M68000)		:= arch/m68k/68000/head.o
99*4882a593Smuzhiyunhead-$(CONFIG_COLDFIRE)		:= arch/m68k/coldfire/head.o
100*4882a593Smuzhiyun
101*4882a593Smuzhiyuncore-y				+= arch/m68k/
102*4882a593Smuzhiyunlibs-y				+= arch/m68k/lib/
103*4882a593Smuzhiyun
104*4882a593Smuzhiyun
105*4882a593Smuzhiyunall:	zImage
106*4882a593Smuzhiyun
107*4882a593Smuzhiyunlilo:	vmlinux
108*4882a593Smuzhiyun	if [ -f $(INSTALL_PATH)/vmlinux ]; then mv -f $(INSTALL_PATH)/vmlinux $(INSTALL_PATH)/vmlinux.old; fi
109*4882a593Smuzhiyun	if [ -f $(INSTALL_PATH)/System.map ]; then mv -f $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
110*4882a593Smuzhiyun	cat vmlinux > $(INSTALL_PATH)/vmlinux
111*4882a593Smuzhiyun	cp System.map $(INSTALL_PATH)/System.map
112*4882a593Smuzhiyun	if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
113*4882a593Smuzhiyun
114*4882a593SmuzhiyunzImage compressed: vmlinux.gz
115*4882a593Smuzhiyun
116*4882a593Smuzhiyunvmlinux.gz: vmlinux
117*4882a593Smuzhiyun
118*4882a593Smuzhiyunifndef CONFIG_KGDB
119*4882a593Smuzhiyun	cp vmlinux vmlinux.tmp
120*4882a593Smuzhiyun	$(STRIP) vmlinux.tmp
121*4882a593Smuzhiyun	$(KGZIP) -9c vmlinux.tmp >vmlinux.gz
122*4882a593Smuzhiyun	rm vmlinux.tmp
123*4882a593Smuzhiyunelse
124*4882a593Smuzhiyun	$(KGZIP) -9c vmlinux >vmlinux.gz
125*4882a593Smuzhiyunendif
126*4882a593Smuzhiyun
127*4882a593SmuzhiyunbzImage: vmlinux.bz2
128*4882a593Smuzhiyun
129*4882a593Smuzhiyunvmlinux.bz2: vmlinux
130*4882a593Smuzhiyun
131*4882a593Smuzhiyunifndef CONFIG_KGDB
132*4882a593Smuzhiyun	cp vmlinux vmlinux.tmp
133*4882a593Smuzhiyun	$(STRIP) vmlinux.tmp
134*4882a593Smuzhiyun	$(KBZIP2) -1c vmlinux.tmp >vmlinux.bz2
135*4882a593Smuzhiyun	rm vmlinux.tmp
136*4882a593Smuzhiyunelse
137*4882a593Smuzhiyun	$(KBZIP2) -1c vmlinux >vmlinux.bz2
138*4882a593Smuzhiyunendif
139*4882a593Smuzhiyun
140*4882a593SmuzhiyunCLEAN_FILES += vmlinux.gz vmlinux.bz2
141*4882a593Smuzhiyun
142*4882a593Smuzhiyunarchheaders:
143*4882a593Smuzhiyun	$(Q)$(MAKE) $(build)=arch/m68k/kernel/syscalls all
144*4882a593Smuzhiyun
145*4882a593Smuzhiyuninstall:
146*4882a593Smuzhiyun	sh $(srctree)/arch/m68k/install.sh $(KERNELRELEASE) vmlinux.gz System.map "$(INSTALL_PATH)"
147