Subversion Repositories HelenOS

Rev

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

Rev 2089 Rev 2125
Line 126... Line 126...
126
	CC = gcc
126
	CC = gcc
127
	AS = as
127
	AS = as
128
	LD = ld
128
	LD = ld
129
	OBJCOPY = objcopy
129
	OBJCOPY = objcopy
130
	OBJDUMP = objdump
130
	OBJDUMP = objdump
-
 
131
	LIBDIR = /usr/lib
131
else
132
else
132
	CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
133
	CC = $(TOOLCHAIN_DIR)/bin/$(TARGET)-gcc
133
	AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
134
	AS = $(TOOLCHAIN_DIR)/bin/$(TARGET)-as
134
	LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
135
	LD = $(TOOLCHAIN_DIR)/bin/$(TARGET)-ld
135
	OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
136
	OBJCOPY = $(TOOLCHAIN_DIR)/bin/$(TARGET)-objcopy
136
	OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
137
	OBJDUMP = $(TOOLCHAIN_DIR)/bin/$(TARGET)-objdump
-
 
138
	LIBDIR = $(TOOLCHAIN_DIR)/lib
137
endif
139
endif
138
 
140
 
139
## Generic kernel sources
141
## Generic kernel sources
140
#
142
#
141
 
143
 
Line 237... Line 239...
237
		test/print/print1.c \
239
		test/print/print1.c \
238
		test/thread/thread1.c \
240
		test/thread/thread1.c \
239
		test/sysinfo/sysinfo1.c
241
		test/sysinfo/sysinfo1.c
240
endif
242
endif
241
 
243
 
-
 
244
## Experimental features
-
 
245
#
-
 
246
 
-
 
247
ifeq ($(CONFIG_EXPERIMENTAL),y)
-
 
248
	GENERIC_SOURCES += generic/src/lib/objc.c
-
 
249
	EXTRA_OBJECTS = $(LIBDIR)/libobjc.a
-
 
250
	EXTRA_FLAGS += -x objective-c
-
 
251
endif
-
 
252
 
242
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
253
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
243
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
254
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
244
GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES)))
255
GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES)))
245
 
256
 
246
.PHONY: all build config distclean clean archlinks depend disasm
257
.PHONY: all build config distclean clean archlinks depend disasm
Line 277... Line 288...
277
arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in
288
arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in
278
	$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $< | grep -v "^\#" > $@
289
	$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $< | grep -v "^\#" > $@
279
 
290
 
280
generic/src/debug/real_map.bin: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS)
291
generic/src/debug/real_map.bin: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS)
281
	$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab Makefile generic/src/debug/empty_map.o
292
	$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab Makefile generic/src/debug/empty_map.o
282
	$(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/empty_map.o -o $@ -Map kernel.map.pre
293
	$(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
283
	$(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump
294
	$(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump
284
	tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin 
295
	tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin 
285
	# Do it once again, this time to get correct even the symbols
296
	# Do it once again, this time to get correct even the symbols
286
	# on architectures, that have bss after symtab
297
	# on architectures, that have bss after symtab
287
	$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab generic/src/debug/real_map.bin generic/src/debug/sizeok_map.o
298
	$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab generic/src/debug/real_map.bin generic/src/debug/sizeok_map.o
288
	$(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/sizeok_map.o -o $@ -Map kernel.map.pre
299
	$(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
289
	$(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump
300
	$(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > kernel.objdump
290
	tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin 
301
	tools/genmap.py kernel.map.pre kernel.objdump generic/src/debug/real_map.bin 
291
 
302
 
292
generic/src/debug/real_map.o: generic/src/debug/real_map.bin
303
generic/src/debug/real_map.o: generic/src/debug/real_map.bin
293
	$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab $< $@
304
	$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab $< $@
294
 
305
 
295
kernel.raw: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o
306
kernel.raw: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o
296
	$(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o -o $@ -Map kernel.map
307
	$(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
297
 
308
 
298
kernel.bin: kernel.raw
309
kernel.bin: kernel.raw
299
	$(OBJCOPY) -O $(BFD) kernel.raw kernel.bin
310
	$(OBJCOPY) -O $(BFD) kernel.raw kernel.bin
300
 
311
 
301
disasm: kernel.raw
312
disasm: kernel.raw
Line 306... Line 317...
306
 
317
 
307
%.o: %.s
318
%.o: %.s
308
	$(AS) $(AFLAGS) $< -o $@
319
	$(AS) $(AFLAGS) $< -o $@
309
 
320
 
310
%.o: %.c
321
%.o: %.c
311
	$(CC) $(DEFS) $(CFLAGS) -c $< -o $@
322
	$(CC) $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) -c $< -o $@