Subversion Repositories Kolibri OS

Rev

Rev 908 | Rev 928 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. CC = gcc
  3. FASM = fasm.exe
  4.  
  5. INCLUDE = include/
  6.  
  7. DEFS = -DUSE_SMP -DCONFIG_DEBUG
  8.  
  9. CFLAGS = -c -O2 -I $(INCLUDE) -fomit-frame-pointer -fno-builtin
  10. LDFLAGS = -shared -s -Map kernel.map --image-base 0x100000 --file-alignment 32
  11.  
  12. KERNEL_SRC:=                            \
  13.                 kernel.asm                  \
  14.                 data32.inc                  \
  15.                 core/memory.inc         \
  16.                 core/heap.inc           \
  17.                 core/malloc.inc         \
  18.                 core/taskman.inc        \
  19.                 core/v86.inc            \
  20.                 core/sys32.inc          \
  21.                 core/dll.inc            \
  22.                 core/exports.inc        \
  23.                 fs/ntfs.inc                 \
  24.                 gui/window.inc          \
  25.                 gui/event.inc           \
  26.                 video/vesa20.inc        \
  27.                 video/cursors.inc
  28.  
  29.  
  30. PE_SRC:=                        \
  31.                 init.c          \
  32.                 mm.c            \
  33.                 slab.c          \
  34.                 heap.c          \
  35.                 pe.c            \
  36.                 dll.c           \
  37.                 spinlock.c      \
  38.                 boot/boot.asm   \
  39.                 boot/start.asm
  40.  
  41.        
  42. H_SRC:=                                 \
  43.                 include/types.h         \
  44.                 include/atomic.h        \
  45.                 include/spinlock.h      \
  46.                 include/link.h          \
  47.                 include/core.h          \
  48.                 include/mm.h            \
  49.                 include/pe.h            \
  50.                 include/slab.h
  51.  
  52. PE_OBJS = $(patsubst %.s, bin/%.obj, $(patsubst %.asm, bin/%.obj,\
  53.             $(patsubst %.c, bin/%.obj, $(PE_SRC))))
  54.  
  55.  
  56. all: kernel.gz
  57.  
  58. kernel.gz :kernel.mnt
  59.         7z a -tgzip kernel.gz kernel.mnt  
  60.  
  61. kernel.mnt: kernel.obj bin/export.obj $(PE_OBJS) Makefile ld.x
  62.         ld $(LDFLAGS) -T ld.x -o $@ kernel.obj bin/export.obj $(PE_OBJS)
  63.  
  64. bin/%.obj : core/%.c $(H_SRC) Makefile
  65.         $(CC) $(CFLAGS) -o $@ $<
  66.        
  67. bin/%.obj: %.asm
  68.         $(FASM) $< $@
  69.  
  70. bin/export.obj: core/export.asm
  71.         as  -o $@ $<
  72.  
  73. kernel.obj: $(KERNEL_SRC)
  74.         $(FASM) kernel.asm
  75.  
  76. all: $(SUBDIRS)
  77.  
  78. .PHONY: all
  79.