Diff markup
001 <<
002 <<
003 <<
004 <<
005 <<
006 <<
007 <<
008 <<
009 <<
010 <<
011 <<
012 <<
013 <<
014 <<
015 <<
016 <<
017 <<
018 CC=gcc 001 CC=gcc
019 LD=ld !! 002 CFLAGS = -Wall -nostdlib -nostdinc -ffreestanding
020 CFLAGS = -Wall -nostdinc -ffreestanding -DKER !! 003 LDFLAGS = --warn-common
021 LIBGCC := $(shell $(CC) -print-libgcc-file-nam !! 004 OBJECTS = bootstrap/multiboot.o \
022 LDFLAGS = --warn-common -nostdlib !! 005 hwcore/idt.o hwcore/gdt.o \
023 OBJECTS = bootstrap/multiboot.o !! 006 hwcore/exception.o hwcore/exception_wrappers.o \
024 hwcore/idt.o hwcore/gdt.o !! 007 hwcore/irq.o hwcore/irq_wrappers.o hwcore/i8259.o \
025 hwcore/swintr.o hwcore/swintr_wrappe !! 008 hwcore/i8254.o drivers/x86_videomem.o drivers/bochs.o \
026 hwcore/exception.o hwcore/exception_ !! 009 sos/klibc.o sos/main.o
027 hwcore/irq.o hwcore/irq_wrappers.o h <<
028 hwcore/paging.o <<
029 hwcore/i8254.o drivers/x86_videomem. <<
030 hwcore/cpu_context.o hwcore/cpu_cont <<
031 hwcore/mm_context.o <<
032 sos/kmem_vmm.o sos/kmem_slab.o sos/k <<
033 sos/physmem.o sos/klibc.o <<
034 sos/thread.o sos/kwaitq.o <<
035 sos/time.o sos/sched.o sos/ksynch.o <<
036 sos/process.o sos/syscall.o <<
037 sos/assert.o sos/main.o sos/mouse_si <<
038 sos/uaccess.o sos/calcload.o <<
039 userland/userprogs.kimg sos/test-art <<
040 010
041 KERNEL_OBJ = sos.elf 011 KERNEL_OBJ = sos.elf
042 MULTIBOOT_IMAGE = fd.img 012 MULTIBOOT_IMAGE = fd.img
043 PWD := $(shell pwd) 013 PWD := $(shell pwd)
044 014
045 015
046 all: $(MULTIBOOT_IMAGE) 016 all: $(MULTIBOOT_IMAGE)
047 017
048 $(MULTIBOOT_IMAGE): $(KERNEL_OBJ) 018 $(MULTIBOOT_IMAGE): $(KERNEL_OBJ)
049 ./support/build_image.sh $@ $< 019 ./support/build_image.sh $@ $<
050 020
051 $(KERNEL_OBJ): $(OBJECTS) ./support/sos.lds !! 021 $(KERNEL_OBJ): $(OBJECTS)
052 $(LD) $(LDFLAGS) -T ./support/sos.lds !! 022 $(LD) $(LDFLAGS) -T ./support/sos.lds -o $@ $^
053 -nm -C $@ | cut -d ' ' -f 1,3 > sos.ma 023 -nm -C $@ | cut -d ' ' -f 1,3 > sos.map
054 size $@ <<
055 024
056 -include .mkvars 025 -include .mkvars
057 026
058 # Create the userland programs to include in t <<
059 userland/userprogs.kimg: FORCE <<
060 $(MAKE) -C userland <<
061 <<
062 027 # Create objects from C source code
063 %.o: %.c 028 %.o: %.c
064 $(CC) -I$(PWD) -c $< $(CFLAGS) -o $@ 029 $(CC) -I$(PWD) -c $< $(CFLAGS) -o $@
065 030
066 031
067 %.o: %.S 032 %.o: %.S
068 $(CC) -I$(PWD) -c $< $(CFLAGS) -DASM_S 033 $(CC) -I$(PWD) -c $< $(CFLAGS) -DASM_SOURCE=1 -o $@
069 034
070 FORCE: <<
071 @ <<
072 <<
073 035
074 clean: 036 clean:
075 $(RM) *.img *.o mtoolsrc *~ menu.txt * 037 $(RM) *.img *.o mtoolsrc *~ menu.txt *.img *.elf *.bin *.map
076 $(RM) *.log *.out bochs* 038 $(RM) *.log *.out bochs*
077 $(RM) bootstrap/*.o bootstrap/*~ 039 $(RM) bootstrap/*.o bootstrap/*~
078 $(RM) drivers/*.o drivers/*~ 040 $(RM) drivers/*.o drivers/*~
079 $(RM) hwcore/*.o hwcore/*~ 041 $(RM) hwcore/*.o hwcore/*~
080 $(RM) sos/*.o sos/*~ 042 $(RM) sos/*.o sos/*~
081 $(RM) support/*~ 043 $(RM) support/*~
082 $(RM) extra/*~ 044 $(RM) extra/*~
083 $(MAKE) -C userland clean <<