Subversion Repositories HelenOS

Rev

Rev 3022 | Rev 4201 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3022 Rev 4055
Line 28... Line 28...
28
 
28
 
29
 
29
 
30
## Include configuration
30
## Include configuration
31
#
31
#
32
 
32
 
33
-include ../version
33
include ../version
34
-include Makefile.config
34
-include ../Makefile.config
-
 
35
-include ../config.defs
35
 
36
 
36
INCLUDES = generic/include
37
INCLUDES = generic/include
37
OPTIMIZATION = 3
38
OPTIMIZATION = 3
38
 
39
 
-
 
40
ifndef CROSS_PREFIX
-
 
41
	CROSS_PREFIX = /usr/local
-
 
42
endif
-
 
43
 
39
## Common compiler flags
44
## Common compiler flags
40
#
45
#
41
 
46
 
42
DEFS = -D$(ARCH) -DARCH=\"$(ARCH)\" -DRELEASE=\"$(RELEASE)\" "-DNAME=\"$(NAME)\"" \
47
DEFS = -DKERNEL -DRELEASE=$(RELEASE) "-DNAME=$(NAME)"
43
	-DKERNEL
-
 
44
 
48
 
45
GCC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) \
49
GCC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \
46
	-fno-builtin -fomit-frame-pointer -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes -Werror \
50
	-fno-builtin -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes -Werror \
47
	-nostdlib -nostdinc
51
	-nostdlib -nostdinc -pipe
48
 
52
 
49
ICC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) \
53
ICC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \
50
	-fno-builtin -fomit-frame-pointer -Wall -Wmissing-prototypes -Werror \
54
	-fno-builtin -Wall -Wmissing-prototypes -Werror \
51
	-nostdlib -nostdinc \
55
	-nostdlib -nostdinc \
52
	-wd170
56
	-wd170
53
 
57
 
54
SUNCC_CFLAGS = -I$(INCLUDES) -xO$(OPTIMIZATION) \
58
SUNCC_CFLAGS = -I$(INCLUDES) -xO$(OPTIMIZATION) \
55
	-xnolib -xc99=all -features=extensions \
59
	-xnolib -xc99=all -features=extensions \
56
	-erroff=E_ZERO_SIZED_STRUCT_UNION
60
	-erroff=E_ZERO_SIZED_STRUCT_UNION
57
 
61
 
58
LFLAGS = -M
62
LFLAGS = -M
59
AFLAGS =
63
AFLAGS =
60
 
64
 
61
ifdef REVISION
-
 
62
	DEFS += "-DREVISION=\"$(REVISION)\""
-
 
63
endif
-
 
64
 
-
 
65
ifdef TIMESTAMP
-
 
66
	DEFS += "-DTIMESTAMP=\"$(TIMESTAMP)\""
-
 
67
endif
-
 
68
 
-
 
69
-include arch/$(ARCH)/Makefile.inc
65
-include arch/$(KARCH)/Makefile.inc
70
-include genarch/Makefile.inc
66
-include genarch/Makefile.inc
71
 
67
 
72
## The at-sign
68
## The at-sign
73
#
69
#
74
# The $(ATSIGN) variable holds the ASCII character representing the at-sign
70
# The $(ATSIGN) variable holds the ASCII character representing the at-sign
Line 82... Line 78...
82
 
78
 
83
## Cross-platform assembly to start a symtab.data section
79
## Cross-platform assembly to start a symtab.data section
84
#
80
#
85
SYMTAB_SECTION=".section symtab.data, \"a\", $(ATSIGN)progbits;"
81
SYMTAB_SECTION=".section symtab.data, \"a\", $(ATSIGN)progbits;"
86
 
82
 
87
## Setup kernel configuration
-
 
88
#
-
 
89
ifeq ($(CONFIG_DEBUG),y)
-
 
90
	DEFS += -DCONFIG_DEBUG
-
 
91
endif
-
 
92
 
-
 
93
ifeq ($(CONFIG_DEBUG_SPINLOCK),y)
-
 
94
	DEFS += -DCONFIG_DEBUG_SPINLOCK
-
 
95
endif
-
 
96
 
-
 
97
ifeq ($(CONFIG_DEBUG_AS_WATCHPOINT),y)
-
 
98
	DEFS += -DCONFIG_DEBUG_AS_WATCHPOINT
-
 
99
endif
-
 
100
 
-
 
101
ifeq ($(CONFIG_FPU_LAZY),y)
-
 
102
	DEFS += -DCONFIG_FPU_LAZY
-
 
103
endif
-
 
104
 
-
 
105
ifeq ($(CONFIG_DEBUG_ALLREGS),y)
-
 
106
	DEFS += -DCONFIG_DEBUG_ALLREGS
-
 
107
endif
-
 
108
 
-
 
109
ifeq ($(CONFIG_VHPT),y)
-
 
110
	DEFS += -DCONFIG_VHPT
-
 
111
endif
-
 
112
 
-
 
113
ifeq ($(CONFIG_TSB),y)
-
 
114
	DEFS += -DCONFIG_TSB
-
 
115
endif
-
 
116
 
-
 
117
ifeq ($(CONFIG_Z8530),y)
-
 
118
	DEFS += -DCONFIG_Z8530
-
 
119
endif
-
 
120
 
-
 
121
ifeq ($(CONFIG_NS16550),y)
-
 
122
	DEFS += -DCONFIG_NS16550
-
 
123
endif
-
 
124
 
-
 
125
ifeq ($(CONFIG_VIRT_IDX_DCACHE),y)
-
 
126
	DEFS += -DCONFIG_VIRT_IDX_DCACHE
-
 
127
endif
-
 
128
 
-
 
129
ifeq ($(CONFIG_FB),y)
-
 
130
	ifeq ($(ARCH),ia32)
-
 
131
		DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH)
-
 
132
		DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT)
-
 
133
		DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP)
-
 
134
	endif
-
 
135
	
-
 
136
	ifeq ($(ARCH),amd64)
-
 
137
		DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH)
-
 
138
		DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT)
-
 
139
		DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP)
-
 
140
	endif
-
 
141
	
-
 
142
	ifeq ($(ARCH),ia32xen)
-
 
143
		DEFS += -DCONFIG_VESA_WIDTH=$(CONFIG_VESA_WIDTH)
-
 
144
		DEFS += -DCONFIG_VESA_HEIGHT=$(CONFIG_VESA_HEIGHT)
-
 
145
		DEFS += -DCONFIG_VESA_BPP=$(CONFIG_VESA_BPP)
-
 
146
	endif
-
 
147
endif
-
 
148
 
-
 
149
## Simple detection for the type of the host system
83
## Simple detection for the type of the host system
150
#
84
#
151
HOST = $(shell uname)
85
HOST = $(shell uname)
152
 
86
 
153
## On Solaris, some utilities have slightly different names
87
## On Solaris, some utilities have slightly different names
Line 168... Line 102...
168
	LD = $(BINUTILS_PREFIX)ld
102
	LD = $(BINUTILS_PREFIX)ld
169
	OBJCOPY = $(BINUTILS_PREFIX)objcopy
103
	OBJCOPY = $(BINUTILS_PREFIX)objcopy
170
	OBJDUMP = $(BINUTILS_PREFIX)objdump
104
	OBJDUMP = $(BINUTILS_PREFIX)objdump
171
	LIBDIR = /usr/lib
105
	LIBDIR = /usr/lib
172
	CFLAGS = $(GCC_CFLAGS)
106
	CFLAGS = $(GCC_CFLAGS)
-
 
107
	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
173
endif
108
endif
174
 
109
 
175
ifeq ($(COMPILER),icc_native)
110
ifeq ($(COMPILER),icc_native)
176
	CC = icc
111
	CC = icc
177
	GCC = gcc
112
	GCC = gcc
Line 179... Line 114...
179
	LD = ld
114
	LD = ld
180
	OBJCOPY = objcopy
115
	OBJCOPY = objcopy
181
	OBJDUMP = objdump
116
	OBJDUMP = objdump
182
	LIBDIR = /usr/lib
117
	LIBDIR = /usr/lib
183
	CFLAGS = $(ICC_CFLAGS)
118
	CFLAGS = $(ICC_CFLAGS)
-
 
119
	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
184
endif
120
endif
185
 
121
 
186
ifeq ($(COMPILER),suncc_native)
122
ifeq ($(COMPILER),suncc_native)
187
	CC = suncc
123
	CC = suncc
188
	GCC = gcc
124
	GCC = gcc
Line 190... Line 126...
190
	LD = $(BINUTILS_PREFIX)ld
126
	LD = $(BINUTILS_PREFIX)ld
191
	OBJCOPY = $(BINUTILS_PREFIX)objcopy
127
	OBJCOPY = $(BINUTILS_PREFIX)objcopy
192
	OBJDUMP = $(BINUTILS_PREFIX)objdump
128
	OBJDUMP = $(BINUTILS_PREFIX)objdump
193
	LIBDIR = /usr/lib
129
	LIBDIR = /usr/lib
194
	CFLAGS = $(SUNCC_CFLAGS)
130
	CFLAGS = $(SUNCC_CFLAGS)
-
 
131
	DEFS += $(CONFIG_DEFS)
-
 
132
	DEPEND_DEFS = $(DEFS)
195
endif
133
endif
196
 
134
 
197
ifeq ($(COMPILER),gcc_cross)
135
ifeq ($(COMPILER),gcc_cross)
198
	CC = $(TOOLCHAIN_DIR)/bin/$(TARGET)-gcc
136
	CC = $(TOOLCHAIN_DIR)/bin/$(TARGET)-gcc
199
	GCC = $(CC)
137
	GCC = $(CC)
Line 201... Line 139...
201
	LD = $(TOOLCHAIN_DIR)/bin/$(TARGET)-ld
139
	LD = $(TOOLCHAIN_DIR)/bin/$(TARGET)-ld
202
	OBJCOPY = $(TOOLCHAIN_DIR)/bin/$(TARGET)-objcopy
140
	OBJCOPY = $(TOOLCHAIN_DIR)/bin/$(TARGET)-objcopy
203
	OBJDUMP = $(TOOLCHAIN_DIR)/bin/$(TARGET)-objdump
141
	OBJDUMP = $(TOOLCHAIN_DIR)/bin/$(TARGET)-objdump
204
	LIBDIR = $(TOOLCHAIN_DIR)/lib
142
	LIBDIR = $(TOOLCHAIN_DIR)/lib
205
	CFLAGS = $(GCC_CFLAGS)
143
	CFLAGS = $(GCC_CFLAGS)
-
 
144
	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
206
endif
145
endif
207
 
146
 
208
## Generic kernel sources
147
## Generic kernel sources
209
#
148
#
210
 
149
 
Line 214... Line 153...
214
	generic/src/adt/btree.c \
153
	generic/src/adt/btree.c \
215
	generic/src/adt/hash_table.c \
154
	generic/src/adt/hash_table.c \
216
	generic/src/adt/list.c \
155
	generic/src/adt/list.c \
217
	generic/src/console/chardev.c \
156
	generic/src/console/chardev.c \
218
	generic/src/console/console.c \
157
	generic/src/console/console.c \
219
	generic/src/console/kconsole.c \
-
 
220
	generic/src/console/klog.c \
-
 
221
	generic/src/console/cmd.c \
-
 
222
	generic/src/cpu/cpu.c \
158
	generic/src/cpu/cpu.c \
223
	generic/src/ddi/ddi.c \
159
	generic/src/ddi/ddi.c \
224
	generic/src/ddi/irq.c \
160
	generic/src/ddi/irq.c \
225
	generic/src/ddi/device.c \
161
	generic/src/ddi/device.c \
226
	generic/src/interrupt/interrupt.c \
162
	generic/src/interrupt/interrupt.c \
227
	generic/src/main/main.c \
163
	generic/src/main/main.c \
228
	generic/src/main/kinit.c \
164
	generic/src/main/kinit.c \
229
	generic/src/main/uinit.c \
165
	generic/src/main/uinit.c \
230
	generic/src/main/version.c \
166
	generic/src/main/version.c \
231
	generic/src/main/shutdown.c \
167
	generic/src/main/shutdown.c \
-
 
168
	generic/src/proc/program.c \
232
	generic/src/proc/scheduler.c \
169
	generic/src/proc/scheduler.c \
233
	generic/src/proc/thread.c \
170
	generic/src/proc/thread.c \
234
	generic/src/proc/task.c \
171
	generic/src/proc/task.c \
235
	generic/src/proc/the.c \
172
	generic/src/proc/the.c \
236
	generic/src/proc/tasklet.c \
173
	generic/src/proc/tasklet.c \
Line 246... Line 183...
246
	generic/src/mm/backend_phys.c \
183
	generic/src/mm/backend_phys.c \
247
	generic/src/mm/slab.c \
184
	generic/src/mm/slab.c \
248
	generic/src/lib/func.c \
185
	generic/src/lib/func.c \
249
	generic/src/lib/memstr.c \
186
	generic/src/lib/memstr.c \
250
	generic/src/lib/sort.c \
187
	generic/src/lib/sort.c \
-
 
188
	generic/src/lib/string.c \
251
	generic/src/lib/elf.c \
189
	generic/src/lib/elf.c \
252
	generic/src/lib/rd.c \
190
	generic/src/lib/rd.c \
253
	generic/src/printf/printf_core.c \
191
	generic/src/printf/printf_core.c \
254
	generic/src/printf/printf.c \
192
	generic/src/printf/printf.c \
255
	generic/src/printf/sprintf.c \
193
	generic/src/printf/sprintf.c \
Line 265... Line 203...
265
	generic/src/synch/spinlock.c \
203
	generic/src/synch/spinlock.c \
266
	generic/src/synch/condvar.c \
204
	generic/src/synch/condvar.c \
267
	generic/src/synch/rwlock.c \
205
	generic/src/synch/rwlock.c \
268
	generic/src/synch/mutex.c \
206
	generic/src/synch/mutex.c \
269
	generic/src/synch/semaphore.c \
207
	generic/src/synch/semaphore.c \
-
 
208
	generic/src/synch/smc.c \
270
	generic/src/synch/waitq.c \
209
	generic/src/synch/waitq.c \
271
	generic/src/synch/futex.c \
210
	generic/src/synch/futex.c \
272
	generic/src/smp/ipi.c \
211
	generic/src/smp/ipi.c \
273
	generic/src/smp/smp.c \
212
	generic/src/smp/smp.c \
274
	generic/src/ipc/ipc.c \
213
	generic/src/ipc/ipc.c \
Line 276... Line 215...
276
	generic/src/ipc/ipcrsc.c \
215
	generic/src/ipc/ipcrsc.c \
277
	generic/src/ipc/irq.c \
216
	generic/src/ipc/irq.c \
278
	generic/src/security/cap.c \
217
	generic/src/security/cap.c \
279
	generic/src/sysinfo/sysinfo.c
218
	generic/src/sysinfo/sysinfo.c
280
 
219
 
-
 
220
## Kernel console support
-
 
221
#
-
 
222
 
-
 
223
ifeq ($(CONFIG_KCONSOLE),y)
-
 
224
GENERIC_SOURCES += \
-
 
225
	generic/src/console/kconsole.c \
-
 
226
	generic/src/console/cmd.c
-
 
227
endif
-
 
228
 
-
 
229
## Udebug interface sources
-
 
230
#
-
 
231
 
-
 
232
ifeq ($(CONFIG_UDEBUG),y)
-
 
233
GENERIC_SOURCES += \
-
 
234
	generic/src/ipc/kbox.c \
-
 
235
	generic/src/udebug/udebug.c \
-
 
236
	generic/src/udebug/udebug_ops.c \
-
 
237
	generic/src/udebug/udebug_ipc.c
-
 
238
endif
-
 
239
 
281
## Test sources
240
## Test sources
282
#
241
#
283
 
242
 
284
ifeq ($(CONFIG_TEST),y)
243
ifeq ($(CONFIG_TEST),y)
285
	DEFS += -DCONFIG_TEST
-
 
286
	CFLAGS += -Itest/
244
	CFLAGS += -Itest/
287
	GENERIC_SOURCES += \
245
	GENERIC_SOURCES += \
288
		test/test.c \
246
		test/test.c \
289
		test/atomic/atomic1.c \
247
		test/atomic/atomic1.c \
290
		test/btree/btree1.c \
248
		test/btree/btree1.c \
291
		test/avltree/avltree1.c \
249
		test/avltree/avltree1.c \
292
		test/debug/mips1.c \
-
 
293
		test/fault/fault1.c \
250
		test/fault/fault1.c \
294
		test/fpu/fpu1.c \
-
 
295
		test/fpu/sse1.c \
-
 
296
		test/fpu/mips2.c \
-
 
297
		test/mm/falloc1.c \
251
		test/mm/falloc1.c \
298
		test/mm/falloc2.c \
252
		test/mm/falloc2.c \
299
		test/mm/mapping1.c \
253
		test/mm/mapping1.c \
300
		test/mm/slab1.c \
254
		test/mm/slab1.c \
301
		test/mm/slab2.c \
255
		test/mm/slab2.c \
302
		test/mm/purge1.c \
-
 
303
		test/synch/rwlock1.c \
256
		test/synch/rwlock1.c \
304
		test/synch/rwlock2.c \
257
		test/synch/rwlock2.c \
305
		test/synch/rwlock3.c \
258
		test/synch/rwlock3.c \
306
		test/synch/rwlock4.c \
259
		test/synch/rwlock4.c \
307
		test/synch/rwlock5.c \
260
		test/synch/rwlock5.c \
308
		test/synch/semaphore1.c \
261
		test/synch/semaphore1.c \
309
		test/synch/semaphore2.c \
262
		test/synch/semaphore2.c \
310
		test/print/print1.c \
263
		test/print/print1.c \
311
		test/thread/thread1.c \
264
		test/thread/thread1.c \
312
		test/sysinfo/sysinfo1.c
265
		test/sysinfo/sysinfo1.c
-
 
266
	
-
 
267
	ifeq ($(KARCH),mips32)
-
 
268
		GENERIC_SOURCES += test/debug/mips1.c
-
 
269
	else
-
 
270
		GENERIC_SOURCES += test/debug/mips1_skip.c
313
endif
271
	endif
-
 
272
	
-
 
273
	ifeq ($(KARCH),ia64)
-
 
274
		GENERIC_SOURCES += test/mm/purge1.c
-
 
275
	else
-
 
276
		GENERIC_SOURCES += test/mm/purge1_skip.c
-
 
277
	endif
314
 
278
	
-
 
279
	ifeq ($(CONFIG_FPU),y)
-
 
280
		ifeq ($(KARCH),ia32)
-
 
281
			TEST_FPU1 = y
-
 
282
			TEST_SSE1 = y
-
 
283
			GENERIC_SOURCES += test/fpu/fpu1_x86.c
-
 
284
		endif
-
 
285
		
315
## Experimental features
286
		ifeq ($(KARCH),amd64)
-
 
287
			TEST_FPU1 = y
-
 
288
			TEST_SSE1 = y
-
 
289
			GENERIC_SOURCES += test/fpu/fpu1_x86.c
-
 
290
		endif
-
 
291
		
-
 
292
		ifeq ($(KARCH),ia64)
-
 
293
			TEST_FPU1 = y
-
 
294
			GENERIC_SOURCES += test/fpu/fpu1_ia64.c
-
 
295
		endif
-
 
296
		
-
 
297
		ifeq ($(KARCH),mips32)
-
 
298
			TEST_MIPS2 = y
-
 
299
		endif
-
 
300
	endif
316
#
301
	
-
 
302
	ifneq ($(TEST_FPU1),y)
-
 
303
		GENERIC_SOURCES += test/fpu/fpu1_skip.c
-
 
304
	endif
317
 
305
	
318
ifeq ($(CONFIG_EXPERIMENTAL),y)
306
	ifeq ($(TEST_SSE1),y)
-
 
307
		GENERIC_SOURCES += test/fpu/sse1.c
-
 
308
	else
319
	GENERIC_SOURCES += generic/src/lib/objc_ext.c \
309
		GENERIC_SOURCES += test/fpu/sse1_skip.c
-
 
310
	endif
-
 
311
	
320
		generic/src/lib/objc.c
312
	ifeq ($(TEST_MIPS2),y)
321
	EXTRA_OBJECTS = $(LIBDIR)/libobjc.a
313
		GENERIC_SOURCES += test/fpu/mips2.c
-
 
314
	else
322
	EXTRA_FLAGS += -x objective-c
315
		GENERIC_SOURCES += test/fpu/mips2_skip.c
-
 
316
	endif
-
 
317
	
323
endif
318
endif
324
 
319
 
325
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
320
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
326
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
321
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
327
GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES)))
322
GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES)))
328
 
323
 
329
.PHONY: all build config distclean clean archlinks depend disasm
324
.PHONY: all build clean archlinks depend disasm
330
 
325
 
331
all:
-
 
332
	../tools/config.py kernel.config default $(ARCH) $(COMPILER) $(CONFIG_DEBUG) $(MACHINE)
326
all: ../Makefile.config ../config.h ../config.defs
-
 
327
	-rm Makefile.depend
333
	$(MAKE) -C . build
328
	$(MAKE) -C . build
334
 
329
 
335
build: kernel.bin disasm
330
build: kernel.bin disasm
336
 
331
 
337
config:
-
 
338
	-rm Makefile.depend
-
 
339
	../tools/config.py kernel.config
-
 
340
 
-
 
341
-include Makefile.depend
332
-include Makefile.depend
342
 
333
 
343
distclean: clean
-
 
344
	-rm Makefile.config
-
 
345
 
-
 
346
clean:
334
clean:
347
	-rm -f kernel.bin kernel.raw kernel.map kernel.map.pre kernel.objdump kernel.disasm generic/src/debug/real_map.bin Makefile.depend* generic/include/arch generic/include/genarch arch/$(ARCH)/_link.ld
335
	-rm -f kernel.bin kernel.raw kernel.map kernel.map.pre kernel.objdump kernel.disasm generic/src/debug/real_map.bin Makefile.depend* generic/include/arch generic/include/genarch arch/$(KARCH)/_link.ld
348
	find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \;
336
	find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \;
349
	for arch in arch/* ; do \
337
	for arch in arch/* ; do \
350
	    [ -e $$arch/_link.ld ] && rm $$arch/_link.ld 2>/dev/null ; \
338
	    [ -e $$arch/_link.ld ] && rm $$arch/_link.ld 2>/dev/null ; \
351
	done ; exit 0
339
	done ; exit 0
352
 
340
 
353
archlinks:
341
archlinks:
354
	ln -sfn ../../arch/$(ARCH)/include/ generic/include/arch
342
	ln -sfn ../../arch/$(KARCH)/include/ generic/include/arch
355
	ln -sfn ../../genarch/include/ generic/include/genarch
343
	ln -sfn ../../genarch/include/ generic/include/genarch
356
 
344
 
357
depend: archlinks
345
depend: archlinks
358
	-makedepend $(DEFS) $(CFLAGS) -f - $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null
346
	-makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null
359
 
347
 
360
arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in
348
arch/$(KARCH)/_link.ld: arch/$(KARCH)/_link.ld.in
361
	$(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $< | grep -v "^\#" > $@
349
	$(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $< | grep -v "^\#" > $@
362
 
350
 
363
generic/src/debug/real_map.bin: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS)
351
generic/src/debug/real_map.bin: depend arch/$(KARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS)
364
	echo $(SYMTAB_SECTION) | $(AS) $(AFLAGS) -o generic/src/debug/empty_map.o
352
	echo $(SYMTAB_SECTION) | $(AS) $(AFLAGS) -o generic/src/debug/empty_map.o
365
	$(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/empty_map.o  -o $@ -Map kernel.map.pre
353
	$(LD) -T arch/$(KARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/empty_map.o  -o $@ -Map kernel.map.pre
366
	$(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump
354
	$(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump
367
	tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin 
355
	tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin 
368
	# Do it once again, this time to get correct even the symbols
356
	# Do it once again, this time to get correct even the symbols
369
	# on architectures, that have bss after symtab
357
	# on architectures, that have bss after symtab
370
	echo $(SYMTAB_SECTION)" .incbin \"$@\"" | $(AS) $(AFLAGS) -o generic/src/debug/sizeok_map.o
358
	echo $(SYMTAB_SECTION)" .incbin \"$@\"" | $(AS) $(AFLAGS) -o generic/src/debug/sizeok_map.o
371
	$(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/sizeok_map.o -o $@ -Map kernel.map.pre
359
	$(LD) -T arch/$(KARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/sizeok_map.o -o $@ -Map kernel.map.pre
372
	$(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump
360
	$(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump
373
	tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin 
361
	tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin 
374
 
362
 
375
generic/src/debug/real_map.o: generic/src/debug/real_map.bin
363
generic/src/debug/real_map.o: generic/src/debug/real_map.bin
376
	echo $(SYMTAB_SECTION)" .incbin \"$<\"" | $(AS) $(AFLAGS) -o $@ 
364
	echo $(SYMTAB_SECTION)" .incbin \"$<\"" | $(AS) $(AFLAGS) -o $@ 
377
 
365
 
378
kernel.raw: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o
366
kernel.raw: depend arch/$(KARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o
379
	$(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/real_map.o -o $@ -Map kernel.map
367
	$(LD) -T arch/$(KARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) generic/src/debug/real_map.o -o $@ -Map kernel.map
380
 
368
 
381
kernel.bin: kernel.raw
369
kernel.bin: kernel.raw
382
	$(OBJCOPY) -O $(BFD) kernel.raw kernel.bin
370
	$(OBJCOPY) -O $(BFD) kernel.raw kernel.bin
383
 
371
 
384
disasm: kernel.raw
372
disasm: kernel.raw
Line 388... Line 376...
388
	$(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -c $< -o $@
376
	$(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -c $< -o $@
389
 
377
 
390
%.o: %.s
378
%.o: %.s
391
	$(AS) $(AFLAGS) $< -o $@
379
	$(AS) $(AFLAGS) $< -o $@
392
 
380
 
-
 
381
#
-
 
382
# The FPU tests are the only objects for which we allow the compiler to generate
-
 
383
# FPU instructions.
-
 
384
#
393
%.o: %.c
385
test/fpu/%.o: test/fpu/%.c
394
	$(CC) $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) -c $< -o $@
386
	$(CC) $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) -c $< -o $@
-
 
387
 
-
 
388
#
-
 
389
# Ordinary objects.
-
 
390
#
-
 
391
%.o: %.c
-
 
392
	$(CC) $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS) -c $< -o $@