blob: 8133dbc449642e3dd3258952f10807b2a7a2159e [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#
2# m68k/Makefile
3#
4# This file is included by the global makefile so that you can add your own
5# architecture-specific flags and dependencies. Remember to do have actions
6# for "archclean" and "archdep" for cleaning up and making dependencies for
7# this architecture
8#
9# This file is subject to the terms and conditions of the GNU General Public
10# License. See the file "COPYING" in the main directory of this archive
11# for more details.
12#
13# Copyright (C) 1994 by Hamish Macdonald
14#
15
Adrian Bunkb7399122008-07-17 21:16:14 +020016KBUILD_DEFCONFIG := multi_defconfig
Adrian Bunkef85ecbf2008-04-04 14:57:38 +020017
Linus Torvalds1da177e2005-04-16 15:20:36 -070018# override top level makefile
19AS += -m68020
20LDFLAGS := -m m68kelf
Roman Zippelfbe9c962007-05-31 00:40:50 -070021LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
Geert Uytterhoeven6f7127d2008-02-04 22:30:17 -080022ifneq ($(SUBARCH),$(ARCH))
23 ifeq ($(CROSS_COMPILE),)
24 CROSS_COMPILE := $(call cc-cross-prefix, \
25 m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
26 endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070027endif
28
29ifdef CONFIG_SUN3
30LDFLAGS_vmlinux = -N
31endif
32
33CHECKFLAGS += -D__mc68000__
34
35# without -fno-strength-reduce the 53c7xx.c driver fails ;-(
Sam Ravnborga0f97e02007-10-14 22:21:35 +020036KBUILD_CFLAGS += -pipe -fno-strength-reduce -ffixed-a2
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
38# enable processor switch if compiled only for a single cpu
39ifndef CONFIG_M68020
40ifndef CONFIG_M68030
41
42ifndef CONFIG_M68060
Sam Ravnborga0f97e02007-10-14 22:21:35 +020043KBUILD_CFLAGS += -m68040
Linus Torvalds1da177e2005-04-16 15:20:36 -070044endif
45
46ifndef CONFIG_M68040
Sam Ravnborga0f97e02007-10-14 22:21:35 +020047KBUILD_CFLAGS += -m68060
Linus Torvalds1da177e2005-04-16 15:20:36 -070048endif
49
50endif
51endif
52
53ifdef CONFIG_KGDB
54# If configured for kgdb support, include debugging infos and keep the
55# frame pointer
Sam Ravnborga0f97e02007-10-14 22:21:35 +020056KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
Linus Torvalds1da177e2005-04-16 15:20:36 -070057endif
58
59ifndef CONFIG_SUN3
60head-y := arch/m68k/kernel/head.o
61else
62head-y := arch/m68k/kernel/sun3-head.o
63endif
64
65core-y += arch/m68k/kernel/ arch/m68k/mm/
66libs-y += arch/m68k/lib/
67
68core-$(CONFIG_Q40) += arch/m68k/q40/
69core-$(CONFIG_AMIGA) += arch/m68k/amiga/
70core-$(CONFIG_ATARI) += arch/m68k/atari/
71core-$(CONFIG_MAC) += arch/m68k/mac/
72core-$(CONFIG_HP300) += arch/m68k/hp300/
73core-$(CONFIG_APOLLO) += arch/m68k/apollo/
74core-$(CONFIG_MVME147) += arch/m68k/mvme147/
75core-$(CONFIG_MVME16x) += arch/m68k/mvme16x/
76core-$(CONFIG_BVME6000) += arch/m68k/bvme6000/
77core-$(CONFIG_SUN3X) += arch/m68k/sun3x/ arch/m68k/sun3/
78core-$(CONFIG_SUN3) += arch/m68k/sun3/ arch/m68k/sun3/prom/
79core-$(CONFIG_M68040) += arch/m68k/fpsp040/
80core-$(CONFIG_M68060) += arch/m68k/ifpsp060/
81core-$(CONFIG_M68KFPU_EMU) += arch/m68k/math-emu/
82
83all: zImage
84
85lilo: vmlinux
86 if [ -f $(INSTALL_PATH)/vmlinux ]; then mv -f $(INSTALL_PATH)/vmlinux $(INSTALL_PATH)/vmlinux.old; fi
87 if [ -f $(INSTALL_PATH)/System.map ]; then mv -f $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
88 cat vmlinux > $(INSTALL_PATH)/vmlinux
89 cp System.map $(INSTALL_PATH)/System.map
90 if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
91
92zImage compressed: vmlinux.gz
93
94vmlinux.gz: vmlinux
95
96ifndef CONFIG_KGDB
97 cp vmlinux vmlinux.tmp
98 $(STRIP) vmlinux.tmp
99 gzip -9c vmlinux.tmp >vmlinux.gz
100 rm vmlinux.tmp
101else
102 gzip -9c vmlinux >vmlinux.gz
103endif
104
105bzImage: vmlinux.bz2
106
107vmlinux.bz2: vmlinux
108
109ifndef CONFIG_KGDB
110 cp vmlinux vmlinux.tmp
111 $(STRIP) vmlinux.tmp
112 bzip2 -1c vmlinux.tmp >vmlinux.bz2
113 rm vmlinux.tmp
114else
115 bzip2 -1c vmlinux >vmlinux.bz2
116endif
117
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118archclean:
119 rm -f vmlinux.gz vmlinux.bz2