Subversion Repositories Kolibri OS

Rev

Rev 861 | Rev 864 | 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-printf -masm=intel
  10. LDFLAGS = -shared -s -Map kernel.map --image-base 0x100000 --file-alignment 32
  11.  
  12. KERNEL_SRC:=                            \
  13.                 kernel.asm              \
  14.                 core/memory.inc         \
  15.                 core/heap.inc           \
  16.                 core/taskman.inc        \
  17.                 core/sys32.inc          \
  18.                 core/dll.inc            \
  19.                 data32.inc
  20.  
  21. PE_SRC:=                        \
  22.                 init.c          \
  23.                 mm.c            \
  24.                 slab.c          \
  25.                 heap.c          \
  26.                 spinlock.c      \
  27.                 boot/boot.asm   \
  28.                 boot/start.asm
  29.  
  30. #include <types.h>
  31. #include <core.h>
  32. #include <spinlock.h>
  33. #include <link.h>
  34. #include <mm.h>
  35. #include <slab.h>
  36.                
  37. H_SRC:=                                 \
  38.                 include/types.h         \
  39.                 include/atomic.h        \
  40.                 include/spinlock.h      \
  41.                 include/link.h          \
  42.                 include/core.h          \
  43.                 include/mm.h            \
  44.                 include/slab.h
  45.  
  46. PE_OBJS = $(patsubst %.s, bin/%.obj, $(patsubst %.asm, bin/%.obj,\
  47.             $(patsubst %.c, bin/%.obj, $(PE_SRC))))
  48.  
  49.  
  50. all: kernel.gz
  51.  
  52. kernel.gz :kernel.mnt
  53.         7z a -tgzip kernel.gz kernel.mnt  
  54.  
  55. kernel.mnt: kernel.obj $(PE_OBJS) Makefile ld.x
  56.         ld $(LDFLAGS) -T ld.x -o $@ kernel.obj $(PE_OBJS)
  57.  
  58. bin/%.obj : core/%.c $(H_SRC) Makefile
  59.         $(CC) $(CFLAGS) -o $@ $<
  60.        
  61. bin/%.obj: %.asm
  62.         $(FASM) $< $@
  63.  
  64. kernel.obj: $(KERNEL_SRC)
  65.         $(FASM) kernel.asm
  66.  
  67. all: $(SUBDIRS)
  68.  
  69. .PHONY: all
  70.