Subversion Repositories HelenOS-historic

Rev

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

Rev 1012 Rev 1017
Line 147... Line 147...
147
 
147
 
148
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
148
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
149
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
149
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
150
GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES)))
150
GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES)))
151
 
151
 
152
.PHONY: all build config distclean clean archlinks depend boot disasm
152
.PHONY: all build config distclean clean archlinks depend disasm
153
 
153
 
154
all:
154
all:
155
	tools/config.py default $(NARCH)
155
	tools/config.py default $(NARCH)
156
ifdef NARCH
156
ifdef NARCH
157
 ifneq ($(ARCH), $(NARCH))
157
 ifneq ($(ARCH), $(NARCH))
158
	$(MAKE) -C . clean
158
	$(MAKE) -C . clean
159
 endif
159
 endif
160
endif
160
endif
161
	$(MAKE) -C . build
161
	$(MAKE) -C . build
162
 
162
 
163
build: kernel.bin boot disasm
163
build: kernel.bin disasm
164
 
164
 
165
config:
165
config:
166
	-rm Makefile.depend
166
	-rm Makefile.depend
167
	tools/config.py
167
	tools/config.py
168
 
168
 
Line 174... Line 174...
174
clean:
174
clean:
175
	-rm -f kernel.bin kernel.raw kernel.map kernel.map.pre kernel.objdump kernel.disasm generic/src/debug/real_map.bin Makefile.depend* generic/include/arch generic/include/genarch arch/$(ARCH)/_link.ld
175
	-rm -f kernel.bin kernel.raw kernel.map kernel.map.pre kernel.objdump kernel.disasm generic/src/debug/real_map.bin Makefile.depend* generic/include/arch generic/include/genarch arch/$(ARCH)/_link.ld
176
	find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \;
176
	find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \;
177
	for arch in arch/*; do \
177
	for arch in arch/*; do \
178
	    [ -e $$arch/_link.ld ] && rm $$arch/_link.ld 2>/dev/null;\
178
	    [ -e $$arch/_link.ld ] && rm $$arch/_link.ld 2>/dev/null;\
179
	    $(MAKE) -C $$arch/boot clean; \
-
 
180
	done;exit 0
179
	done;exit 0
181
 
180
 
182
archlinks:
181
archlinks:
183
	ln -sfn ../../arch/$(ARCH)/include/ generic/include/arch
182
	ln -sfn ../../arch/$(ARCH)/include/ generic/include/arch
184
	ln -sfn ../../genarch/include/ generic/include/genarch
183
	ln -sfn ../../genarch/include/ generic/include/genarch
Line 208... Line 207...
208
	$(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o -o $@ -Map kernel.map
207
	$(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o -o $@ -Map kernel.map
209
 
208
 
210
kernel.bin: kernel.raw
209
kernel.bin: kernel.raw
211
	$(OBJCOPY) -O $(BFD) kernel.raw kernel.bin
210
	$(OBJCOPY) -O $(BFD) kernel.raw kernel.bin
212
 
211
 
213
boot: kernel.bin
-
 
214
	if [ -d arch/$(ARCH)/boot ] ; then $(MAKE) -C arch/$(ARCH)/boot build KERNEL_SIZE="`cat kernel.bin | wc -c`" CC=$(CC) AS=$(AS) LD=$(LD) ; fi
-
 
215
 
-
 
216
disasm: kernel.raw
212
disasm: kernel.raw
217
	$(OBJDUMP) -d kernel.raw > kernel.disasm
213
	$(OBJDUMP) -d kernel.raw > kernel.disasm
218
 
214
 
219
%.o: %.S
215
%.o: %.S
220
	$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
216
	$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@