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 -DKERNEL_SOS
020 CFLAGS = -Wall -nostdinc -ffreestanding -DKER !! 003 LDFLAGS = --warn-common
021 LDFLAGS = --warn-common -nostdlib <<
022 OBJECTS = bootstrap/multiboot.o 004 OBJECTS = bootstrap/multiboot.o \
023 hwcore/idt.o hwcore/gdt.o 005 hwcore/idt.o hwcore/gdt.o \
024 hwcore/exception.o hwcore/exception_ 006 hwcore/exception.o hwcore/exception_wrappers.o \
025 hwcore/irq.o hwcore/irq_wrappers.o h 007 hwcore/irq.o hwcore/irq_wrappers.o hwcore/i8259.o \
026 hwcore/paging.o 008 hwcore/paging.o \
027 hwcore/i8254.o drivers/x86_videomem. 009 hwcore/i8254.o drivers/x86_videomem.o drivers/bochs.o \
028 hwcore/cpu_context.o hwcore/cpu_cont !! 010 sos/physmem.o sos/klibc.o sos/main.o
029 sos/kmem_vmm.o sos/kmem_slab.o sos/k <<
030 sos/physmem.o sos/klibc.o <<
031 sos/thread.o sos/kwaitq.o <<
032 sos/time.o sos/sched.o sos/ksynch.o <<
033 sos/assert.o sos/main.o sos/mouse_si <<
034 011
035 KERNEL_OBJ = sos.elf 012 KERNEL_OBJ = sos.elf
036 MULTIBOOT_IMAGE = fd.img 013 MULTIBOOT_IMAGE = fd.img
037 PWD := $(shell pwd) 014 PWD := $(shell pwd)
038 015
039 016
040 all: $(MULTIBOOT_IMAGE) 017 all: $(MULTIBOOT_IMAGE)
041 018
042 $(MULTIBOOT_IMAGE): $(KERNEL_OBJ) 019 $(MULTIBOOT_IMAGE): $(KERNEL_OBJ)
043 ./support/build_image.sh $@ $< 020 ./support/build_image.sh $@ $<
044 021
045 $(KERNEL_OBJ): $(OBJECTS) ./support/sos.lds 022 $(KERNEL_OBJ): $(OBJECTS) ./support/sos.lds
046 $(LD) $(LDFLAGS) -T ./support/sos.lds 023 $(LD) $(LDFLAGS) -T ./support/sos.lds -o $@ $(OBJECTS)
047 -nm -C $@ | cut -d ' ' -f 1,3 > sos.ma 024 -nm -C $@ | cut -d ' ' -f 1,3 > sos.map
048 size $@ <<
049 025
050 -include .mkvars 026 -include .mkvars
051 027
052 # Create objects from C source code 028 # Create objects from C source code
053 %.o: %.c 029 %.o: %.c
054 $(CC) -I$(PWD) -c $< $(CFLAGS) -o $@ 030 $(CC) -I$(PWD) -c $< $(CFLAGS) -o $@
055 031
056 032
057 %.o: %.S 033 %.o: %.S
058 $(CC) -I$(PWD) -c $< $(CFLAGS) -DASM_S 034 $(CC) -I$(PWD) -c $< $(CFLAGS) -DASM_SOURCE=1 -o $@
059 <<
060 FORCE: <<
061 @ <<
062 035
063 036
064 clean: 037 clean:
065 $(RM) *.img *.o mtoolsrc *~ menu.txt * 038 $(RM) *.img *.o mtoolsrc *~ menu.txt *.img *.elf *.bin *.map
066 $(RM) *.log *.out bochs* 039 $(RM) *.log *.out bochs*
067 $(RM) bootstrap/*.o bootstrap/*~ 040 $(RM) bootstrap/*.o bootstrap/*~
068 $(RM) drivers/*.o drivers/*~ 041 $(RM) drivers/*.o drivers/*~
069 $(RM) hwcore/*.o hwcore/*~ 042 $(RM) hwcore/*.o hwcore/*~
070 $(RM) sos/*.o sos/*~ 043 $(RM) sos/*.o sos/*~
071 $(RM) support/*~ 044 $(RM) support/*~
072 $(RM) extra/*~ 045 $(RM) extra/*~