Subversion Repositories HelenOS

Rev

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

Rev 2500 Rev 2602
Line 64... Line 64...
64
 
64
 
65
ifdef TIMESTAMP
65
ifdef TIMESTAMP
66
	DEFS += "-DTIMESTAMP=\"$(TIMESTAMP)\""
66
	DEFS += "-DTIMESTAMP=\"$(TIMESTAMP)\""
67
endif
67
endif
68
 
68
 
69
## Setup kernel configuration
-
 
70
#
-
 
71
 
-
 
72
-include arch/$(ARCH)/Makefile.inc
69
-include arch/$(ARCH)/Makefile.inc
73
-include genarch/Makefile.inc
70
-include genarch/Makefile.inc
74
 
71
 
-
 
72
## The at-sign
-
 
73
#
-
 
74
# THE $(ATSIGN) variable holds the ASCII character representing the at-sign
-
 
75
# ('@') used in various $(AS) constructs (e.g. @progbits). On architectures that
-
 
76
# don't use '@' for starting a comment, $(ATSIGN) is merely '@'. However, on
-
 
77
# those that do use it for starting a comment (e.g. arm32), $(ATSIGN) must be
-
 
78
# defined as the percentile-sign ('%') in the architecture-dependent
-
 
79
# Makefile.inc.
-
 
80
#
-
 
81
ATSIGN ?= @
-
 
82
 
-
 
83
## Cross-platform assembly to start a symtab.data section
-
 
84
#
-
 
85
SYMTAB_SECTION=".section symtab.data, \"a\", $(ATSIGN)progbits;"
-
 
86
 
-
 
87
## Setup kernel configuration
-
 
88
#
75
ifeq ($(CONFIG_DEBUG),y)
89
ifeq ($(CONFIG_DEBUG),y)
76
	DEFS += -DCONFIG_DEBUG
90
	DEFS += -DCONFIG_DEBUG
77
endif
91
endif
78
 
92
 
79
ifeq ($(CONFIG_DEBUG_SPINLOCK),y)
93
ifeq ($(CONFIG_DEBUG_SPINLOCK),y)
Line 344... Line 358...
344
 
358
 
345
arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in
359
arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in
346
	$(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $< | grep -v "^\#" > $@
360
	$(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $< | grep -v "^\#" > $@
347
 
361
 
348
generic/src/debug/real_map.bin: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS)
362
generic/src/debug/real_map.bin: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS)
349
	$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab Makefile generic/src/debug/empty_map.o
363
	echo $(SYMTAB_SECTION) | $(AS) $(AFLAGS) -o generic/src/debug/empty_map.o
350
	$(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
364
	$(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
351
	$(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump
365
	$(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump
352
	tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin 
366
	tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin 
353
	# Do it once again, this time to get correct even the symbols
367
	# Do it once again, this time to get correct even the symbols
354
	# on architectures, that have bss after symtab
368
	# on architectures, that have bss after symtab
355
	$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab generic/src/debug/real_map.bin generic/src/debug/sizeok_map.o
369
	echo $(SYMTAB_SECTION)" .incbin \"$@\"" | $(AS) $(AFLAGS) -o generic/src/debug/sizeok_map.o
356
	$(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
370
	$(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
357
	$(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump
371
	$(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump
358
	tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin 
372
	tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin 
359
 
373
 
360
generic/src/debug/real_map.o: generic/src/debug/real_map.bin
374
generic/src/debug/real_map.o: generic/src/debug/real_map.bin
361
	$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab $< $@
375
	echo $(SYMTAB_SECTION)" .incbin \"$<\"" | $(AS) $(AFLAGS) -o $@ 
362
 
376
 
363
kernel.raw: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o
377
kernel.raw: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o
364
	$(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
378
	$(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
365
 
379
 
366
kernel.bin: kernel.raw
380
kernel.bin: kernel.raw