kbuild: enable 'make CFLAGS=...' to add additional options to CC
[deliverable/linux.git] / arch / m68k / Makefile
CommitLineData
1da177e4
LT
1#
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
fbe9c961 22LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
1da177e4
LT
23ifneq ($(COMPILE_ARCH),$(ARCH))
24 # prefix for cross-compiling binaries
ec0203e7 25 CROSS_COMPILE = m68k-linux-gnu-
1da177e4
LT
26endif
27
28ifdef CONFIG_SUN3
29LDFLAGS_vmlinux = -N
30endif
31
32CHECKFLAGS += -D__mc68000__
33
34# without -fno-strength-reduce the 53c7xx.c driver fails ;-(
a0f97e06 35KBUILD_CFLAGS += -pipe -fno-strength-reduce -ffixed-a2
1da177e4
LT
36
37# enable processor switch if compiled only for a single cpu
38ifndef CONFIG_M68020
39ifndef CONFIG_M68030
40
41ifndef CONFIG_M68060
a0f97e06 42KBUILD_CFLAGS += -m68040
1da177e4
LT
43endif
44
45ifndef CONFIG_M68040
a0f97e06 46KBUILD_CFLAGS += -m68060
1da177e4
LT
47endif
48
49endif
50endif
51
52ifdef CONFIG_KGDB
53# If configured for kgdb support, include debugging infos and keep the
54# frame pointer
a0f97e06 55KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
1da177e4
LT
56endif
57
58ifndef CONFIG_SUN3
59head-y := arch/m68k/kernel/head.o
60else
61head-y := arch/m68k/kernel/sun3-head.o
62endif
63
64core-y += arch/m68k/kernel/ arch/m68k/mm/
65libs-y += arch/m68k/lib/
66
67core-$(CONFIG_Q40) += arch/m68k/q40/
68core-$(CONFIG_AMIGA) += arch/m68k/amiga/
69core-$(CONFIG_ATARI) += arch/m68k/atari/
70core-$(CONFIG_MAC) += arch/m68k/mac/
71core-$(CONFIG_HP300) += arch/m68k/hp300/
72core-$(CONFIG_APOLLO) += arch/m68k/apollo/
73core-$(CONFIG_MVME147) += arch/m68k/mvme147/
74core-$(CONFIG_MVME16x) += arch/m68k/mvme16x/
75core-$(CONFIG_BVME6000) += arch/m68k/bvme6000/
76core-$(CONFIG_SUN3X) += arch/m68k/sun3x/ arch/m68k/sun3/
77core-$(CONFIG_SUN3) += arch/m68k/sun3/ arch/m68k/sun3/prom/
78core-$(CONFIG_M68040) += arch/m68k/fpsp040/
79core-$(CONFIG_M68060) += arch/m68k/ifpsp060/
80core-$(CONFIG_M68KFPU_EMU) += arch/m68k/math-emu/
81
82all: zImage
83
84lilo: vmlinux
85 if [ -f $(INSTALL_PATH)/vmlinux ]; then mv -f $(INSTALL_PATH)/vmlinux $(INSTALL_PATH)/vmlinux.old; fi
86 if [ -f $(INSTALL_PATH)/System.map ]; then mv -f $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
87 cat vmlinux > $(INSTALL_PATH)/vmlinux
88 cp System.map $(INSTALL_PATH)/System.map
89 if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
90
91zImage compressed: vmlinux.gz
92
93vmlinux.gz: vmlinux
94
95ifndef CONFIG_KGDB
96 cp vmlinux vmlinux.tmp
97 $(STRIP) vmlinux.tmp
98 gzip -9c vmlinux.tmp >vmlinux.gz
99 rm vmlinux.tmp
100else
101 gzip -9c vmlinux >vmlinux.gz
102endif
103
104bzImage: vmlinux.bz2
105
106vmlinux.bz2: vmlinux
107
108ifndef CONFIG_KGDB
109 cp vmlinux vmlinux.tmp
110 $(STRIP) vmlinux.tmp
111 bzip2 -1c vmlinux.tmp >vmlinux.bz2
112 rm vmlinux.tmp
113else
114 bzip2 -1c vmlinux >vmlinux.bz2
115endif
116
1da177e4
LT
117archclean:
118 rm -f vmlinux.gz vmlinux.bz2
This page took 0.230016 seconds and 5 git commands to generate.