Subversion Repositories Kolibri OS

Rev

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