Subversion Repositories Kolibri OS

Rev

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

  1. Compiler                = kos32-gcc
  2. Linker                                  = kos32-ld
  3.  
  4. SDK_DIR:= $(abspath ../../../contrib/sdk)
  5.  
  6. Includes = -Id:\TEMP\mprog\kos\includes -I$(SDK_DIR)/sources/newlib/libc/include
  7.  
  8. Compatib_Posix = -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp
  9.  
  10. Compiler_Options = -c -fno-exceptions -D_KOS_ -U_Win32 -U_WIN32 -U__MINGW32__ \
  11.         -mno-ms-bitfields -Wno-write-strings $(Includes) $(Compatib_Posix)
  12.  
  13. Exe_file                = cmm.kex
  14.  
  15.  
  16. Path_Libs               = -Ld:/TEMP/Dev-Cpp/lib/kos -L $(SDK_DIR)/lib
  17. #-Ld:/TEMP/Dev-Cpp/lib/gcc/mingw32/3.4.2 -Ld:/TEMP/Dev-Cpp/lib/gcc -Ld:/TEMP/Dev-Cpp/lib -Ld:/TEMP/Dev-Cpp/lib
  18.  
  19. Add_Libs                =
  20.  
  21. #Link_Libs              = -lc -lgcc
  22. Link_Libs = -static -S -nostdlib -T $(SDK_DIR)/lib/app-dynamic.lds \
  23.           --image-base 0 -lgcc -ldll -lc.dll
  24.  
  25. My_Libs                 = main.o port.o toka.o tokb.o tokc.o toke.o tokr.o errors.o debug.o outobj.o outpe.o disasm.o switch.o outle.o pointer.o new_type.o class.o res.o optreg.o libobj.o
  26.  
  27. ####################
  28. ## Makefile rules ##
  29. ####################
  30.  
  31. all        : $(Exe_file)
  32.  
  33. $(Exe_file) : $(My_Libs)
  34.         $(Linker) -o cmm.kex --stack 0x100000 $(Path_Libs) $(Add_Libs) $(My_Libs) $(Link_Libs)
  35.         objcopy cmm.kex -O binary
  36.         kpack cmm.kex
  37.  
  38. clean:  
  39.         rm *.o
  40.  
  41.  
  42. # next are the exceptions that don't have to be compiled with the /zu option
  43. # since they will never be called from a interrupt. hey.. I _tried_ to find
  44. # a clean solution..
  45.  
  46. main.o :  main.cpp
  47.         $(Compiler) $(Compiler_Options) $<
  48.  
  49. toka.o :  toka.cpp
  50.         $(Compiler) $(Compiler_Options) $<
  51.  
  52. tokb.o :  tokb.cpp
  53.         $(Compiler) $(Compiler_Options) $<
  54.  
  55. tokc.o :  tokc.cpp
  56.         $(Compiler) $(Compiler_Options) $<
  57.  
  58. toke.o :  toke.cpp
  59.         $(Compiler) $(Compiler_Options) $<
  60.  
  61. tokr.o :  tokr.cpp
  62.         $(Compiler) $(Compiler_Options) $<
  63.  
  64. errors.o :errors.cpp
  65.         $(Compiler) $(Compiler_Options) $<
  66.  
  67. debug.o : debug.cpp
  68.         $(Compiler) $(Compiler_Options) $<
  69.  
  70. outobj.o : outobj.cpp
  71.         $(Compiler) $(Compiler_Options) $<
  72.  
  73. outpe.o : outpe.cpp
  74.         $(Compiler) $(Compiler_Options) $<
  75.  
  76. disasm.o : disasm.cpp
  77.         $(Compiler) $(Compiler_Options) $<
  78.  
  79. switch.o : switch.cpp
  80.         $(Compiler) $(Compiler_Options) $<
  81.  
  82. outle.o : outle.cpp
  83.         $(Compiler) $(Compiler_Options) $<
  84.  
  85. pointer.o : pointer.cpp
  86.         $(Compiler) $(Compiler_Options) $<
  87.  
  88. new_type.o : new_type.cpp
  89.         $(Compiler) $(Compiler_Options) $<
  90.  
  91. class.o : class.cpp
  92.         $(Compiler) $(Compiler_Options) $<
  93.  
  94. res.o : res.cpp
  95.         $(Compiler) $(Compiler_Options) $<
  96.  
  97. optreg.o : optreg.cpp
  98.         $(Compiler) $(Compiler_Options) $<
  99.  
  100. libobj.o : libobj.cpp
  101.         $(Compiler) $(Compiler_Options) $<
  102.  
  103. port.o: port.cpp
  104.         $(Compiler) $(Compiler_Options) $<
  105.  
  106. .cpp.o:
  107.         $(Compiler) $(Compiler_Options) $<
  108.  
  109. .asm.o:
  110.         fasm $<
  111.  
  112.