Rev 1166 | Rev 1401 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1166 | Rev 1395 | ||
---|---|---|---|
Line 28... | Line 28... | ||
28 | 28 | ||
29 | ## Toolchain configuration |
29 | ## Toolchain configuration |
30 | # |
30 | # |
31 | 31 | ||
32 | TARGET = ppc-linux-gnu |
32 | TARGET = ppc-linux-gnu |
33 | TOOLCHAIN_DIR = /usr/local/ppc/bin |
33 | TOOLCHAIN_DIR = /usr/local/ppc64/bin |
34 | 34 | ||
35 | ifeq ($(COMPILER),native) |
35 | ifeq ($(COMPILER),native) |
36 | CC = gcc |
36 | CC = gcc |
37 | AS = as |
37 | AS = as |
38 | LD = ld |
38 | LD = ld |
Line 44... | Line 44... | ||
44 | LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld |
44 | LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld |
45 | OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy |
45 | OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy |
46 | OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump |
46 | OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump |
47 | endif |
47 | endif |
48 | 48 | ||
49 | CFLAGS = -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -mcpu=powerpc64 -m64 |
49 | CFLAGS = -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -mcpu=powerpc64 -msoft-float -m64 |
50 | DEFS = |
50 | DEFS = |
51 | 51 | ||
52 | SOURCES = \ |
52 | SOURCES = \ |
53 | main.c \ |
53 | main.c \ |
54 | ofw.c \ |
54 | ofw.c \ |
55 | printf.c \ |
55 | printf.c \ |
56 | asm.S \ |
56 | asm.S \ |
57 | boot.S |
57 | boot.S |
58 | 58 | ||
- | 59 | COMPONENTS = \ |
|
- | 60 | $(KERNELDIR)/kernel.bin \ |
|
- | 61 | $(USPACEDIR)/ns/ns \ |
|
- | 62 | $(USPACEDIR)/init/init \ |
|
- | 63 | $(USPACEDIR)/fb/fb |
|
- | 64 | ||
59 | OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
65 | OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
- | 66 | COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS)))) |
|
60 | 67 | ||
61 | .PHONY: all clean depend |
68 | .PHONY: all clean depend |
62 | 69 | ||
63 | all: image.boot |
70 | all: image.boot |
64 | 71 | ||
65 | -include Makefile.depend |
72 | -include Makefile.depend |
66 | 73 | ||
67 | image.boot: depend $(OBJECTS) kernel.o |
74 | image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) kernel.o |
68 | $(LD) -no-check-sections -N -T _link.ld $(OBJECTS) kernel.o -o $@ |
75 | $(LD) -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) -o $@ |
69 | 76 | ||
70 | depend: |
77 | depend: |
71 | -makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null |
78 | -makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null |
72 | 79 | ||
73 | clean: |
80 | clean: |
74 | -rm -f $(OBJECTS) image.boot kernel.o Makefile.depend |
81 | -rm -f _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend |
75 | 82 | ||
76 | kernel.o: $(KERNEL) |
83 | _components.h _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) |
77 | $(OBJCOPY) -I binary -O elf64-powerpc -B powerpc --rename-section .data=.image $(KERNEL) $@ |
84 | ./pack $(OBJCOPY) $(COMPONENTS) |
78 | 85 | ||
79 | %.o: %.S |
86 | %.o: %.S |
80 | $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
87 | $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
81 | 88 | ||
82 | %.o: %.c |
89 | %.o: %.c |