Rev 3397 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3397 | Rev 3492 | ||
---|---|---|---|
Line 55... | Line 55... | ||
55 | LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld |
55 | LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld |
56 | OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy |
56 | OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy |
57 | OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump |
57 | OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump |
58 | endif |
58 | endif |
59 | 59 | ||
60 | CFLAGS = -DRELEASE=\"$(RELEASE)\" -I. -I../../../generic -I../../../genarch -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -mcpu=ultrasparc -m64 |
60 | CFLAGS = -DRELEASE=\"$(RELEASE)\" -I. -I../../../generic -I../../../genarch -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -mcpu=ultrasparc -m64 -mno-fpu -pipe |
61 | 61 | ||
62 | ifdef REVISION |
62 | ifdef REVISION |
63 | CFLAGS += "-DREVISION=\"$(REVISION)\"" |
63 | CFLAGS += "-DREVISION=\"$(REVISION)\"" |
64 | endif |
64 | endif |
65 | 65 | ||
Line 77... | Line 77... | ||
77 | ../../../genarch/ofw_tree.c \ |
77 | ../../../genarch/ofw_tree.c \ |
78 | ofwarch.c \ |
78 | ofwarch.c \ |
79 | asm.S \ |
79 | asm.S \ |
80 | boot.S |
80 | boot.S |
81 | 81 | ||
- | 82 | # |
|
- | 83 | # All components that go to image.boot without the ramdisk. |
|
- | 84 | # |
|
82 | COMPONENTS = \ |
85 | COMPONENTS = \ |
83 | $(KERNELDIR)/kernel.bin \ |
86 | $(KERNELDIR)/kernel.bin \ |
84 | $(USPACEDIR)/srv/ns/ns \ |
87 | $(USPACEDIR)/srv/ns/ns \ |
85 | $(USPACEDIR)/app/init/init \ |
88 | $(USPACEDIR)/app/init/init \ |
86 | $(USPACEDIR)/srv/loader/loader \ |
89 | $(USPACEDIR)/srv/loader/loader \ |
Line 92... | Line 95... | ||
92 | endif |
95 | endif |
93 | ifeq ($(RDFMT),fat) |
96 | ifeq ($(RDFMT),fat) |
94 | COMPONENTS += $(USPACEDIR)/srv/fs/fat/fat |
97 | COMPONENTS += $(USPACEDIR)/srv/fs/fat/fat |
95 | endif |
98 | endif |
96 | 99 | ||
- | 100 | # |
|
- | 101 | # Final list of all components that go to image.boot. |
|
- | 102 | # |
|
- | 103 | ALL_COMPONENTS = $(COMPONENTS) |
|
- | 104 | ifeq ($(CONFIG_RD_EXTERNAL),n) |
|
- | 105 | ALL_COMPONENTS += ./initrd.img |
|
- | 106 | endif |
|
- | 107 | ||
97 | RD_TASKS = \ |
108 | RD_SRVS = \ |
98 | $(USPACEDIR)/srv/fb/fb \ |
109 | $(USPACEDIR)/srv/fb/fb \ |
99 | $(USPACEDIR)/srv/kbd/kbd \ |
110 | $(USPACEDIR)/srv/kbd/kbd \ |
100 | $(USPACEDIR)/srv/console/console \ |
111 | $(USPACEDIR)/srv/console/console \ |
101 | $(USPACEDIR)/srv/fs/tmpfs/tmpfs \ |
112 | $(USPACEDIR)/srv/fs/tmpfs/tmpfs \ |
102 | $(USPACEDIR)/srv/fs/fat/fat \ |
113 | $(USPACEDIR)/srv/fs/fat/fat |
- | 114 | ||
- | 115 | RD_APPS = \ |
|
103 | $(USPACEDIR)/app/tetris/tetris \ |
116 | $(USPACEDIR)/app/tetris/tetris \ |
104 | $(USPACEDIR)/app/tester/tester \ |
117 | $(USPACEDIR)/app/tester/tester \ |
- | 118 | $(USPACEDIR)/app/trace/trace \ |
|
105 | $(USPACEDIR)/app/bdsh/bdsh \ |
119 | $(USPACEDIR)/app/bdsh/bdsh \ |
106 | $(USPACEDIR)/app/klog/klog |
120 | $(USPACEDIR)/app/klog/klog |
107 | 121 | ||
108 | OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
122 | OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
109 | COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS)))) |
123 | ALL_COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(ALL_COMPONENTS)))) |
110 | 124 | ||
111 | .PHONY: all clean depend |
125 | .PHONY: all clean depend |
112 | 126 | ||
113 | all: image.boot disasm |
127 | all: image.boot disasm |
114 | 128 | ||
115 | -include Makefile.depend |
129 | -include Makefile.depend |
116 | 130 | ||
117 | image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) |
131 | image.boot: depend _components.h _link.ld $(ALL_COMPONENT_OBJECTS) $(OBJECTS) |
118 | $(LD) -Map image.map -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) -o $@ |
132 | $(LD) -Map image.map -no-check-sections -N -T _link.ld $(ALL_COMPONENT_OBJECTS) $(OBJECTS) -o $@ |
119 | 133 | ||
120 | depend: |
134 | depend: |
121 | -makedepend $(DEFS) $(CFLAGS) -f - $(SOURCES) > Makefile.depend 2> /dev/null |
135 | -makedepend -f - -- $(DEFS) $(CFLAGS) -- $(SOURCES) > Makefile.depend 2> /dev/null |
122 | 136 | ||
123 | clean: |
137 | clean: |
124 | -for task in $(RD_TASKS) ; do \ |
138 | -for file in $(RD_SRVS) ; do \ |
125 | rm -f $(USPACEDIR)/dist/sbin/`basename $$task` ; \ |
139 | rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \ |
126 | done |
140 | done |
- | 141 | -for file in $(RD_APPS) ; do \ |
|
- | 142 | rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \ |
|
- | 143 | done |
|
127 | -rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) initrd.img image.boot image.map image.disasm Makefile.depend |
144 | -rm -f _components.h _components.c _link.ld $(ALL_COMPONENT_OBJECTS) $(OBJECTS) initrd.img image.boot image.map image.disasm Makefile.depend |
128 | 145 | ||
129 | _components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o: $(COMPONENTS) $(RD_TASKS) _link.ld.in |
146 | _components.h _components.c _link.ld $(ALL_COMPONENT_OBJECTS): $(COMPONENTS) $(RD_SRVS) $(RD_APPS) _link.ld.in |
- | 147 | for file in $(RD_SRVS) ; do \ |
|
- | 148 | cp $$file $(USPACEDIR)/dist/srv/ ; \ |
|
- | 149 | done |
|
130 | for task in $(RD_TASKS) ; do \ |
150 | for file in $(RD_APPS) ; do \ |
131 | cp $$task $(USPACEDIR)/dist/sbin/ ; \ |
151 | cp $$file $(USPACEDIR)/dist/app/ ; \ |
132 | done |
152 | done |
133 | ifeq ($(RDFMT),tmpfs) |
153 | ifeq ($(RDFMT),tmpfs) |
134 | ../../../../tools/mktmpfs.py $(USPACEDIR)/dist/ initrd.fs |
154 | ../../../../tools/mktmpfs.py $(USPACEDIR)/dist/ initrd.fs |
135 | endif |
155 | endif |
136 | ifeq ($(RDFMT),fat) |
156 | ifeq ($(RDFMT),fat) |
137 | ../../../../tools/mkfat.sh $(USPACEDIR)/dist/ initrd.fs |
157 | ../../../../tools/mkfat.sh $(USPACEDIR)/dist/ initrd.fs |
138 | endif |
158 | endif |
139 | ../../../../tools/mkhord.py 16384 initrd.fs initrd.img |
159 | ../../../../tools/mkhord.py 16384 initrd.fs initrd.img |
140 | rm initrd.fs |
160 | rm initrd.fs |
141 | ../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 1 "unsigned long" $(COMPONENTS) ./initrd.img |
161 | ../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 1 "unsigned long" $(ALL_COMPONENTS) |
142 | 162 | ||
143 | %.o: %.S |
163 | %.o: %.S |
144 | $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
164 | $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
145 | 165 | ||
146 | %.o: %.c |
166 | %.o: %.c |