summaryrefslogtreecommitdiffstats
path: root/arch/arm/Makefile
blob: 967ee67661c271bb930ddfc541fa7c6ef693d52b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
#
# arch/arm/Makefile
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies. Remember to do have actions
# for "archclean" and "archdep" for cleaning up and making dependencies for
# this architecture
#
# This file is subject to the terms and conditions of the GNU General Public
# License.  See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1995, 1996 by Russell King

CFLAGS_PROC		:=
ASFLAGS_PROC		:=

# All processors get `-mshort-load-bytes' for now, to work around alignment
# problems.  This is more of a hack that just happens to work than a real fix
# but it will do for now.

ifeq ($(CONFIG_CPU_26),y)
  PROCESSOR		 = armo
  TEXTADDR		 = 0x02080000
  ZTEXTADDR		 = 0x01800000
  ZRELADDR		 = 0x02080000
  ifeq ($(CONFIG_BINUTILS_NEW),y)
    CFLAGS_PROC		+= -mapcs-26 -mshort-load-bytes
    ifeq ($(CONFIG_CPU_ARM2),y)
      CFLAGS_PROC	+= -mcpu=arm2
      ASFLAGS_PROC	+= -m2
    endif
    ifeq ($(CONFIG_CPU_ARM3),y)
      CFLAGS_PROC	+= -mcpu=arm3
      ASFLAGS_PROC	+= -m3
    endif
  else
    ifeq ($(CONFIG_CPU_ARM2),y)
      CFLAGS_PROC	+= -m2
      ASFLAGS_PROC	+= -m2
    endif
    ifeq ($(CONFIG_CPU_ARM3),y)
      CFLAGS_PROC	+= -m3
      ASFLAGS_PROC	+= -m3
    endif
  endif
endif

ifeq ($(CONFIG_CPU_32),y)
  PROCESSOR		 = armv
  TEXTADDR		 = 0xC0008000
  ifeq ($(CONFIG_BINUTILS_NEW),y)
    CFLAGS_PROC		+= -mapcs-32 -mshort-load-bytes
    ifeq ($(CONFIG_CPU_ARM6),y)
      CFLAGS_PROC	+= -mcpu=arm6
    endif
    ifeq ($(CONFIG_CPU_ARM7),y)
      CFLAGS_PROC	+= -mcpu=arm7
    endif
    ifeq ($(CONFIG_CPU_SA110),y)
      CFLAGS_PROC	+= -mcpu=strongarm110
    endif
  else
    CFLAGS_PROC		+= -m6
  endif
  ASFLAGS_PROC		+= -m6
endif

# Processor Architecture
# CFLAGS_PROC - processor dependent CFLAGS
# PROCESSOR - processor type
# TEXTADDR - Uncompressed kernel link text address
# ZTEXTADDR - Compressed kernel link text address
# ZRELADDR - Compressed kernel relocating address (point at which uncompressed kernel is loaded).
#

COMPRESSED_HEAD	 = head.o

ifeq ($(CONFIG_ARCH_A5K),y)
MACHINE		 = a5k
ARCHDIR		 = arc
COMPRESSED_EXTRA = $(TOPDIR)/arch/arm/lib/ll_char_wr.o
endif

ifeq ($(CONFIG_ARCH_ARC),y)
MACHINE		 = arc
ARCHDIR		 = arc
COMPRESSED_EXTRA = $(TOPDIR)/arch/arm/lib/ll_char_wr.o
endif

ifeq ($(CONFIG_ARCH_RPC),y)
MACHINE		 = rpc
ARCHDIR		 = rpc
COMPRESSED_EXTRA = $(TOPDIR)/arch/arm/lib/ll_char_wr.o
ZTEXTADDR	 = 0x10008000
ZRELADDR	 = 0x10008000
endif

ifeq ($(CONFIG_ARCH_EBSA110),y)
MACHINE		 = ebsa110
ARCHDIR		 = ebsa110
ZTEXTADDR	 = 0x00008000
ZRELADDR	 = 0x00008000
endif

ifeq ($(CONFIG_ARCH_EBSA285),y)
MACHINE		 = ebsa285
ARCHDIR		 = ebsa285
ZTEXTADDR	 = 0x00008000
ZRELADDR	 = 0x00008000
endif

ifeq ($(CONFIG_ARCH_NEXUSPCI),y)
MACHINE		 = nexuspci
ARCHDIR		 = nexuspci
ZTEXTADDR	 = 0x40200000
ZRELADDR	 = 0x40008000
COMPRESSED_EXTRA = $(TOPDIR)/arch/arm/lib/ll_char_wr_scc.o
COMPRESSED_HEAD	 = head-nexuspci.o
endif

ifeq ($(CONFIG_ARCH_VNC),y)
TEXTADDR	 = 0xC000C000
MACHINE		 = vnc
ARCHDIR		 = vnc
endif

ifeq ($(CONFIG_ARCH_TBOX),y)
MACHINE		 = tbox
ARCHDIR		 = tbox
ZTEXTADDR	 = 0x80008000
ZRELDIR		 = 0x80008000
endif

PERL		 = perl
ifeq ($(CONFIG_BINUTILS_NEW),y)
LD		 = $(CROSS_COMPILE)ld -m elf32arm
else
LD		 = $(CROSS_COMPILE)ld -m elf_arm
endif
OBJCOPY		 = $(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S
OBJDUMP		 = $(CROSS_COMPILE)objdump
CPP		 = $(CC) -E
ARCHCC		:= $(word 1,$(CC))
GCCLIB		:= `$(CC) $(CFLAGS_PROC) --print-libgcc-file-name`
#GCCARCH		:= -B/usr/bin/arm-linuxelf- 
HOSTCFLAGS	:= $(CFLAGS:-fomit-frame-pointer=)
ifeq ($(CONFIG_FRAME_POINTER),y)
CFLAGS		:= $(CFLAGS:-fomit-frame-pointer=)
endif
CFLAGS		:= $(CFLAGS_PROC) $(CFLAGS) -pipe
ASFLAGS		:= $(ASFLAGS_PROC) $(ASFLAGS)
LINKFLAGS	 = -T $(TOPDIR)/arch/arm/vmlinux-$(PROCESSOR).lds -e stext -Ttext $(TEXTADDR)
ZLINKFLAGS	 = -Ttext $(ZTEXTADDR)

SUBDIRS		:= $(SUBDIRS:drivers=arch/arm/drivers) arch/arm/lib arch/arm/kernel arch/arm/mm
HEAD		:= arch/arm/kernel/head-$(PROCESSOR).o arch/arm/kernel/init_task.o
CORE_FILES	:= arch/arm/kernel/kernel.o arch/arm/mm/mm.o $(CORE_FILES)
LIBS		:= arch/arm/lib/lib.a $(LIBS) $(GCCLIB)

BLOCK_DRIVERS	:= drivers/block/block.a
CDROM_DRIVERS	:= drivers/cdrom/cdrom.a
ifeq ($(CONFIG_FB),y)
CHAR_DRIVERS	:= arch/arm/drivers/char1/char1.a drivers/char/char.a arch/arm/drivers/char1/char1.a
else
ifeq ($(CONFIG_VGA_CONSOLE),y)
CHAR_DRIVERS	:= arch/arm/drivers/char1/char1.a drivers/char/char.a arch/arm/drivers/char1/char1.a
else
CHAR_DRIVERS	:= arch/arm/drivers/char/char.a
endif
endif
MISC_DRIVERS	:= drivers/misc/misc.a
NET_DRIVERS	:= drivers/net/net.a
PARIDE_DRIVERS	:= drivers/block/paride/paride.a
PCI_DRIVERS	:= drivers/pci/pci.a
SCSI_DRIVERS	:= drivers/scsi/scsi.a
SOUND_DRIVERS	:= drivers/sound/sound.a
VIDEO_DRIVERS	:= drivers/video/video.a
PNP_DRIVERS	:= drivers/pnp/pnp.a

ifeq ($(CONFIG_ARCH_ACORN),y)
BLOCK_DRIVERS	+= drivers/acorn/block/acorn-block.a
CHAR_DRIVERS	+= drivers/acorn/char/acorn-char.a
NET_DRIVERS	+= drivers/acorn/net/acorn-net.a drivers/net/net.a
SCSI_DRIVERS	+= drivers/acorn/scsi/acorn-scsi.a
endif

DRIVERS		:= $(BLOCK_DRIVERS) $(CHAR_DRIVERS) $(MISC_DRIVERS) $(NET_DRIVERS)

ifeq ($(CONFIG_FB),y)
DRIVERS		:= $(DRIVERS) $(VIDEO_DRIVERS)
else
ifeq ($(CONFIG_VGA_CONSOLE),y)
DRIVERS		:= $(DRIVERS) $(VIDEO_DRIVERS)
endif
endif
ifeq ($(CONFIG_SCSI),y)
DRIVERS		:= $(DRIVERS) $(SCSI_DRIVERS)
endif
ifneq ($(CONFIG_CD_NO_IDESCSI)$(CONFIG_BLK_DEV_IDECD)$(CONFIG_BLK_DEV_SR),)
DRIVERS		:= $(DRIVERS) $(CDROM_DRIVERS)
endif
ifdef CONFIG_PCI
DRIVERS		:= $(DRIVERS) $(PCI_DRIVERS)
endif
ifeq ($(CONFIG_SOUND),y)
DRIVERS		:= $(DRIVERS) $(SOUND_DRIVERS)
endif
ifeq ($(CONFIG_PARIDE),y)
DRIVERS		:= $(DRIVERS) $(PARIDE_DRIVERS)
endif
ifdef CONFIG_PNP
DRIVERS		:= $(DRIVERS) $(PNP_DRIVERS)
endif

symlinks::
	$(RM) include/asm-arm/arch include/asm-arm/proc
	(cd include/asm-arm; ln -sf arch-$(ARCHDIR) arch; ln -sf proc-$(PROCESSOR) proc)

# Once we've finished integrating the sources, the @$(MAKE) will disappear
archmrproper:
	rm -f include/asm-arm/arch include/asm-arm/proc
	@$(MAKE) -C arch/$(ARCH)/drivers mrproper

arch/arm/kernel: dummy
	$(MAKE) linuxsubdirs SUBDIRS=arch/arm/kernel

arch/arm/mm: dummy
	$(MAKE) linuxsubdirs SUBDIRS=arch/arm/mm

arch/arm/lib: dummy
	$(MAKE) linuxsubdirs SUBDIRS=arch/arm/lib

MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot

zImage: vmlinux
	@$(MAKEBOOT) zImage

zinstall: vmlinux
	@$(MAKEBOOT) zinstall

Image: vmlinux
	@$(MAKEBOOT) Image

install: vmlinux
	@$(MAKEBOOT) install

# My testing targets (that short circuit a few dependencies)
zImg:;	@$(MAKEBOOT) zImage
Img:;	@$(MAKEBOOT) Image
i:;	@$(MAKEBOOT) install
zi:;	@$(MAKEBOOT) zinstall

archclean:
	@$(MAKEBOOT) clean
	$(RM) arch/arm/lib/constants.h

archdep:
	@$(MAKEBOOT) dep
sed -e /^MACHINE..*=/s,= .*,= rpc,;/^PROCESSOR..*=/s,= .*,= armv, linux/arch/arm/Makefile.normal