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