Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 350 → Rev 376

//SPARTAN/trunk/Makefile
1,40 → 1,40
include Makefile.config
include ../arch/$(ARCH)/Makefile.inc
include arch/$(ARCH)/Makefile.inc
 
sources=cpu/cpu.c \
main/main.c \
main/kinit.c \
main/uinit.c \
proc/scheduler.c \
proc/thread.c \
proc/task.c \
proc/the.c \
mm/heap.c \
mm/frame.c \
mm/page.c \
mm/tlb.c \
mm/vm.c \
lib/func.c \
lib/list.c \
lib/memstr.c \
lib/sort.c \
debug/print.c \
debug/symtab.c \
time/clock.c \
time/timeout.c \
time/delay.c \
preempt/preemption.c \
synch/spinlock.c \
synch/condvar.c \
synch/rwlock.c \
synch/mutex.c \
synch/semaphore.c \
synch/waitq.c \
smp/ipi.c \
fb/font-8x16.c
sources=src/cpu/cpu.c \
src/main/main.c \
src/main/kinit.c \
src/main/uinit.c \
src/proc/scheduler.c \
src/proc/thread.c \
src/proc/task.c \
src/proc/the.c \
src/mm/heap.c \
src/mm/frame.c \
src/mm/page.c \
src/mm/tlb.c \
src/mm/vm.c \
src/lib/func.c \
src/lib/list.c \
src/lib/memstr.c \
src/lib/sort.c \
src/debug/print.c \
src/debug/symtab.c \
src/time/clock.c \
src/time/timeout.c \
src/time/delay.c \
src/preempt/preemption.c \
src/synch/spinlock.c \
src/synch/condvar.c \
src/synch/rwlock.c \
src/synch/mutex.c \
src/synch/semaphore.c \
src/synch/waitq.c \
src/smp/ipi.c \
src/fb/font-8x16.c
 
# CFLAGS options same for all targets
CFLAGS+=-nostdinc -I../include -Werror-implicit-function-declaration -Wmissing-prototypes -Werror
CFLAGS+=-nostdinc -Iinclude/ -Werror-implicit-function-declaration -Wmissing-prototypes -Werror
 
ifdef DEBUG_SPINLOCK
CFLAGS+=-D$(DEBUG_SPINLOCK)
45,7 → 45,7
endif
 
ifdef TEST
test_objects:=$(addsuffix .o,$(basename ../test/$(TEST_DIR)/$(TEST_FILE)))
test_objects:=$(addsuffix .o,$(basename test/$(TEST_DIR)/$(TEST_FILE)))
CFLAGS+=-D$(TEST)
endif
arch_objects:=$(addsuffix .o,$(basename $(arch_sources)))
58,9 → 58,9
-include Makefile.depend
 
config:
find . ../include -name arch -type l -exec rm \{\} \;
ln -s ../arch/$(ARCH)/src arch
ln -s ../arch/$(ARCH)/include ../include/arch
find src/ include/ -name arch -type l -exec rm \{\} \;
ln -s ../arch/$(ARCH)/src/ src/arch
ln -s ../arch/$(ARCH)/include/ include/arch
 
depend:
$(CC) $(CFLAGS) -M $(arch_sources) $(sources) >Makefile.depend
68,27 → 68,27
build: kernel.bin boot
 
clean:
find . ../arch/$(ARCH)/src ../test -name '*.o' -exec rm \{\} \;
-rm *.bin kernel.map kernel.map.pre kernel.objdump debug/real_map.bin
$(MAKE) -C ../arch/$(ARCH)/boot clean
find src/ arch/$(ARCH)/src/ test/ -name '*.o' -exec rm \{\} \;
-rm *.bin kernel.map kernel.map.pre kernel.objdump src/debug/real_map.bin
$(MAKE) -C arch/$(ARCH)/boot/ clean
 
dist-clean:
find . ../include -name arch -type l -exec rm \{\} \;
find src/ include/ -name arch -type l -exec rm \{\} \;
-rm Makefile.depend
-$(MAKE) clean
 
debug/real_map.bin: $(arch_objects) $(objects) $(test_objects) ../arch/$(ARCH)/_link.ld
$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab Makefile debug/empty_map.o
$(LD) -T ../arch/$(ARCH)/_link.ld $(LFLAGS) $(arch_objects) $(objects) $(test_objects) debug/empty_map.o -o $@ -Map kernel.map.pre
src/debug/real_map.bin: $(arch_objects) $(objects) $(test_objects) arch/$(ARCH)/_link.ld
$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab Makefile src/debug/empty_map.o
$(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(arch_objects) $(objects) $(test_objects) src/debug/empty_map.o -o $@ -Map kernel.map.pre
$(OBJDUMP) -t $(arch_objects) $(objects) $(test_objects) > kernel.objdump
../tools/genmap.py kernel.map.pre kernel.objdump debug/real_map.bin
tools/genmap.py kernel.map.pre kernel.objdump src/debug/real_map.bin
 
debug/real_map.o: debug/real_map.bin
src/debug/real_map.o: src/debug/real_map.bin
$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab $< $@
 
 
kernel.bin: $(arch_objects) $(objects) $(test_objects) ../arch/$(ARCH)/_link.ld debug/real_map.o
$(LD) -T ../arch/$(ARCH)/_link.ld $(LFLAGS) $(arch_objects) $(objects) $(test_objects) debug/real_map.o -o $@ -Map kernel.map
kernel.bin: $(arch_objects) $(objects) $(test_objects) arch/$(ARCH)/_link.ld src/debug/real_map.o
$(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(arch_objects) $(objects) $(test_objects) src/debug/real_map.o -o $@ -Map kernel.map
 
%.o: %.S
$(CC) $(ASFLAGS) $(CFLAGS) -c $< -o $@
102,4 → 102,4
KS=`cat kernel.bin | wc -c`
 
boot:
$(MAKE) -C ../arch/$(ARCH)/boot build KERNEL_SIZE=$(KS)
$(MAKE) -C arch/$(ARCH)/boot build KERNEL_SIZE=$(KS)