blob: 466e7407afc7b40b34dd149240ebf56b904a8913 [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
16# test for cross compiling
17COMPILE_ARCH = $(shell uname -m)
18
19# override top level makefile
20AS += -m68020
21LDFLAGS := -m m68kelf
22ifneq ($(COMPILE_ARCH),$(ARCH))
23 # prefix for cross-compiling binaries
24 CROSS_COMPILE = m68k-linux-
25endif
26
27ifdef CONFIG_SUN3
28LDFLAGS_vmlinux = -N
29endif
30
31CHECKFLAGS += -D__mc68000__
32
33# without -fno-strength-reduce the 53c7xx.c driver fails ;-(
34CFLAGS += -pipe -fno-strength-reduce -ffixed-a2
35
36# enable processor switch if compiled only for a single cpu
37ifndef CONFIG_M68020
38ifndef CONFIG_M68030
39
40ifndef CONFIG_M68060
41CFLAGS := $(CFLAGS) -m68040
42endif
43
44ifndef CONFIG_M68040
45CFLAGS := $(CFLAGS) -m68060
46endif
47
48endif
49endif
50
51ifdef CONFIG_KGDB
52# If configured for kgdb support, include debugging infos and keep the
53# frame pointer
54CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) -g
55endif
56
57ifndef CONFIG_SUN3
58head-y := arch/m68k/kernel/head.o
59else
60head-y := arch/m68k/kernel/sun3-head.o
61endif
62
63core-y += arch/m68k/kernel/ arch/m68k/mm/
64libs-y += arch/m68k/lib/
65
66core-$(CONFIG_Q40) += arch/m68k/q40/
67core-$(CONFIG_AMIGA) += arch/m68k/amiga/
68core-$(CONFIG_ATARI) += arch/m68k/atari/
69core-$(CONFIG_MAC) += arch/m68k/mac/
70core-$(CONFIG_HP300) += arch/m68k/hp300/
71core-$(CONFIG_APOLLO) += arch/m68k/apollo/
72core-$(CONFIG_MVME147) += arch/m68k/mvme147/
73core-$(CONFIG_MVME16x) += arch/m68k/mvme16x/
74core-$(CONFIG_BVME6000) += arch/m68k/bvme6000/
75core-$(CONFIG_SUN3X) += arch/m68k/sun3x/ arch/m68k/sun3/
76core-$(CONFIG_SUN3) += arch/m68k/sun3/ arch/m68k/sun3/prom/
77core-$(CONFIG_M68040) += arch/m68k/fpsp040/
78core-$(CONFIG_M68060) += arch/m68k/ifpsp060/
79core-$(CONFIG_M68KFPU_EMU) += arch/m68k/math-emu/
80
81all: zImage
82
83lilo: vmlinux
84 if [ -f $(INSTALL_PATH)/vmlinux ]; then mv -f $(INSTALL_PATH)/vmlinux $(INSTALL_PATH)/vmlinux.old; fi
85 if [ -f $(INSTALL_PATH)/System.map ]; then mv -f $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
86 cat vmlinux > $(INSTALL_PATH)/vmlinux
87 cp System.map $(INSTALL_PATH)/System.map
88 if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
89
90zImage compressed: vmlinux.gz
91
92vmlinux.gz: vmlinux
93
94ifndef CONFIG_KGDB
95 cp vmlinux vmlinux.tmp
96 $(STRIP) vmlinux.tmp
97 gzip -9c vmlinux.tmp >vmlinux.gz
98 rm vmlinux.tmp
99else
100 gzip -9c vmlinux >vmlinux.gz
101endif
102
103bzImage: vmlinux.bz2
104
105vmlinux.bz2: vmlinux
106
107ifndef CONFIG_KGDB
108 cp vmlinux vmlinux.tmp
109 $(STRIP) vmlinux.tmp
110 bzip2 -1c vmlinux.tmp >vmlinux.bz2
111 rm vmlinux.tmp
112else
113 bzip2 -1c vmlinux >vmlinux.bz2
114endif
115
116prepare: include/asm-$(ARCH)/offsets.h
117CLEAN_FILES += include/asm-$(ARCH)/offsets.h
118
119arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
120 include/config/MARKER
121
122include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
123 $(call filechk,gen-asm-offsets)
124
125archclean:
126 rm -f vmlinux.gz vmlinux.bz2