Rev 1018 | Rev 1763 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1018 | Rev 1685 | ||
---|---|---|---|
Line 49... | Line 49... | ||
49 | CFLAGS = -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mhard-float -mips3 |
49 | CFLAGS = -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mhard-float -mips3 |
50 | DEFS = |
50 | DEFS = |
51 | 51 | ||
52 | SOURCES = \ |
52 | SOURCES = \ |
53 | main.c \ |
53 | main.c \ |
54 | printf.c \ |
- | |
55 | msim.c \ |
54 | msim.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 | $(USPACEDIR)/kbd/kbd \ |
|
- | 65 | $(USPACEDIR)/console/console \ |
|
- | 66 | $(USPACEDIR)/tetris/tetris \ |
|
- | 67 | $(USPACEDIR)/ipcc/ipcc \ |
|
- | 68 | $(USPACEDIR)/klog/klog |
|
- | 69 | ||
59 | OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
70 | OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
- | 71 | COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS)))) |
|
60 | 72 | ||
61 | .PHONY: all clean depend |
73 | .PHONY: all clean depend |
62 | 74 | ||
63 | all: image.boot |
75 | all: image.boot |
64 | 76 | ||
65 | -include Makefile.depend |
77 | -include Makefile.depend |
66 | 78 | ||
67 | image.boot: depend $(OBJECTS) kernel.o |
79 | 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 $@ |
80 | $(LD) -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) -o $@ |
69 | 81 | ||
70 | depend: |
82 | depend: |
71 | -makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null |
83 | -makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null |
72 | 84 | ||
73 | clean: |
85 | clean: |
74 | -rm -f $(OBJECTS) image.boot kernel.o Makefile.depend |
86 | -rm -f _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend |
75 | 87 | ||
76 | kernel.o: $(KERNEL) |
88 | _components.h _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) |
77 | $(OBJCOPY) -I binary -O elf32-tradlittlemips -B mips $(KERNEL) $@ |
89 | ./pack $(OBJCOPY) $(COMPONENTS) |
78 | 90 | ||
79 | %.o: %.S |
91 | %.o: %.S |
80 | $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
92 | $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
81 | 93 | ||
82 | %.o: %.c |
94 | %.o: %.c |