Subversion Repositories Kolibri OS

Rev

Rev 1623 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. FASM=fasm
  2. FLAGS=-m 65536
  3. languages=en|ru|ge|et|sp
  4. drivers_src=com_mouse emu10k1x fm801 infinity sis sound vt823x
  5.  
  6. .PHONY: all kernel drivers bootloader clean
  7.  
  8. all: kernel drivers bootloader
  9.  
  10. kernel: check_lang
  11.         @echo "*** building kernel with language '$(lang)' ..."
  12.         @mkdir -p bin
  13.         @echo "lang fix $(lang)" > lang.inc
  14.         @echo "--- building 'bin/kernel.mnt' ..."
  15.         @$(FASM) $(FLAGS) kernel.asm bin/kernel.mnt
  16.         @rm -f lang.inc
  17.  
  18. drivers:
  19.         @echo "*** building drivers ..."
  20.         @mkdir -p bin/drivers
  21.         @cd drivers; for f in $(drivers_src); do \
  22.           echo "--- building 'bin/drivers/$${f}.obj' ..."; \
  23.           $(FASM) $(FLAGS) "$${f}.asm" "../bin/drivers/$${f}.obj" || exit $?; \
  24.         done
  25.  
  26. bootloader: check_lang
  27.         @echo "*** building bootloader with language '$(lang)' ..."
  28.         @mkdir -p bin
  29.         @echo "lang fix $(lang)" > lang.inc
  30.         @echo "--- building 'bin/boot_fat12.bin' ..."
  31.         @$(FASM) $(FLAGS) bootloader/boot_fat12.asm bin/boot_fat12.bin
  32.         @rm -f lang.inc
  33.                
  34.  
  35. check_lang:
  36.         @case "$(lang)" in \
  37.           $(languages)) \
  38.             ;; \
  39.           *) \
  40.             echo "*** error: language is incorrect or not specified"; \
  41.             exit 1; \
  42.             ;; \
  43.         esac
  44.  
  45. clean:
  46.         rm -rf bin
  47.         rm -f lang.inc
  48.