Forráskód Böngészése

Rebase to revision 16888

git-svn-id: branches/svenbarth/classhelpers@16891 -
svenbarth 14 éve
szülő
commit
d12b198c7f
100 módosított fájl, 7395 hozzáadás és 2184 törlés
  1. 49 13
      .gitattributes
  2. 52 26
      .gitignore
  3. 3 3
      compiler/Makefile
  4. 2 2
      compiler/Makefile.fpc
  5. 3 0
      compiler/compiler.pas
  6. 8 4
      compiler/defcmp.pas
  7. 2 3
      compiler/i386/ag386nsm.pas
  8. 19 23
      compiler/ncal.pas
  9. 8 4
      compiler/ncgcal.pas
  10. 28 21
      compiler/ncgld.pas
  11. 85 155
      compiler/ncnv.pas
  12. 22 9
      compiler/ninl.pas
  13. 7 3
      compiler/optcse.pas
  14. 1 1
      compiler/paramgr.pas
  15. 19 1
      compiler/pdecvar.pas
  16. 16 3
      compiler/pexpr.pas
  17. 3 0
      compiler/powerpc/cputarg.pas
  18. 5 2
      compiler/psub.pas
  19. 15 15
      compiler/ptype.pas
  20. 2 1
      compiler/symconst.pas
  21. 12 105
      compiler/symdef.pas
  22. 3 3
      compiler/symtable.pas
  23. 2 1
      compiler/systems.pas
  24. 101 0
      compiler/systems/i_wii.pas
  25. 2 2
      compiler/systems/t_nwl.pas
  26. 2 2
      compiler/systems/t_nwm.pas
  27. 598 0
      compiler/systems/t_wii.pas
  28. 6 1
      compiler/x86/rax86.pas
  29. 8 1
      compiler/x86/rax86int.pas
  30. 1 0
      packages/fcl-db/src/base/db.pas
  31. 6 0
      packages/fcl-db/src/base/fields.inc
  32. 17 8
      packages/fcl-db/src/sqldb/sqlite/sqlite3conn.pp
  33. 1 1
      packages/fcl-db/tests/sqldbtoolsunit.pas
  34. 67 2
      packages/fcl-db/tests/testfieldtypes.pas
  35. 10 92
      packages/fcl-process/Makefile
  36. 2 0
      packages/fcl-process/Makefile.fpc
  37. 7 1
      packages/fcl-web/src/base/fpweb.pp
  38. 88 30
      packages/fpvectorial/src/dxfvectorialreader.pas
  39. 2 1
      packages/fpvectorial/src/fpvectorial.pas
  40. 76 21
      packages/fpvectorial/src/fpvtocanvas.pas
  41. 1 1
      packages/libgbafpc/src/gba.pp
  42. 12 0
      packages/libgd/src/gd.pas
  43. 0 93
      packages/libndsfpc/examples/RealTimeClock/Watch/Makefile.fpc
  44. 8 3
      packages/libndsfpc/examples/graphics/3D/3D_Both_Screens/3DBothScreens.pp
  45. 1 1
      packages/libndsfpc/examples/graphics/3D/Display_List/DisplayList.pp
  46. 1 1
      packages/libndsfpc/examples/graphics/3D/Env_Mapping/EnvMapping.pp
  47. 10 4
      packages/libndsfpc/examples/graphics/3D/Paletted_Cube/PalettedCube.pp
  48. 6 6
      packages/libndsfpc/examples/graphics/3D/Picking/Picking.pp
  49. 1 1
      packages/libndsfpc/examples/graphics/3D/Simple_Quad/SimpleQuad.pp
  50. 1 1
      packages/libndsfpc/examples/graphics/3D/Simple_Tri/SimpleTri.pp
  51. 58 1
      packages/libndsfpc/examples/graphics/3D/Textured_Cube/TexturedCube.pp
  52. 1 1
      packages/libndsfpc/examples/graphics/3D/Textured_Quad/TexturedQuad.pp
  53. BIN
      packages/libndsfpc/examples/graphics/3D/nehe/lesson10/data/drunkenlogo.pcx
  54. 130 5
      packages/libndsfpc/examples/graphics/3D/nehe/lesson10/lesson10.pp
  55. 11 8
      packages/libndsfpc/examples/graphics/3D/nehe/lesson10b/lesson10b.pp
  56. 5 1
      packages/libndsfpc/examples/graphics/Backgrounds/16bit_color_bmp/16bitColorBmp.pp
  57. 1 1
      packages/libndsfpc/examples/graphics/Backgrounds/Double_Buffer/DoubleBuffer.pp
  58. 2 2
      packages/libndsfpc/examples/graphics/Sprites/bitmap_sprites/BitmapSprites.pp
  59. 1 1
      packages/libndsfpc/examples/graphics/Sprites/fire_and_sprites/FireAndSprites.pp
  60. 0 6
      packages/libndsfpc/examples/input/Touch_Pad/touch_test/touchTest.pp
  61. 415 190
      packages/libndsfpc/examples/time/Makefile
  62. 1 1
      packages/libndsfpc/examples/time/Makefile.fpc
  63. 170 376
      packages/libndsfpc/examples/time/RealTimeClock/Makefile
  64. 46 0
      packages/libndsfpc/examples/time/RealTimeClock/Makefile.fpc
  65. 1 1
      packages/libndsfpc/examples/time/RealTimeClock/realtimeclock.pp
  66. 2384 0
      packages/libndsfpc/examples/time/stopwatch/Makefile
  67. 46 0
      packages/libndsfpc/examples/time/stopwatch/Makefile.fpc
  68. 68 0
      packages/libndsfpc/examples/time/stopwatch/stopwatch.pp
  69. 2384 0
      packages/libndsfpc/examples/time/timercallback/Makefile
  70. 46 0
      packages/libndsfpc/examples/time/timercallback/Makefile.fpc
  71. 44 0
      packages/libndsfpc/examples/time/timercallback/timercallback.pp
  72. 1 41
      packages/libndsfpc/src/nds/arm7/audio.inc
  73. 1 41
      packages/libndsfpc/src/nds/arm7/clock.inc
  74. 34 0
      packages/libndsfpc/src/nds/arm7/i2c.inc
  75. 0 2
      packages/libndsfpc/src/nds/arm7/input.inc
  76. 94 0
      packages/libndsfpc/src/nds/arm7/sdmmc.inc
  77. 1 41
      packages/libndsfpc/src/nds/arm7/serial.inc
  78. 1 41
      packages/libndsfpc/src/nds/arm7/touch.inc
  79. 0 40
      packages/libndsfpc/src/nds/arm9/background.inc
  80. 0 41
      packages/libndsfpc/src/nds/arm9/boxtest.inc
  81. 0 45
      packages/libndsfpc/src/nds/arm9/cache.inc
  82. 1 41
      packages/libndsfpc/src/nds/arm9/console.inc
  83. 0 40
      packages/libndsfpc/src/nds/arm9/decompress.inc
  84. 0 40
      packages/libndsfpc/src/nds/arm9/dynamicArray.inc
  85. 0 40
      packages/libndsfpc/src/nds/arm9/exceptions.inc
  86. 17 0
      packages/libndsfpc/src/nds/arm9/guitarGrip.inc
  87. 0 40
      packages/libndsfpc/src/nds/arm9/image.inc
  88. 0 40
      packages/libndsfpc/src/nds/arm9/input.inc
  89. 0 27
      packages/libndsfpc/src/nds/arm9/linkedlist.inc
  90. 0 40
      packages/libndsfpc/src/nds/arm9/math.inc
  91. 0 38
      packages/libndsfpc/src/nds/arm9/ndsmotion.inc
  92. 6 0
      packages/libndsfpc/src/nds/arm9/paddle.inc
  93. 0 40
      packages/libndsfpc/src/nds/arm9/pcx.inc
  94. 24 0
      packages/libndsfpc/src/nds/arm9/piano.inc
  95. 0 38
      packages/libndsfpc/src/nds/arm9/postest.inc
  96. 0 40
      packages/libndsfpc/src/nds/arm9/rumble.inc
  97. 0 41
      packages/libndsfpc/src/nds/arm9/sassert.inc
  98. 0 40
      packages/libndsfpc/src/nds/arm9/sound.inc
  99. 0 42
      packages/libndsfpc/src/nds/arm9/sprite.inc
  100. 0 40
      packages/libndsfpc/src/nds/arm9/trig_lut.inc

+ 49 - 13
.gitattributes

@@ -536,6 +536,7 @@ compiler/systems/i_sunos.pas svneol=native#text/plain
 compiler/systems/i_symbian.pas svneol=native#text/plain
 compiler/systems/i_watcom.pas svneol=native#text/plain
 compiler/systems/i_wdosx.pas svneol=native#text/plain
+compiler/systems/i_wii.pas svneol=native#text/plain
 compiler/systems/i_win.pas svneol=native#text/plain
 compiler/systems/mac_crea.txt svneol=native#text/plain
 compiler/systems/t_amiga.pas svneol=native#text/plain
@@ -560,6 +561,7 @@ compiler/systems/t_sunos.pas svneol=native#text/plain
 compiler/systems/t_symbian.pas svneol=native#text/plain
 compiler/systems/t_watcom.pas svneol=native#text/plain
 compiler/systems/t_wdosx.pas svneol=native#text/plain
+compiler/systems/t_wii.pas svneol=native#text/plain
 compiler/systems/t_win.pas svneol=native#text/plain
 compiler/tgobj.pas svneol=native#text/plain
 compiler/tokens.pas svneol=native#text/plain
@@ -1956,18 +1958,18 @@ packages/fcl-db/tests/Makefile -text
 packages/fcl-db/tests/Makefile.fpc -text
 packages/fcl-db/tests/README.txt svneol=native#text/plain
 packages/fcl-db/tests/database.ini.txt svneol=native#text/plain
-packages/fcl-db/tests/dbftoolsunit.pas -text
-packages/fcl-db/tests/dbtestframework.pas -text
+packages/fcl-db/tests/dbftoolsunit.pas svneol=native#text/plain
+packages/fcl-db/tests/dbtestframework.pas svneol=native#text/plain
 packages/fcl-db/tests/memdstoolsunit.pas svneol=native#text/plain
 packages/fcl-db/tests/sdfdstoolsunit.pas svneol=native#text/plain
-packages/fcl-db/tests/sqldbtoolsunit.pas -text
+packages/fcl-db/tests/sqldbtoolsunit.pas svneol=native#text/plain
 packages/fcl-db/tests/tcgensql.pas svneol=native#text/plain
 packages/fcl-db/tests/tcparser.pas svneol=native#text/plain
 packages/fcl-db/tests/tcsqlscanner.pas svneol=native#text/plain
 packages/fcl-db/tests/testbasics.pas svneol=native#text/plain
 packages/fcl-db/tests/testbufdatasetstreams.pas svneol=native#text/plain
 packages/fcl-db/tests/testdatasources.pas svneol=native#text/plain
-packages/fcl-db/tests/testdbbasics.pas -text
+packages/fcl-db/tests/testdbbasics.pas svneol=native#text/plain
 packages/fcl-db/tests/testdddiff.pp svneol=native#text/plain
 packages/fcl-db/tests/testfieldtypes.pas svneol=native#text/plain
 packages/fcl-db/tests/testsqlfiles.lpi svneol=native#text/plain
@@ -1975,7 +1977,7 @@ packages/fcl-db/tests/testsqlfiles.lpr svneol=native#text/plain
 packages/fcl-db/tests/testsqlscanner.lpi svneol=native#text/plain
 packages/fcl-db/tests/testsqlscanner.lpr svneol=native#text/plain
 packages/fcl-db/tests/testsqlscript.pas svneol=native#text/plain
-packages/fcl-db/tests/toolsunit.pas -text
+packages/fcl-db/tests/toolsunit.pas svneol=native#text/plain
 packages/fcl-extra/Makefile svneol=native#text/plain
 packages/fcl-extra/Makefile.fpc svneol=native#text/plain
 packages/fcl-extra/examples/Makefile svneol=native#text/plain
@@ -3973,11 +3975,6 @@ packages/libndsfpc/Makefile svneol=native#text/plain
 packages/libndsfpc/Makefile.fpc svneol=native#text/plain
 packages/libndsfpc/examples/Makefile svneol=native#text/plain
 packages/libndsfpc/examples/Makefile.fpc svneol=native#text/plain
-packages/libndsfpc/examples/RealTimeClock/Makefile svneol=native#text/plain
-packages/libndsfpc/examples/RealTimeClock/Makefile.fpc svneol=native#text/plain
-packages/libndsfpc/examples/RealTimeClock/Watch/Makefile svneol=native#text/plain
-packages/libndsfpc/examples/RealTimeClock/Watch/Makefile.fpc svneol=native#text/plain
-packages/libndsfpc/examples/RealTimeClock/Watch/watch.pp svneol=native#text/plain
 packages/libndsfpc/examples/audio/Makefile svneol=native#text/plain
 packages/libndsfpc/examples/audio/Makefile.fpc svneol=native#text/plain
 packages/libndsfpc/examples/audio/maxmod/Makefile svneol=native#text/plain
@@ -4164,6 +4161,7 @@ packages/libndsfpc/examples/graphics/3D/nehe/lesson10/Makefile svneol=native#tex
 packages/libndsfpc/examples/graphics/3D/nehe/lesson10/Makefile.fpc svneol=native#text/plain
 packages/libndsfpc/examples/graphics/3D/nehe/lesson10/data/Mud.pcx -text
 packages/libndsfpc/examples/graphics/3D/nehe/lesson10/data/World.txt svneol=native#text/plain
+packages/libndsfpc/examples/graphics/3D/nehe/lesson10/data/drunkenlogo.pcx -text
 packages/libndsfpc/examples/graphics/3D/nehe/lesson10/lesson10.pp svneol=native#text/plain
 packages/libndsfpc/examples/graphics/3D/nehe/lesson10b/Makefile svneol=native#text/plain
 packages/libndsfpc/examples/graphics/3D/nehe/lesson10b/Makefile.fpc svneol=native#text/plain
@@ -4288,6 +4286,17 @@ packages/libndsfpc/examples/input/keyboard/keyboard_async/keyboardAsync.pp svneo
 packages/libndsfpc/examples/input/keyboard/keyboard_stdin/Makefile svneol=native#text/plain
 packages/libndsfpc/examples/input/keyboard/keyboard_stdin/Makefile.fpc svneol=native#text/plain
 packages/libndsfpc/examples/input/keyboard/keyboard_stdin/keyboardStdin.pp svneol=native#text/plain
+packages/libndsfpc/examples/time/Makefile svneol=native#text/plain
+packages/libndsfpc/examples/time/Makefile.fpc svneol=native#text/plain
+packages/libndsfpc/examples/time/RealTimeClock/Makefile svneol=native#text/plain
+packages/libndsfpc/examples/time/RealTimeClock/Makefile.fpc svneol=native#text/plain
+packages/libndsfpc/examples/time/RealTimeClock/realtimeclock.pp svneol=native#text/plain
+packages/libndsfpc/examples/time/stopwatch/Makefile svneol=native#text/plain
+packages/libndsfpc/examples/time/stopwatch/Makefile.fpc svneol=native#text/plain
+packages/libndsfpc/examples/time/stopwatch/stopwatch.pp svneol=native#text/plain
+packages/libndsfpc/examples/time/timercallback/Makefile svneol=native#text/plain
+packages/libndsfpc/examples/time/timercallback/Makefile.fpc svneol=native#text/plain
+packages/libndsfpc/examples/time/timercallback/timercallback.pp svneol=native#text/plain
 packages/libndsfpc/fpmake.pp svneol=native#text/plain
 packages/libndsfpc/src/dswifi/dswifi7.pp svneol=native#text/plain
 packages/libndsfpc/src/dswifi/dswifi9.pp svneol=native#text/plain
@@ -4315,7 +4324,9 @@ packages/libndsfpc/src/maxmod/maxmod7.pp svneol=native#text/plain
 packages/libndsfpc/src/maxmod/maxmod9.pp svneol=native#text/plain
 packages/libndsfpc/src/nds/arm7/audio.inc svneol=native#text/plain
 packages/libndsfpc/src/nds/arm7/clock.inc svneol=native#text/plain
+packages/libndsfpc/src/nds/arm7/i2c.inc svneol=native#text/plain
 packages/libndsfpc/src/nds/arm7/input.inc svneol=native#text/plain
+packages/libndsfpc/src/nds/arm7/sdmmc.inc svneol=native#text/plain
 packages/libndsfpc/src/nds/arm7/serial.inc svneol=native#text/plain
 packages/libndsfpc/src/nds/arm7/touch.inc svneol=native#text/plain
 packages/libndsfpc/src/nds/arm9/background.inc svneol=native#text/plain
@@ -4326,13 +4337,16 @@ packages/libndsfpc/src/nds/arm9/decompress.inc svneol=native#text/plain
 packages/libndsfpc/src/nds/arm9/dldi.inc svneol=native#text/plain
 packages/libndsfpc/src/nds/arm9/dynamicArray.inc svneol=native#text/plain
 packages/libndsfpc/src/nds/arm9/exceptions.inc svneol=native#text/plain
+packages/libndsfpc/src/nds/arm9/guitarGrip.inc svneol=native#text/plain
 packages/libndsfpc/src/nds/arm9/image.inc svneol=native#text/plain
 packages/libndsfpc/src/nds/arm9/input.inc svneol=native#text/plain
 packages/libndsfpc/src/nds/arm9/keyboard.inc svneol=native#text/plain
 packages/libndsfpc/src/nds/arm9/linkedlist.inc svneol=native#text/plain
 packages/libndsfpc/src/nds/arm9/math.inc svneol=native#text/plain
 packages/libndsfpc/src/nds/arm9/ndsmotion.inc svneol=native#text/plain
+packages/libndsfpc/src/nds/arm9/paddle.inc svneol=native#text/plain
 packages/libndsfpc/src/nds/arm9/pcx.inc svneol=native#text/plain
+packages/libndsfpc/src/nds/arm9/piano.inc svneol=native#text/plain
 packages/libndsfpc/src/nds/arm9/postest.inc svneol=native#text/plain
 packages/libndsfpc/src/nds/arm9/rumble.inc svneol=native#text/plain
 packages/libndsfpc/src/nds/arm9/sassert.inc svneol=native#text/plain
@@ -7154,6 +7168,7 @@ rtl/netware/dos.pp svneol=native#text/plain
 rtl/netware/dplsv386.imp -text
 rtl/netware/dsapi.imp -text
 rtl/netware/dsevent.imp -text
+rtl/netware/dynlibs.inc svneol=native#text/plain
 rtl/netware/errno.inc svneol=native#text/plain
 rtl/netware/initc.pp svneol=native#text/plain
 rtl/netware/keyboard.pp svneol=native#text/plain
@@ -7636,6 +7651,24 @@ rtl/watcom/system.pp svneol=native#text/plain
 rtl/watcom/sysutils.pp svneol=native#text/plain
 rtl/watcom/varutils.pp svneol=native#text/plain
 rtl/watcom/watcom.pp svneol=native#text/plain
+rtl/wii/Makefile svneol=native#text/plain
+rtl/wii/Makefile.fpc svneol=native#text/plain
+rtl/wii/classes.pp svneol=native#text/plain
+rtl/wii/dos.pp svneol=native#text/plain
+rtl/wii/libc.inc svneol=native#text/plain
+rtl/wii/libch.inc svneol=native#text/plain
+rtl/wii/sysdir.inc svneol=native#text/plain
+rtl/wii/sysfile.inc svneol=native#text/plain
+rtl/wii/sysheap.inc svneol=native#text/plain
+rtl/wii/sysos.inc svneol=native#text/plain
+rtl/wii/sysosh.inc svneol=native#text/plain
+rtl/wii/system.pp svneol=native#text/plain
+rtl/wii/systhrd.inc svneol=native#text/plain
+rtl/wii/sysutils.pp svneol=native#text/plain
+rtl/wii/tthread.inc svneol=native#text/plain
+rtl/wii/varutils.pp svneol=native#text/plain
+rtl/wii/wii.inc svneol=native#text/plain
+rtl/wii/wiih.inc svneol=native#text/plain
 rtl/win/crt.pp svneol=native#text/plain
 rtl/win/dos.pp svneol=native#text/plain
 rtl/win/dynlibs.inc svneol=native#text/plain
@@ -9383,6 +9416,7 @@ tests/test/tenum2.pp svneol=native#text/plain
 tests/test/tenum3.pp svneol=native#text/plain
 tests/test/tenum4.pp svneol=native#text/plain
 tests/test/tenum5.pp svneol=native#text/plain
+tests/test/tenum6.pp svneol=native#text/pascal
 tests/test/tenumerators1.pp svneol=native#text/pascal
 tests/test/terecs1.pp svneol=native#text/pascal
 tests/test/terecs2.pp svneol=native#text/pascal
@@ -10217,6 +10251,7 @@ tests/webtbf/tw1827.pp svneol=native#text/plain
 tests/webtbf/tw1830.pp svneol=native#text/plain
 tests/webtbf/tw1842.pp svneol=native#text/plain
 tests/webtbf/tw1858.pp svneol=native#text/plain
+tests/webtbf/tw18620.pp svneol=native#text/pascal
 tests/webtbf/tw1905.pp svneol=native#text/plain
 tests/webtbf/tw1927.pp svneol=native#text/plain
 tests/webtbf/tw1928.pp svneol=native#text/plain
@@ -11007,6 +11042,7 @@ tests/webtbs/tw17957.pp svneol=native#text/pascal
 tests/webtbs/tw1798.pp svneol=native#text/plain
 tests/webtbs/tw17986.pp svneol=native#text/pascal
 tests/webtbs/tw17998.pp svneol=native#text/plain
+tests/webtbs/tw18009.pp svneol=native#text/pascal
 tests/webtbs/tw18013.pp svneol=native#text/plain
 tests/webtbs/tw18075.pp svneol=native#text/pascal
 tests/webtbs/tw18082.pp svneol=native#text/plain
@@ -11021,6 +11057,7 @@ tests/webtbs/tw18222.pp svneol=native#text/pascal
 tests/webtbs/tw1825.pp svneol=native#text/plain
 tests/webtbs/tw18266.pp svneol=native#text/plain
 tests/webtbs/tw18334.pp svneol=native#text/plain
+tests/webtbs/tw18420.pp svneol=native#text/pascal
 tests/webtbs/tw18443.pp svneol=native#text/pascal
 tests/webtbs/tw1850.pp svneol=native#text/plain
 tests/webtbs/tw1851.pp svneol=native#text/plain
@@ -11029,8 +11066,10 @@ tests/webtbs/tw1856.pp svneol=native#text/plain
 tests/webtbs/tw18567 svneol=native#text/pascal
 tests/webtbs/tw18610.pp svneol=native#text/pascal
 tests/webtbs/tw1862.pp svneol=native#text/plain
+tests/webtbs/tw18620.pp svneol=native#text/pascal
 tests/webtbs/tw1863.pp svneol=native#text/plain
 tests/webtbs/tw1867.pp svneol=native#text/plain
+tests/webtbs/tw18690.pp svneol=native#text/plain
 tests/webtbs/tw1873.pp svneol=native#text/plain
 tests/webtbs/tw1883.pp svneol=native#text/plain
 tests/webtbs/tw1888.pp svneol=native#text/plain
@@ -12167,9 +12206,6 @@ utils/h2pas/scan.pas svneol=native#text/plain
 utils/h2pas/testit.h -text
 utils/h2pas/yylex.cod -text
 utils/h2pas/yyparse.cod -text
-utils/kalyptus/kalyptus -text
-utils/kalyptus/kalyptusCxxToPas.pm -text
-utils/kalyptus/kalyptusDataDict.pm -text
 utils/mksymbian/Makefile svneol=native#text/plain
 utils/mksymbian/Makefile.fpc svneol=native#text/plain
 utils/mksymbian/cfgfile.pas svneol=native#text/plain

+ 52 - 26
.gitignore

@@ -3074,30 +3074,13 @@ packages/libndsfpc/*.ppu
 packages/libndsfpc/*.s
 packages/libndsfpc/Package.fpc
 packages/libndsfpc/build-stamp.*
+packages/libndsfpc/build_docs.bat
 packages/libndsfpc/examples/*.bak
 packages/libndsfpc/examples/*.exe
 packages/libndsfpc/examples/*.o
 packages/libndsfpc/examples/*.ppu
 packages/libndsfpc/examples/*.s
 packages/libndsfpc/examples/Package.fpc
-packages/libndsfpc/examples/RealTimeClock/*.bak
-packages/libndsfpc/examples/RealTimeClock/*.exe
-packages/libndsfpc/examples/RealTimeClock/*.o
-packages/libndsfpc/examples/RealTimeClock/*.ppu
-packages/libndsfpc/examples/RealTimeClock/*.s
-packages/libndsfpc/examples/RealTimeClock/Package.fpc
-packages/libndsfpc/examples/RealTimeClock/Watch/*.bak
-packages/libndsfpc/examples/RealTimeClock/Watch/*.exe
-packages/libndsfpc/examples/RealTimeClock/Watch/*.o
-packages/libndsfpc/examples/RealTimeClock/Watch/*.ppu
-packages/libndsfpc/examples/RealTimeClock/Watch/*.s
-packages/libndsfpc/examples/RealTimeClock/Watch/Package.fpc
-packages/libndsfpc/examples/RealTimeClock/Watch/build-stamp.*
-packages/libndsfpc/examples/RealTimeClock/Watch/fpcmade.*
-packages/libndsfpc/examples/RealTimeClock/Watch/units
-packages/libndsfpc/examples/RealTimeClock/build-stamp.*
-packages/libndsfpc/examples/RealTimeClock/fpcmade.*
-packages/libndsfpc/examples/RealTimeClock/units
 packages/libndsfpc/examples/audio/*.bak
 packages/libndsfpc/examples/audio/*.exe
 packages/libndsfpc/examples/audio/*.o
@@ -4119,8 +4102,51 @@ packages/libndsfpc/examples/input/keyboard/keyboard_stdin/fpcmade.*
 packages/libndsfpc/examples/input/keyboard/keyboard_stdin/units
 packages/libndsfpc/examples/input/keyboard/units
 packages/libndsfpc/examples/input/units
+packages/libndsfpc/examples/time/*.bak
+packages/libndsfpc/examples/time/*.exe
+packages/libndsfpc/examples/time/*.o
+packages/libndsfpc/examples/time/*.ppu
+packages/libndsfpc/examples/time/*.s
+packages/libndsfpc/examples/time/Package.fpc
+packages/libndsfpc/examples/time/RealTimeClock/*.bak
+packages/libndsfpc/examples/time/RealTimeClock/*.exe
+packages/libndsfpc/examples/time/RealTimeClock/*.o
+packages/libndsfpc/examples/time/RealTimeClock/*.ppu
+packages/libndsfpc/examples/time/RealTimeClock/*.s
+packages/libndsfpc/examples/time/RealTimeClock/Package.fpc
+packages/libndsfpc/examples/time/RealTimeClock/build-stamp.*
+packages/libndsfpc/examples/time/RealTimeClock/fpcmade.*
+packages/libndsfpc/examples/time/RealTimeClock/units
+packages/libndsfpc/examples/time/build-stamp.*
+packages/libndsfpc/examples/time/fpcmade.*
+packages/libndsfpc/examples/time/stopwatch/*.bak
+packages/libndsfpc/examples/time/stopwatch/*.exe
+packages/libndsfpc/examples/time/stopwatch/*.o
+packages/libndsfpc/examples/time/stopwatch/*.ppu
+packages/libndsfpc/examples/time/stopwatch/*.s
+packages/libndsfpc/examples/time/stopwatch/Package.fpc
+packages/libndsfpc/examples/time/stopwatch/build-stamp.*
+packages/libndsfpc/examples/time/stopwatch/fpcmade.*
+packages/libndsfpc/examples/time/stopwatch/units
+packages/libndsfpc/examples/time/timercallback/*.bak
+packages/libndsfpc/examples/time/timercallback/*.exe
+packages/libndsfpc/examples/time/timercallback/*.o
+packages/libndsfpc/examples/time/timercallback/*.ppu
+packages/libndsfpc/examples/time/timercallback/*.s
+packages/libndsfpc/examples/time/timercallback/Package.fpc
+packages/libndsfpc/examples/time/timercallback/build-stamp.*
+packages/libndsfpc/examples/time/timercallback/fpcmade.*
+packages/libndsfpc/examples/time/timercallback/units
+packages/libndsfpc/examples/time/units
 packages/libndsfpc/examples/units
 packages/libndsfpc/fpcmade.*
+packages/libndsfpc/fpdoc.css
+packages/libndsfpc/ndsDoc[!!-~]-[!!-~]Copia.xml
+packages/libndsfpc/ndsDoc.blg
+packages/libndsfpc/ndsDoc.chm
+packages/libndsfpc/ndsDoc.new.xml
+packages/libndsfpc/ndsDoc.xml
+packages/libndsfpc/ndsDoc.~xml
 packages/libndsfpc/src/*.bak
 packages/libndsfpc/src/*.exe
 packages/libndsfpc/src/*.o
@@ -6584,6 +6610,7 @@ rtl/nativent/fpcmade.*
 rtl/nativent/units
 rtl/nds/backup
 rtl/nds/parcheggio
+rtl/nds_new
 rtl/netbsd/*.bak
 rtl/netbsd/*.exe
 rtl/netbsd/*.o
@@ -6840,6 +6867,13 @@ rtl/watcom/*.ppu
 rtl/watcom/*.s
 rtl/watcom/fpcmade.*
 rtl/watcom/units
+rtl/wii/*.bak
+rtl/wii/*.exe
+rtl/wii/*.o
+rtl/wii/*.ppu
+rtl/wii/*.s
+rtl/wii/fpcmade.*
+rtl/wii/units
 rtl/win/*.bak
 rtl/win/*.exe
 rtl/win/*.o
@@ -7744,14 +7778,6 @@ utils/h2pas/*.s
 utils/h2pas/Package.fpc
 utils/h2pas/fpcmade.*
 utils/h2pas/units
-utils/kalyptus/*.bak
-utils/kalyptus/*.exe
-utils/kalyptus/*.o
-utils/kalyptus/*.ppu
-utils/kalyptus/*.s
-utils/kalyptus/Package.fpc
-utils/kalyptus/fpcmade.*
-utils/kalyptus/units
 utils/mksymbian/*.bak
 utils/mksymbian/*.exe
 utils/mksymbian/*.o

+ 3 - 3
compiler/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2010/09/29]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2010/10/20]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
@@ -3439,11 +3439,11 @@ ppuclean:
 tempclean:
 	-$(DEL) $(PPCROSSNAME) $(TEMPNAME) $(TEMPNAME1) $(TEMPNAME2) $(TEMPNAME3) $(MSG2INC) pp1.wpo pp2.wpo
 execlean :
-	-$(DEL) ppc386$(EXEEXT) ppcaxp$(EXEEXT) ppc68k$(EXEEXT) ppcx64$(EXEEXT) ppcppc$(EXEEXT) ppcsparc$(EXEEXT) $(EXENAME) $(TEMPWPONAME1) $(TEMPWPONAME2)
+	-$(DEL) ppc386$(EXEEXT) ppc68k$(EXEEXT) ppcx64$(EXEEXT) ppcppc$(EXEEXT) ppcsparc$(EXEEXT) ppcppc64$(EXEEXT) ppcarm$(EXEEXT) ppcmips$(EXEEXT) ppcmipsel$(EXEEXT) $(EXENAME) $(TEMPWPONAME1) $(TEMPWPONAME2)
 $(addsuffix _clean,$(ALLTARGETS)):
 	-$(DELTREE) $(addprefix $(subst _clean,,$@),/units)
 	-$(DEL) $(addprefix $(subst _clean,,$@)/,*$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT))
-	-$(DEL) $(addprefix $(subst _clean,,$@)/,ppc386$(EXEEXT) ppcaxp$(EXEEXT) ppc68k$(EXEEXT) ppcx64$(EXEEXT) ppcppc$(EXEEXT) ppcppc$(EXEEXT) $(EXENAME))
+	-$(DEL) $(addprefix $(subst _clean,,$@)/,ppc386$(EXEEXT) ppc68k$(EXEEXT) ppcx64$(EXEEXT) ppcppc$(EXEEXT) ppcsparc$(EXEEXT) ppcppc64$(EXEEXT) ppcarm$(EXEEXT) ppcmips$(EXEEXT) ppcmipsel$(EXEEXT) $(EXENAME))
 cycleclean: cleanall $(addsuffix _clean,$(CPC_TARGET))
 	-$(DEL) $(EXENAME)
 clean: tempclean execlean cleanall $(addsuffix _clean,$(CPC_TARGET)) $(addsuffix _clean,$(TARGET_DIRS))

+ 2 - 2
compiler/Makefile.fpc

@@ -365,12 +365,12 @@ tempclean:
         -$(DEL) $(PPCROSSNAME) $(TEMPNAME) $(TEMPNAME1) $(TEMPNAME2) $(TEMPNAME3) $(MSG2INC) pp1.wpo pp2.wpo
 
 execlean :
-        -$(DEL) ppc386$(EXEEXT) ppcaxp$(EXEEXT) ppc68k$(EXEEXT) ppcx64$(EXEEXT) ppcppc$(EXEEXT) ppcsparc$(EXEEXT) $(EXENAME) $(TEMPWPONAME1) $(TEMPWPONAME2)
+        -$(DEL) ppc386$(EXEEXT) ppc68k$(EXEEXT) ppcx64$(EXEEXT) ppcppc$(EXEEXT) ppcsparc$(EXEEXT) ppcppc64$(EXEEXT) ppcarm$(EXEEXT) ppcmips$(EXEEXT) ppcmipsel$(EXEEXT) $(EXENAME) $(TEMPWPONAME1) $(TEMPWPONAME2)
 
 $(addsuffix _clean,$(ALLTARGETS)):
         -$(DELTREE) $(addprefix $(subst _clean,,$@),/units)
         -$(DEL) $(addprefix $(subst _clean,,$@)/,*$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT))
-        -$(DEL) $(addprefix $(subst _clean,,$@)/,ppc386$(EXEEXT) ppcaxp$(EXEEXT) ppc68k$(EXEEXT) ppcx64$(EXEEXT) ppcppc$(EXEEXT) ppcppc$(EXEEXT) $(EXENAME))
+        -$(DEL) $(addprefix $(subst _clean,,$@)/,ppc386$(EXEEXT) ppc68k$(EXEEXT) ppcx64$(EXEEXT) ppcppc$(EXEEXT) ppcsparc$(EXEEXT) ppcppc64$(EXEEXT) ppcarm$(EXEEXT) ppcmips$(EXEEXT) ppcmipsel$(EXEEXT) $(EXENAME))
 
 cycleclean: cleanall $(addsuffix _clean,$(CPC_TARGET))
         -$(DEL) $(EXENAME)

+ 3 - 0
compiler/compiler.pas

@@ -104,6 +104,9 @@ uses
 {$ifdef wdosx}
   ,i_wdosx
 {$endif wdosx}
+{$ifdef wii}
+  ,i_wii
+{$endif wii}
 {$ifdef win32}
   ,i_win
 {$endif win32}

+ 8 - 4
compiler/defcmp.pas

@@ -156,8 +156,8 @@ implementation
            uvoid,
            u8bit,u16bit,u32bit,u64bit,
            s8bit,s16bit,s32bit,s64bit,
-           bool8bit,bool16bit,bool32bit,bool64bit,
-           uchar,uwidechar }
+           pasbool, bool8bit,bool16bit,bool32bit,bool64bit,
+           uchar,uwidechar,scurrency }
 
       type
         tbasedef=(bvoid,bchar,bint,bbool);
@@ -886,7 +886,9 @@ implementation
                        end;
                      objectdef :
                        begin
-                          if is_interface(def_from) then
+                         { corbainterfaces not accepted, until we have
+                           runtime support for them in Variants (sergei) }
+                          if is_interfacecom_or_dispinterface(def_from) then
                             begin
                                doconv:=tc_interface_2_variant;
                                eq:=te_convert_l1;
@@ -1328,8 +1330,10 @@ implementation
                        eq:=te_convert_l1;
                        doconv:=tc_equal;
                      end
-                   else if (def_from.typ=variantdef) and is_interface(def_to) then
+                   else if (def_from.typ=variantdef) and is_interfacecom_or_dispinterface(def_to) then
                      begin
+                     { corbainterfaces not accepted, until we have
+                       runtime support for them in Variants (sergei) }
                        doconv:=tc_variant_2_interface;
                        eq:=te_convert_l2;
                      end

+ 2 - 3
compiler/i386/ag386nsm.pas

@@ -391,8 +391,7 @@ interface
                   if o.ref^.offset>0 then
                    asmwrite('+');
                   asmwrite(tostr(o.ref^.offset));
-
-                  end;
+                end;
             end;
           else
             internalerror(10001);
@@ -1183,7 +1182,7 @@ interface
             labelprefix : '..@';
             comment : '; ';
           );
-          
+
        as_i386_nasmhaiku_info : tasminfo =
           (
             id           : as_i386_nasmhaiku;

+ 19 - 23
compiler/ncal.pas

@@ -298,7 +298,6 @@ implementation
         calldescnode : tdataconstnode;
         resultvalue : tnode;
         para : tcallparanode;
-        currargpos,
         namedparacount,
         paracount : longint;
         assignmenttype,
@@ -308,7 +307,6 @@ implementation
         restype: byte;
 
         names : ansistring;
-        dispintfinvoke,
         variantdispatch : boolean;
 
       function is_byref_para(out assign_type: tdef): boolean;
@@ -337,7 +335,7 @@ implementation
           if is_unicodestring(sourcedef) then
             result:=varUStrArg
           else
-          if is_interface(sourcedef) then
+          if is_interfacecom_or_dispinterface(sourcedef) then
             begin
               { distinct IDispatch and IUnknown interfaces }
               if tobjectdef(sourcedef).is_related(tobjectdef(search_system_type('IDISPATCH').typedef)) then
@@ -351,8 +349,6 @@ implementation
 
       begin
         variantdispatch:=selfnode.resultdef.typ=variantdef;
-        dispintfinvoke:=not(variantdispatch);
-
         result:=internalstatements(statements);
 
         useresult := assigned(resultdef) and not is_void(resultdef);
@@ -367,17 +363,17 @@ implementation
         para:=tcallparanode(parametersnode);
         paracount:=0;
         namedparacount:=0;
-        paramssize:=0;
         while assigned(para) do
           begin
             typecheckpass(para.left);
 
-            { skip non parameters }
-            if para.left.nodetype=nothingn then
-            begin
-              para:=tcallparanode(para.nextpara);
-              continue;
-            end;
+            { skip hidden dispinterface parameters like $self, $result,
+              but count skipped variantdispatch parameters. }
+            if (not variantdispatch) and (para.left.nodetype=nothingn) then
+              begin
+                para:=tcallparanode(para.nextpara);
+                continue;
+              end;
             inc(paracount);
             if assigned(para.parametername) then
               inc(namedparacount);
@@ -399,23 +395,19 @@ implementation
               inserttypeconv_internal(para.left,cwidestringtype)
 
             { skip this check if we've already typecasted to automatable type }
-            else if not is_automatable(para.left.resultdef) then
+            else if (para.left.nodetype<>nothingn) and (not is_automatable(para.left.resultdef)) then
               CGMessagePos1(para.left.fileinfo,type_e_not_automatable,para.left.resultdef.typename);
 
-            { we've to know the parameter size to allocate the temp. space }
-            is_byref_para(assignmenttype);
-            inc(paramssize,max(voidpointertype.size,assignmenttype.size));
-
             para:=tcallparanode(para.nextpara);
           end;
 
-        { allocate space }
-        params:=ctempcreatenode.create(voidtype,paramssize,tt_persistent,true);
+        { create a temp to store parameter values }
+        params:=ctempcreatenode.create(voidtype,0,tt_persistent,true);
         addstatement(statements,params);
 
         calldescnode:=cdataconstnode.create;
 
-        if dispintfinvoke then
+        if not variantdispatch then  { generate a tdispdesc record }
         begin
           { dispid  }
           calldescnode.append(dispid,sizeof(dispid));
@@ -433,14 +425,16 @@ implementation
 
         { build up parameters and description }
         para:=tcallparanode(parametersnode);
-        currargpos:=0;
         paramssize:=0;
         names := '';
         while assigned(para) do
           begin
-            { skip non parameters }
+            { Skipped parameters are actually (varType=varError, vError=DISP_E_PARAMNOTFOUND).
+              Generate only varType here, the value will be added by RTL. }
             if para.left.nodetype=nothingn then
             begin
+              if variantdispatch then
+                calldescnode.appendbyte(varError);
               para:=tcallparanode(para.nextpara);
               continue;
             end;
@@ -482,10 +476,12 @@ implementation
             calldescnode.appendbyte(restype);
 
             para.left:=nil;
-            inc(currargpos);
             para:=tcallparanode(para.nextpara);
           end;
 
+        { Set final size for parameter block }
+        params.size:=paramssize;
+
         { old argument list skeleton isn't needed anymore }
         parametersnode.free;
 

+ 8 - 4
compiler/ncgcal.pas

@@ -379,12 +379,15 @@ implementation
 
             case location.loc of
               LOC_REGISTER :
+                begin
 {$ifndef cpu64bitalu}
-                if location.size in [OS_64,OS_S64] then
-                  cg64.a_load64_reg_loc(current_asmdata.CurrAsmList,location.register64,funcretnode.location)
-                else
+                  if location.size in [OS_64,OS_S64] then
+                    cg64.a_load64_reg_loc(current_asmdata.CurrAsmList,location.register64,funcretnode.location)
+                  else
 {$endif}
-                  cg.a_load_reg_loc(current_asmdata.CurrAsmList,location.size,location.register,funcretnode.location);
+                    cg.a_load_reg_loc(current_asmdata.CurrAsmList,location.size,location.register,funcretnode.location);
+                  location_free(current_asmdata.CurrAsmList,location);
+                end;
               LOC_REFERENCE:
                 begin
                   case funcretnode.location.loc of
@@ -395,6 +398,7 @@ implementation
                     else
                       internalerror(200802121);
                   end;
+                  location_freetemp(current_asmdata.CurrAsmList,location);
                 end;
               else
                 internalerror(200709085);

+ 28 - 21
compiler/ncgld.pas

@@ -974,26 +974,27 @@ implementation
 *****************************************************************************}
 
       const
-        vtInteger    = 0;
-        vtBoolean    = 1;
-        vtChar       = 2;
-        vtExtended   = 3;
-        vtString     = 4;
-        vtPointer    = 5;
-        vtPChar      = 6;
-        vtObject     = 7;
-        vtClass      = 8;
-        vtWideChar   = 9;
-        vtPWideChar  = 10;
-        vtAnsiString32 = 11;
-        vtCurrency   = 12;
-        vtVariant    = 13;
-        vtInterface  = 14;
-        vtWideString = 15;
-        vtInt64      = 16;
-        vtQWord      = 17;
-        vtAnsiString16 = 18;
-        vtAnsiString64 = 19;
+        vtInteger       = 0;
+        vtBoolean       = 1;
+        vtChar          = 2;
+        vtExtended      = 3;
+        vtString        = 4;
+        vtPointer       = 5;
+        vtPChar         = 6;
+        vtObject        = 7;
+        vtClass         = 8;
+        vtWideChar      = 9;
+        vtPWideChar     = 10;
+        vtAnsiString32  = 11;
+        vtCurrency      = 12;
+        vtVariant       = 13;
+        vtInterface     = 14;
+        vtWideString    = 15;
+        vtInt64         = 16;
+        vtQWord         = 17;
+        vtUnicodeString = 18;
+        vtAnsiString16  = 19;
+        vtAnsiString64  = 20;
 
     procedure tcgarrayconstructornode.pass_generate_code;
       var
@@ -1151,10 +1152,16 @@ implementation
                            freetemp:=false;
                          end
                        else
-                        if is_widestring(lt) or is_unicodestring(lt) then
+                        if is_widestring(lt) then
                          begin
                            vtype:=vtWideString;
                            freetemp:=false;
+                         end
+                       else
+                        if is_unicodestring(lt) then
+                         begin
+                           vtype:=vtUnicodeString;
+                           freetemp:=false;
                          end;
                      end;
                  end;

+ 85 - 155
compiler/ncnv.pas

@@ -187,8 +187,14 @@ interface
           procedure second_nothing; virtual;abstract;
        end;
        ttypeconvnodeclass = class of ttypeconvnode;
+       
+       { common functionality of as-nodes and is-nodes }
+       tasisnode = class(tbinarynode)
+         public
+          function pass_typecheck:tnode;override;
+       end;
 
-       tasnode = class(tbinarynode)
+       tasnode = class(tasisnode)
           { as nodes cannot be translated directly into call nodes bcause:
 
             When using -CR, explicit class typecasts are replaced with as-nodes to perform
@@ -203,17 +209,15 @@ interface
           call: tnode;
           constructor create(l,r : tnode);virtual;
           function pass_1 : tnode;override;
-          function pass_typecheck:tnode;override;
           function dogetcopy: tnode;override;
           function docompare(p: tnode): boolean; override;
           destructor destroy; override;
        end;
        tasnodeclass = class of tasnode;
 
-       tisnode = class(tbinarynode)
+       tisnode = class(tasisnode)
           constructor create(l,r : tnode);virtual;
           function pass_1 : tnode;override;
-          function pass_typecheck:tnode;override;
           procedure pass_generate_code;override;
        end;
        tisnodeclass = class of tisnode;
@@ -3303,101 +3307,111 @@ implementation
          tprocedureofobject(r)();
       end;
 
-
 {*****************************************************************************
-                                TISNODE
+                                TASNODE
 *****************************************************************************}
 
-    constructor tisnode.create(l,r : tnode);
-
-      begin
-         inherited create(isn,l,r);
-      end;
-
-
-    function tisnode.pass_typecheck:tnode;
+    function tasisnode.pass_typecheck: tnode;
       var
         hp : tnode;
       begin
-         result:=nil;
-         typecheckpass(right);
-         typecheckpass(left);
+        result:=nil;
+        typecheckpass(right);
+        typecheckpass(left);
 
-         set_varstate(right,vs_read,[vsf_must_be_valid]);
-         set_varstate(left,vs_read,[vsf_must_be_valid]);
+        set_varstate(right,vs_read,[vsf_must_be_valid]);
+        set_varstate(left,vs_read,[vsf_must_be_valid]);
 
-         if codegenerror then
-           exit;
+        if codegenerror then
+          exit;
 
-         if (right.resultdef.typ=classrefdef) then
+        if (right.resultdef.typ=classrefdef) then
           begin
             { left maybe an interface reference }
             if is_interfacecom(left.resultdef) then
-             begin
-               { relation checks are not possible }
-             end
-            else
-
+              begin
+                { relation checks are not possible }
+              end
             { or left must be a class }
-            if is_class(left.resultdef) then
-             begin
-               { the operands must be related }
-               if (not(tobjectdef(left.resultdef).is_related(
-                  tobjectdef(tclassrefdef(right.resultdef).pointeddef)))) and
-                  (not(tobjectdef(tclassrefdef(right.resultdef).pointeddef).is_related(
-                  tobjectdef(left.resultdef)))) then
-                 CGMessage2(type_e_classes_not_related,
-                    FullTypeName(left.resultdef,tclassrefdef(right.resultdef).pointeddef),
-                    FullTypeName(tclassrefdef(right.resultdef).pointeddef,left.resultdef));
-             end
+            else if is_class(left.resultdef) then
+              begin
+                { the operands must be related }
+                if (not(tobjectdef(left.resultdef).is_related(
+                   tobjectdef(tclassrefdef(right.resultdef).pointeddef)))) and
+                   (not(tobjectdef(tclassrefdef(right.resultdef).pointeddef).is_related(
+                   tobjectdef(left.resultdef)))) then
+                  CGMessage2(type_e_classes_not_related,
+                     FullTypeName(left.resultdef,tclassrefdef(right.resultdef).pointeddef),
+                     FullTypeName(tclassrefdef(right.resultdef).pointeddef,left.resultdef));
+              end
             else
-             CGMessage1(type_e_class_or_cominterface_type_expected,left.resultdef.typename);
-            resultdef:=booltype;
+              CGMessage1(type_e_class_or_cominterface_type_expected,left.resultdef.typename);
+            case nodetype of
+              isn:
+                resultdef:=booltype;
+              asn:
+                resultdef:=tclassrefdef(right.resultdef).pointeddef;
+            end;
           end
-         else if is_interface(right.resultdef) or is_dispinterface(right.resultdef) then
+        else if is_interface(right.resultdef) or is_dispinterface(right.resultdef) then
           begin
             { left is a class }
             if not(is_class(left.resultdef) or
                    is_interfacecom(left.resultdef)) then
               CGMessage1(type_e_class_or_cominterface_type_expected,left.resultdef.typename);
 
-            resultdef:=booltype;
+            case nodetype of
+              isn:
+                resultdef:=booltype;
+              asn:
+                resultdef:=right.resultdef;
+            end;
 
             { load the GUID of the interface }
             if (right.nodetype=typen) then
-             begin
-               if tobjectdef(right.resultdef).objecttype=odt_interfacecorba then
-                 begin
-                   if assigned(tobjectdef(right.resultdef).iidstr) then
-                     begin
-                       hp:=cstringconstnode.createstr(tobjectdef(right.resultdef).iidstr^);
-                       tstringconstnode(hp).changestringtype(cshortstringtype);
-                       right.free;
-                       right:=hp;
-                     end
-                   else
-                     internalerror(201006131);
-                 end
-               else
-                 begin
-                   if assigned(tobjectdef(right.resultdef).iidguid) then
-                     begin
-                       if not(oo_has_valid_guid in tobjectdef(right.resultdef).objectoptions) then
-                         CGMessage1(type_interface_has_no_guid,tobjectdef(right.resultdef).typename);
-                       hp:=cguidconstnode.create(tobjectdef(right.resultdef).iidguid^);
-                       right.free;
-                       right:=hp;
-                     end
-                   else
-                     internalerror(201006132);
-                 end;
-               typecheckpass(right);
-             end;
+              begin
+                if tobjectdef(right.resultdef).objecttype=odt_interfacecorba then
+                  begin
+                    if assigned(tobjectdef(right.resultdef).iidstr) then
+                      begin
+                        hp:=cstringconstnode.createstr(tobjectdef(right.resultdef).iidstr^);
+                        tstringconstnode(hp).changestringtype(cshortstringtype);
+                        right.free;
+                        right:=hp;
+                      end
+                    else
+                      internalerror(201006131);
+                  end
+                else
+                  begin
+                    if assigned(tobjectdef(right.resultdef).iidguid) then
+                      begin
+                        if not(oo_has_valid_guid in tobjectdef(right.resultdef).objectoptions) then
+                          CGMessage1(type_interface_has_no_guid,tobjectdef(right.resultdef).typename);
+                        hp:=cguidconstnode.create(tobjectdef(right.resultdef).iidguid^);
+                        right.free;
+                        right:=hp;
+                      end
+                    else
+                      internalerror(201006132);
+                  end;
+                typecheckpass(right);
+              end;
           end
-         else
+        else
           CGMessage1(type_e_class_or_interface_type_expected,right.resultdef.typename);
       end;
 
+{*****************************************************************************
+                                TISNODE
+*****************************************************************************}
+
+    constructor tisnode.create(l,r : tnode);
+
+      begin
+         inherited create(isn,l,r);
+      end;
+
     function tisnode.pass_1 : tnode;
       var
         procname: string;
@@ -3462,90 +3476,6 @@ implementation
       end;
 
 
-    function tasnode.pass_typecheck:tnode;
-      var
-        hp : tnode;
-      begin
-         result:=nil;
-         typecheckpass(right);
-         typecheckpass(left);
-
-         set_varstate(right,vs_read,[vsf_must_be_valid]);
-         set_varstate(left,vs_read,[vsf_must_be_valid]);
-
-         if codegenerror then
-           exit;
-
-         if (right.resultdef.typ=classrefdef) then
-          begin
-            { left maybe an interface reference }
-            if is_interfacecom(left.resultdef) then
-             begin
-               { relation checks are not possible }
-             end
-            else
-
-            { or left must be a class }
-            if is_class(left.resultdef) then
-             begin
-               { the operands must be related }
-               if (not(tobjectdef(left.resultdef).is_related(
-                  tobjectdef(tclassrefdef(right.resultdef).pointeddef)))) and
-                  (not(tobjectdef(tclassrefdef(right.resultdef).pointeddef).is_related(
-                  tobjectdef(left.resultdef)))) then
-                 CGMessage2(type_e_classes_not_related,
-                    FullTypeName(left.resultdef,tclassrefdef(right.resultdef).pointeddef),
-                    FullTypeName(tclassrefdef(right.resultdef).pointeddef,left.resultdef));
-             end
-            else
-             CGMessage1(type_e_class_or_cominterface_type_expected,left.resultdef.typename);
-            resultdef:=tclassrefdef(right.resultdef).pointeddef;
-          end
-         else if is_interface(right.resultdef) or is_dispinterface(right.resultdef) then
-          begin
-            { left is a class }
-            if not(is_class(left.resultdef) or
-                   is_interfacecom(left.resultdef)) then
-              CGMessage1(type_e_class_or_cominterface_type_expected,left.resultdef.typename);
-
-            resultdef:=right.resultdef;
-
-            { load the GUID of the interface }
-            if (right.nodetype=typen) then
-             begin
-               if tobjectdef(right.resultdef).objecttype=odt_interfacecorba then
-                 begin
-                   if assigned(tobjectdef(right.resultdef).iidstr) then
-                     begin
-                       hp:=cstringconstnode.createstr(tobjectdef(right.resultdef).iidstr^);
-                       tstringconstnode(hp).changestringtype(cshortstringtype);
-                       right.free;
-                       right:=hp;
-                     end
-                   else
-                     internalerror(200902081);
-                 end
-               else
-                 begin
-                   if assigned(tobjectdef(right.resultdef).iidguid) then
-                     begin
-                       if not(oo_has_valid_guid in tobjectdef(right.resultdef).objectoptions) then
-                         CGMessage1(type_interface_has_no_guid,tobjectdef(right.resultdef).typename);
-                       hp:=cguidconstnode.create(tobjectdef(right.resultdef).iidguid^);
-                       right.free;
-                       right:=hp;
-                     end
-                   else
-                     internalerror(200206282);
-                 end;
-               typecheckpass(right);
-             end;
-          end
-         else
-          CGMessage1(type_e_class_or_interface_type_expected,right.resultdef.typename);
-      end;
-
-
     function tasnode.dogetcopy: tnode;
       begin
         result := inherited dogetcopy;

+ 22 - 9
compiler/ninl.pas

@@ -150,15 +150,6 @@ implementation
       begin
         result := cerrornode.create;
 
-        { make sure we got at least two parameters (if we got only one, }
-        { this parameter may not be encapsulated in a callparan)        }
-        if not assigned(left) or
-           (left.nodetype <> callparan) then
-          begin
-            CGMessage1(parser_e_wrong_parameter_size,'Str');
-            exit;
-          end;
-
         { get destination string }
         dest := tcallparanode(left);
 
@@ -176,6 +167,16 @@ implementation
             exit;
           end;
 
+        { in case we are in a generic definition, we cannot
+          do all checks, the parameters might be type parameters }
+        if df_generic in current_procinfo.procdef.defoptions then
+          begin
+            result.Free;
+            result:=nil;
+            resultdef:=voidtype;
+            exit;
+          end;
+
         is_real:=(source.resultdef.typ = floatdef) or is_currency(source.resultdef);
         is_enum:=source.left.resultdef.typ=enumdef;
 
@@ -313,6 +314,8 @@ implementation
             scurrency,
             s64bit:
               procname := procname + 'int64';
+            pasbool,bool8bit,bool16bit,bool32bit,bool64bit:
+              procname := procname + 'bool';
 {$endif}
             else
               procname := procname + 'sint';
@@ -1143,6 +1146,16 @@ implementation
            exit;
          end;
 
+         { in case we are in a generic definition, we cannot
+           do all checks, the parameters might be type parameters }
+         if df_generic in current_procinfo.procdef.defoptions then
+           begin
+             result.Free;
+             result:=nil;
+             resultdef:=voidtype;
+             exit;
+           end;
+
         { reverse parameters for easier processing }
         left := reverseparameters(tcallparanode(left));
 

+ 7 - 3
compiler/optcse.pas

@@ -57,12 +57,12 @@ unit optcse;
       procinfo,
       nbas,nld,ninl,ncal,ncnv,nadd,
       pass_1,
-      symconst,symtype,symdef,
+      symconst,symtype,symdef,symsym,
       defutil,
       optbase;
 
     const
-      cseinvariant : set of tnodetype = [loadn,addn,muln,subn,divn,slashn,modn,andn,orn,xorn,notn,vecn,
+      cseinvariant : set of tnodetype = [addn,muln,subn,divn,slashn,modn,andn,orn,xorn,notn,vecn,
         derefn,equaln,unequaln,ltn,gtn,lten,gten,typeconvn,subscriptn,
         inn,symdifn,shrn,shln,ordconstn,realconstn,unaryminusn,pointerconstn,stringconstn,setconstn,
         isn,asn,starstarn,nothingn,temprefn,loadparentfpn {,callparan}];
@@ -71,7 +71,11 @@ unit optcse;
       begin
         if (n.nodetype in cseinvariant) or
           ((n.nodetype=inlinen) and
-            (tinlinenode(n).inlinenumber in [in_assigned_x])
+           (tinlinenode(n).inlinenumber in [in_assigned_x])
+          ) or
+          ((n.nodetype=loadn) and
+            not((tloadnode(n).symtableentry.typ in [staticvarsym,localvarsym,paravarsym]) and
+                (vo_volatile in tabstractvarsym(tloadnode(n).symtableentry).varoptions))
           ) then
           result:=fen_true
         else

+ 1 - 1
compiler/paramgr.pas

@@ -163,7 +163,7 @@ implementation
            (def.typ=stringdef) or
            ((def.typ=procvardef) and not tprocvardef(def).is_addressonly) or
            { interfaces are also passed by reference to be compatible with delphi and COM }
-           ((def.typ=objectdef) and (is_object(def) or is_interface(def))) or
+           ((def.typ=objectdef) and (is_object(def) or is_interface(def) or is_dispinterface(def))) or
            (def.typ=variantdef) or
            ((def.typ=setdef) and not is_smallset(def));
       end;

+ 19 - 1
compiler/pdecvar.pas

@@ -1441,8 +1441,11 @@ implementation
          tempdef: tdef;
          is_first_type: boolean;
 {$endif powerpc or powerpc64}
-         sl       : tpropaccesslist;
+         sl: tpropaccesslist;
+         old_block_type: tblock_type;
       begin
+         old_block_type:=block_type;
+         block_type:=bt_var;
          recst:=tabstractrecordsymtable(symtablestack.top);
 {$if defined(powerpc) or defined(powerpc64)}
          is_first_type:=true;
@@ -1471,6 +1474,10 @@ implementation
                  end;
                consume(_ID);
              until not try_to_consume(_COMMA);
+             if m_delphi in current_settings.modeswitches then
+               block_type:=bt_var_type
+             else
+               block_type:=old_block_type;
              consume(_COLON);
 
              { Don't search for types where they can't be:
@@ -1484,6 +1491,7 @@ implementation
                  symtablestack.pop(recst);
                end;
              read_anon_type(hdef,false);
+             block_type:=bt_var;
              { allow only static fields reference to struct where they are declared }
              if not (vd_class in options) and
                (is_object(hdef) or is_record(hdef)) and
@@ -1630,6 +1638,10 @@ implementation
            end;
           recstlist.free;
 
+         if m_delphi in current_settings.modeswitches then
+           block_type:=bt_var_type
+         else
+           block_type:=old_block_type;
          { Check for Case }
          if (vd_record in options) and
             try_to_consume(_CASE) then
@@ -1650,6 +1662,7 @@ implementation
                   symtablestack.top.insert(fieldvs);
                 end;
               read_anon_type(casetype,true);
+              block_type:=bt_var;
               if assigned(fieldvs) then
                 begin
                   fieldvs.vardef:=casetype;
@@ -1685,6 +1698,10 @@ implementation
                   else
                     break;
                 until false;
+                if m_delphi in current_settings.modeswitches then
+                  block_type:=bt_var_type
+                else
+                  block_type:=old_block_type;
                 consume(_COLON);
                 { read the vars }
                 consume(_LKLAMMER);
@@ -1750,6 +1767,7 @@ implementation
 {$ifdef powerpc}
          is_first_type := false;
 {$endif powerpc}
+         block_type:=old_block_type;
       end;
 
 end.

+ 16 - 3
compiler/pexpr.pas

@@ -1869,6 +1869,7 @@ implementation
             stack space }
           dispatchstring : ansistring;
           nodechanged    : boolean;
+          calltype: tdispcalltype;
         label
           skipreckklammercheck;
         begin
@@ -2091,15 +2092,26 @@ implementation
                        variantdef:
                          begin
                            { dispatch call? }
+                           { lhs := v.ident[parameters] -> property get
+                             lhs := v.ident(parameters) -> method call
+                             v.ident[parameters] := rhs -> property put
+                             v.ident(parameters) := rhs -> also property put }
                            if token=_ID then
                              begin
                                dispatchstring:=orgpattern;
                                consume(_ID);
+                               calltype:=dct_method;
                                if try_to_consume(_LKLAMMER) then
                                  begin
                                    p2:=parse_paras(false,true,_RKLAMMER);
                                    consume(_RKLAMMER);
                                  end
+                               else if try_to_consume(_LECKKLAMMER) then
+                                 begin
+                                   p2:=parse_paras(false,true,_RECKKLAMMER);
+                                   consume(_RECKKLAMMER);
+                                   calltype:=dct_propget;
+                                 end
                                else
                                  p2:=nil;
                                { property setter? }
@@ -2116,9 +2128,9 @@ implementation
                                { this is only an approximation
                                  setting useresult if not necessary is only a waste of time, no more, no less (FK) }
                                if afterassignment or in_args or (token<>_SEMICOLON) then
-                                 p1:=translate_disp_call(p1,p2,dct_method,dispatchstring,0,cvarianttype)
+                                 p1:=translate_disp_call(p1,p2,calltype,dispatchstring,0,cvarianttype)
                                else
-                                 p1:=translate_disp_call(p1,p2,dct_method,dispatchstring,0,voidtype);
+                                 p1:=translate_disp_call(p1,p2,calltype,dispatchstring,0,voidtype);
                              end
                            else { Error }
                              Consume(_ID);
@@ -2778,7 +2790,8 @@ implementation
         else
           p1:=sub_expr(succ(pred_level),true,typeonly);
         repeat
-          if (token in operator_levels[pred_level]) and
+          if (token in [NOTOKEN..last_operator]) and
+             (token in operator_levels[pred_level]) and
              ((token<>_EQ) or accept_equal) then
            begin
              oldt:=token;

+ 3 - 0
compiler/powerpc/cputarg.pas

@@ -50,6 +50,9 @@ implementation
     {$ifndef NOTARGETAMIGA}
       ,t_amiga
     {$endif}
+    {$ifndef NOTARGETWII}
+      ,t_wii
+    {$endif}
 
 {**************************************
              Assemblers

+ 5 - 2
compiler/psub.pas

@@ -1764,12 +1764,15 @@ implementation
                    forward (or interface) declaration then we need to generate
                    a stub that calls the external routine }
                  if (not pd.forwarddef) and
-                    (pd.hasforward) and
+                    (pd.hasforward)
+                    { it is unclear to me what's the use of the following condition,
+                      so commented out, see also issue #18371 (FK)
+                    and
                     not(
                         assigned(pd.import_dll) and
                         (target_info.system in [system_i386_wdosx,
                                                 system_arm_wince,system_i386_wince])
-                       ) then
+                       ) } then
                    begin
                      s:=proc_get_importname(pd);
                      if s<>'' then

+ 15 - 15
compiler/ptype.pas

@@ -367,18 +367,18 @@ implementation
           end
         else
           begin
-            { There is comment few lines before ie 200512115 
-              saying "We are parsing the same objectdef, the def index numbers 
-              are the same". This is wrong (index numbers are not same) 
-              in case there is specialization (S2 in this case) inside 
-              specialized generic (G2 in this case) which is equal to 
-              some previous specialization (S1 in this case). In that case, 
-              new symbol is not added to currently specialized type 
-              (S in this case) for that specializations (S2 in this case), 
-              and this results in that specialization and generic definition 
-              don't have same number of elements in their object symbol tables. 
-              This patch adds undefined def to ensure that those 
-              two symbol tables will have same number of elements. 
+            { There is comment few lines before ie 200512115
+              saying "We are parsing the same objectdef, the def index numbers
+              are the same". This is wrong (index numbers are not same)
+              in case there is specialization (S2 in this case) inside
+              specialized generic (G2 in this case) which is equal to
+              some previous specialization (S1 in this case). In that case,
+              new symbol is not added to currently specialized type
+              (S in this case) for that specializations (S2 in this case),
+              and this results in that specialization and generic definition
+              don't have same number of elements in their object symbol tables.
+              This patch adds undefined def to ensure that those
+              two symbol tables will have same number of elements.
             }
             tundefineddef.create;
           end;
@@ -938,7 +938,7 @@ implementation
            lv,hv   : TConstExprInt;
            old_block_type : tblock_type;
            dospecialize : boolean;
-           structdef: tabstractrecorddef;
+           structdef: tdef;
         begin
            old_block_type:=block_type;
            dospecialize:=false;
@@ -949,13 +949,13 @@ implementation
                structdef:=current_structdef;
                while assigned(structdef) and (structdef.typ in [objectdef,recorddef]) do
                  begin
-                   if (structdef.objname^=pattern) then
+                   if (tabstractrecorddef(structdef).objname^=pattern) then
                      begin
                        consume(_ID);
                        def:=structdef;
                        exit;
                      end;
-                   structdef:=tabstractrecorddef(structdef.owner.defowner);
+                   structdef:=tdef(structdef.owner.defowner);
                  end;
              end;
            { Generate a specialization in FPC mode? }

+ 2 - 1
compiler/symconst.pas

@@ -423,7 +423,8 @@ type
     { Objective-C message selector parameter }
     vo_is_msgsel,
     { first field of variant part of a record }
-    vo_is_first_field
+    vo_is_first_field,
+    vo_volatile
   );
   tvaroptions=set of tvaroption;
 

+ 12 - 105
compiler/symdef.pas

@@ -4940,117 +4940,24 @@ implementation
       end;
 
     function tobjectdef.search_enumerator_get: tprocdef;
-     var
-        objdef : tobjectdef;
-        sym : tsym;
-        i : integer;
-        pd : tprocdef;
-        hashedid : THashedIDString;
-     begin
-        result:=nil;
-        objdef:=self;
-        hashedid.id:='GETENUMERATOR';
-        while assigned(objdef) do
-          begin
-            sym:=tsym(objdef.symtable.FindWithHash(hashedid));
-            if assigned(sym) and (sym.typ=procsym) then
-              begin
-                for i := 0 to Tprocsym(sym).ProcdefList.Count - 1 do
-                begin
-                  pd := tprocdef(Tprocsym(sym).ProcdefList[i]);
-                  if (pd.proctypeoption = potype_function) and
-                     (is_class_or_interface_or_object(pd.returndef) or is_record(pd.returndef)) and
-                     (pd.visibility >= vis_public) then
-                  begin
-                    result:=pd;
-                    exit;
-                  end;
-                end;
-              end;
-            objdef:=objdef.childof;
-          end;
+      begin
+        result:=inherited;
+        if not assigned(result) and assigned(childof) then
+          result:=childof.search_enumerator_get;
       end;
 
     function tobjectdef.search_enumerator_move: tprocdef;
-     var
-        objdef : tobjectdef;
-        sym : tsym;
-        i : integer;
-        pd : tprocdef;
-        hashedid : THashedIDString;
-     begin
-        result:=nil;
-        objdef:=self;
-        // first search for po_enumerator_movenext method modifier
-        // then search for public function MoveNext: Boolean
-        hashedid.id:='MOVENEXT';
-        while assigned(objdef) do
-          begin
-            for i:=0 to objdef.symtable.SymList.Count-1 do
-              begin
-                sym:=TSym(objdef.symtable.SymList[i]);
-                if (sym.typ=procsym) then
-                begin
-                  pd:=Tprocsym(sym).find_procdef_byoptions([po_enumerator_movenext]);
-                  if assigned(pd) then
-                    begin
-                      result:=pd;
-                      exit;
-                    end;
-                end;
-              end;
-            sym:=tsym(objdef.symtable.FindWithHash(hashedid));
-            if assigned(sym) and (sym.typ=procsym) then
-              begin
-                for i := 0 to Tprocsym(sym).ProcdefList.Count - 1 do
-                begin
-                  pd := tprocdef(Tprocsym(sym).ProcdefList[i]);
-                  if (pd.proctypeoption = potype_function) and
-                     is_boolean(pd.returndef) and
-                     (pd.minparacount = 0) and
-                     (pd.visibility >= vis_public) then
-                  begin
-                    result:=pd;
-                    exit;
-                  end;
-                end;
-              end;
-            objdef:=objdef.childof;
-          end;
+      begin
+        result:=inherited;
+        if not assigned(result) and assigned(childof) then
+          result:=childof.search_enumerator_move;
       end;
 
     function tobjectdef.search_enumerator_current: tsym;
-     var
-        objdef : tobjectdef;
-        sym: tsym;
-        i: integer;
-        hashedid : THashedIDString;
-     begin
-        result:=nil;
-        objdef:=self;
-        hashedid.id:='CURRENT';
-        // first search for ppo_enumerator_current property modifier
-        // then search for public property Current
-        while assigned(objdef) do
-          begin
-            for i:=0 to objdef.symtable.SymList.Count-1 do
-              begin
-                sym:=TSym(objdef.symtable.SymList[i]);
-                if (sym.typ=propertysym) and (ppo_enumerator_current in tpropertysym(sym).propoptions) then
-                begin
-                  result:=sym;
-                  exit;
-                end;
-              end;
-            sym:=tsym(objdef.symtable.FindWithHash(hashedid));
-            if assigned(sym) and (sym.typ=propertysym) and
-               (sym.visibility >= vis_public) and not tpropertysym(sym).propaccesslist[palt_read].empty then
-              begin
-                result:=sym;
-                exit;
-              end;
-            objdef:=objdef.childof;
-          end;
+      begin
+        result:=inherited;
+        if not assigned(result) and assigned(childof) then
+          result:=childof.search_enumerator_current;
       end;
 
     procedure tobjectdef.register_created_classref_type;

+ 3 - 3
compiler/symtable.pas

@@ -772,7 +772,7 @@ implementation
       begin
          if b_needs_init_final then
            exit;
-         { don't check static symbols - they can be present in structures only and 
+         { don't check static symbols - they can be present in structures only and
            always have a reference to a symbol defined on unit level }
          if sp_static in tsym(sym).symoptions then
            exit;
@@ -1924,7 +1924,7 @@ implementation
                        (srsymtable.defowner.typ in [recorddef,objectdef]) and
                        (srsymtable.defowner.owner.symtabletype in [globalsymtable,staticsymtable]) and
                        (srsymtable.defowner.owner.iscurrentunit) then
-                      contextstructdef:=tobjectdef(srsymtable.defowner)
+                      contextstructdef:=tabstractrecorddef(srsymtable.defowner)
                     else
                       contextstructdef:=current_structdef;
                     if not (srsym.owner.symtabletype in [objectsymtable,recordsymtable]) or
@@ -1988,7 +1988,7 @@ implementation
             else
               begin
                 srsym:=tsym(srsymtable.FindWithHash(hashedid));
-                if assigned(srsym) and 
+                if assigned(srsym) and
                    not(srsym.typ in [fieldvarsym,paravarsym,propertysym,procsym,labelsym]) and
                    (not (srsym.owner.symtabletype in [objectsymtable,recordsymtable]) or is_visible_for_object(srsym,current_structdef)) then
                   begin

+ 2 - 1
compiler/systems.pas

@@ -151,7 +151,8 @@ interface
              system_mips_linux,         { 66 }
              system_mipsel_linux,       { 67 }
              system_i386_nativent,      { 68 }
-             system_i386_iphonesim      { 69 }
+             system_i386_iphonesim,     { 69 }
+             system_powerpc_wii         { 70 }
        );
 
      type

+ 101 - 0
compiler/systems/i_wii.pas

@@ -0,0 +1,101 @@
+{
+    Copyright (c) 2011 by Francesco Lombardi
+
+    This unit implements support information structures for Wii
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ ****************************************************************************
+}
+{ This unit implements support information structures for the Nintendo Wii. }
+unit i_wii;
+
+  interface
+
+    uses
+       systems;
+
+    const
+       system_powerpc_wii_info : tsysteminfo =
+          (
+            system       : system_powerpc_wii;
+            name         : 'Wii';
+            shortname    : 'Wii';
+            flags        : [tf_under_development,tf_needs_symbol_size,tf_files_case_aware,
+                            tf_use_function_relative_addresses,tf_needs_symbol_type,
+                            tf_smartlink_library];
+            cpu          : cpu_powerpc;
+            unit_env     : '';
+            extradefines : '';
+            exeext       : '.dol';
+            defext       : '.def';
+            scriptext    : '.sh';
+            smartext     : '.sl';
+            unitext      : '.ppu';
+            unitlibext   : '.ppl';
+            asmext       : '.s';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            sharedlibext : '.so';
+            staticlibext : '.a';
+            staticlibprefix : 'libp';
+            sharedlibprefix : 'lib';
+            sharedClibext : '.so';
+            staticClibext : '.a';
+            staticClibprefix : 'lib';
+            sharedClibprefix : 'lib';
+            importlibprefix : 'libimp';
+            importlibext : '.a';
+            Cprefix      : '';
+            newline      : #10;
+            dirsep       : '/';
+            assem        : as_gas;
+            assemextern  : as_gas;
+            link         : nil;
+            linkextern   : nil;
+            ar           : ar_gnu_ar;
+            res          : res_none;
+            dbg          : dbg_stabs;
+            script       : script_unix;
+            endian       : endian_big;
+            alignment    :
+              (
+                procalign       : 4;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 4;
+                varalignmin     : 0;
+                varalignmax     : 4;
+                localalignmin   : 4;
+                localalignmax   : 4;
+                recordalignmin  : 0;
+                recordalignmax  : 4;
+                maxCrecordalign : 8
+              );
+            first_parm_offset : 8;
+            stacksize    : 32*1024*1024;
+            abi : abi_powerpc_sysv;
+          );
+
+  implementation
+
+initialization
+{$ifdef CPUPOWERPC}
+  {$ifdef WII}
+    set_source_info(system_powerpc_wii_info);
+  {$endif WII}
+{$endif CPUPOWERPC}
+end.

+ 2 - 2
compiler/systems/t_nwl.pas

@@ -579,7 +579,7 @@ begin
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$TMPOBJ',maybequoted(outputexedir+tmpLinkFileName));
   Comment (v_debug,'Executing '+BinStr+' '+cmdstr);
-  success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
+  success:=DoExec(BinStr,CmdStr,true,false);
 
   { Remove ReponseFile }
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
@@ -593,7 +593,7 @@ begin
     SplitBinCmd(Info.ExeCmd[2],binstr,cmdstr);
     Replace(cmdstr,'$RES',maybequoted(outputexedir+'n'+Info.ResName));
     Comment (v_debug,'Executing '+BinStr+' '+cmdstr);
-    success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
+    success:=DoExec(BinStr,CmdStr,true,false);
     if (success) and not(cs_link_nolink in current_settings.globalswitches) then
     begin
       DeleteFile(outputexedir+'n'+Info.ResName);

+ 2 - 2
compiler/systems/t_nwm.pas

@@ -523,7 +523,7 @@ begin
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$TMPOBJ',maybequoted(outputexedir+tmpLinkFileName));
   Comment (v_debug,'Executing '+BinStr+' '+cmdstr);
-  success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
+  success:=DoExec(BinStr,CmdStr,true,false);
 
   { Remove ReponseFile }
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
@@ -537,7 +537,7 @@ begin
     SplitBinCmd(Info.ExeCmd[2],binstr,cmdstr);
     Replace(cmdstr,'$RES',maybequoted(outputexedir+'n'+Info.ResName));
     Comment (v_debug,'Executing '+BinStr+' '+cmdstr);
-    success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
+    success:=DoExec(BinStr,CmdStr,true,false);
     if (success) and not(cs_link_nolink in current_settings.globalswitches) then
     begin
       DeleteFile(outputexedir+'n'+Info.ResName);

+ 598 - 0
compiler/systems/t_wii.pas

@@ -0,0 +1,598 @@
+{
+    Copyright (c) 2011 by Francesco Lombardi
+
+    This unit implements support import, export, link routines
+    for the Wii (PowerPC) target
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ ****************************************************************************
+}
+unit t_wii;
+
+{$i fpcdefs.inc}
+
+interface
+
+
+implementation
+
+    uses
+       aasmbase,
+       SysUtils,
+       cutils,cfileutl,cclasses,
+       globtype,globals,systems,verbose,script,fmodule,i_wii,link;
+
+    type
+       TlinkerWii=class(texternallinker)
+       private
+          Function  WriteResponseFile: Boolean;
+       public
+          constructor Create; override;
+          procedure SetDefaultInfo; override;
+          function  MakeExecutable:boolean; override;
+       end;
+
+
+
+{****************************************************************************
+                               TLinkerWii
+****************************************************************************}
+
+Constructor TLinkerWii.Create;
+begin
+  Inherited Create;
+  SharedLibFiles.doubles:=true;
+  StaticLibFiles.doubles:=true;
+end;
+
+
+procedure TLinkerWii.SetDefaultInfo;
+begin
+  with Info do
+   begin
+     ExeCmd[1]:='ld -g $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -L. -o $EXE -T $RES';
+   end;
+end;
+
+
+Function TLinkerWii.WriteResponseFile : Boolean;
+Var
+  linkres  : TLinkRes;
+  i        : longint;
+  HPath    : TCmdStrListItem;
+  s,s1,s2  : TCmdStr;
+  linklibc,
+  linklibgcc  : boolean;
+  found1,
+  found2   : boolean;    
+begin
+  WriteResponseFile:=False;
+  linklibc:=(SharedLibFiles.Find('c')<>nil);
+  linklibgcc:=(SharedLibFiles.Find('gcc')<>nil);
+  LinkRes:=TLinkRes.Create(outputexedir+Info.ResName);
+
+  { Write path to search libraries }
+  HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First);
+  while assigned(HPath) do
+   begin
+    s:=HPath.Str;
+    if (cs_link_on_target in current_settings.globalswitches) then
+     s:=ScriptFixFileName(s);
+    LinkRes.Add('-L'+s);
+    HPath:=TCmdStrListItem(HPath.Next);
+   end;
+  HPath:=TCmdStrListItem(LibrarySearchPath.First);
+  while assigned(HPath) do
+   begin
+    s:=HPath.Str;
+    if s<>'' then
+     LinkRes.Add('SEARCH_DIR('+(maybequoted(s))+')');
+    HPath:=TCmdStrListItem(HPath.Next);
+   end;
+
+  LinkRes.Add('INPUT (');
+  { add objectfiles, start with prt0 always }
+//  s:=FindObjectFile('prt0','',false);
+//  LinkRes.AddFileName(s);
+  { try to add crti and crtbegin if linking to C }
+  if linklibc then
+   begin
+     if librarysearchpath.FindFile('ecrti.o',false,s) then
+      LinkRes.AddFileName(s);
+   end;
+  if linklibgcc then
+   begin
+     if librarysearchpath.FindFile('crtbegin.o',false,s) then
+      LinkRes.AddFileName(s);
+   end;
+  if linklibc or linklibgcc then
+   begin
+     if librarysearchpath.FindFile('crtmain.o',false,s) then
+      LinkRes.AddFileName(s);
+   end;
+   
+   
+  while not ObjectFiles.Empty do
+   begin
+    s:=ObjectFiles.GetFirst;
+    if s<>'' then
+     begin
+      { vlink doesn't use SEARCH_DIR for object files }
+      if not(cs_link_on_target in current_settings.globalswitches) then
+       s:=FindObjectFile(s,'',false);
+      LinkRes.AddFileName((maybequoted(s)));
+     end;
+   end;
+
+  { Write staticlibraries }
+  if not StaticLibFiles.Empty then
+   begin
+    { vlink doesn't need, and doesn't support GROUP }
+    if (cs_link_on_target in current_settings.globalswitches) then
+     begin
+      LinkRes.Add(')');
+      LinkRes.Add('GROUP(');
+     end;
+    while not StaticLibFiles.Empty do
+     begin
+      S:=StaticLibFiles.GetFirst;
+      LinkRes.AddFileName((maybequoted(s)));
+     end;
+   end;
+
+  if (cs_link_on_target in current_settings.globalswitches) then
+   begin
+    LinkRes.Add(')');
+
+    { Write sharedlibraries like -l<lib>, also add the needed dynamic linker
+      here to be sure that it gets linked this is needed for glibc2 systems (PFV) }
+    linklibc:=false;
+    linklibgcc:=false;
+    while not SharedLibFiles.Empty do
+     begin
+      S:=SharedLibFiles.GetFirst;
+      if s<>'c' then
+       begin
+        i:=Pos(target_info.sharedlibext,S);
+        if i>0 then
+         Delete(S,i,255);
+        LinkRes.Add('-l'+s);
+       end
+      else
+       begin
+        LinkRes.Add('-l'+s);
+        linklibc:=true;
+        linklibgcc:=true;
+       end;
+     end;
+    { be sure that libc&libgcc is the last lib }
+    if linklibgcc then
+     begin
+      LinkRes.Add('-lgcc');
+     end;
+    if linklibc then
+     begin
+      LinkRes.Add('-lc');
+     end;
+     
+   end
+  else
+   begin
+    while not SharedLibFiles.Empty do
+     begin
+      S:=SharedLibFiles.GetFirst;
+      LinkRes.Add('lib'+s+target_info.staticlibext);
+     end;
+    LinkRes.Add(')');
+   end;
+
+  { objects which must be at the end }
+  if linklibgcc then
+   begin
+     found1:=librarysearchpath.FindFile('crtend.o',false,s1);
+     if found1 then
+      begin
+        LinkRes.Add('INPUT(');
+        if found1 then
+         LinkRes.AddFileName(s1);
+        LinkRes.Add(')');
+      end;
+   end;   
+  if linklibc then
+   begin
+     found2:=librarysearchpath.FindFile('ecrtn.o',false,s2);
+     if found2 then
+      begin
+        LinkRes.Add('INPUT(');
+        if found2 then
+         LinkRes.AddFileName(s2);
+        LinkRes.Add(')');
+      end;
+   end;   
+  with linkres do
+   begin
+    Add('/*');
+    Add(' * Linkscript for Wii');
+    Add(' */');
+    Add('');
+    Add('OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc");');
+    Add('OUTPUT_ARCH(powerpc:common);');
+    Add('EXTERN(_start);');
+    Add('ENTRY(_start);');
+    Add('');
+    Add('PHDRS');
+    Add('{');
+    Add('  stub PT_LOAD FLAGS(5);');
+    Add('  text PT_LOAD FLAGS(5);');
+    Add('  data PT_LOAD FLAGS(6);');
+    Add('}');
+    Add('');
+    Add('SECTIONS');
+    Add('{');
+    Add('	/* stub is loaded at physical address 0x00003400 (though both 0x80003400 and 0x00003400 are equivalent for IOS) */');
+    Add('	/* This can also be used to load an arbitrary standalone stub at an arbitrary address in memory, for any purpose */');
+    Add('	/* Use -Wl,--section-start,.stub=0xADDRESS to change */');
+    Add('	. = 0x00003400;');
+    Add('');
+    Add('	.stub :');
+    Add('	{');
+    Add('		KEEP(*(.stub))');
+    Add('	} :stub = 0');
+    Add('');
+    Add('	/* default base address */');
+    Add('	/* use -Wl,--section-start,.init=0xADDRESS to change */');
+    Add('	. = 0x80004000;');
+    Add('');
+    Add('	/* Program */');
+    Add('	.init          :');
+    Add('	{');
+    Add('		KEEP (*crt0.o(*.init))');
+    Add('		KEEP (*(.init))');
+    Add('	} :text = 0');
+    Add('	.plt      : { *(.plt)	}');
+    Add('	.interp			: { *(.interp) 	}');
+    Add('	.hash			: { *(.hash) }');
+    Add('	.dynsym			: { *(.dynsym) }');
+    Add('	.dynstr			: { *(.dynstr) }');
+    Add('	.gnu.version	: { *(.gnu.version) }');
+    Add('	.gnu.version_d	: { *(.gnu.version_d) }');
+    Add('	.gnu.version_r	: { *(.gnu.version_r) }');
+    Add('	.rel.init		: { *(.rel.init) }');
+    Add('	.rela.init		: { *(.rela.init) }');
+    Add('	.rel.text		: { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }');
+    Add('	.rela.text		: { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }');
+    Add('	.rel.fini		: { *(.rel.fini) }');
+    Add('	.rela.fini		: { *(.rela.fini) }');
+    Add('	.rel.rodata		: { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }');
+    Add('	.rela.rodata	: { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }');
+    Add('	.rel.data		: { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }');
+    Add('	.rela.data		: { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }');
+    Add('	.rel.tdata		: { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }');
+    Add('	.rela.tdata		: { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }');
+    Add('	.rel.tbss		: { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }');
+    Add('	.rela.tbss		: { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }');
+    Add('	.rel.ctors		: { *(.rel.ctors) }');
+    Add('	.rela.ctors		: { *(.rela.ctors) }');
+    Add('	.rel.dtors		: { *(.rel.dtors) }');
+    Add('	.rela.dtors		: { *(.rela.dtors) }');
+    Add('	.rel.got		: { *(.rel.got)	}');
+    Add('	.rela.got		: { *(.rela.got) }');
+    Add('	.rela.got1		: { *(.rela.got1) }');
+    Add('	.rela.got2		: { *(.rela.got2) }');
+    Add('	.rel.sdata		: { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }');
+    Add('	.rela.sdata		: { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }');
+    Add('	.rel.sbss		: { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }');
+    Add('	.rela.sbss		: { *(.rela.sbss .rela.sbss.* .rel.gnu.linkonce.sb.*) }');
+    Add('	.rel.sdata2		: { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }');
+    Add('	.rela.sdata2	: { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }');
+    Add('	.rel.sbss2		: { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }');
+    Add('	.rela.sbss2		: { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }');
+    Add('	.rel.bss		: { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }');
+    Add('	.rela.bss		: { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }');
+    Add('	.rel.plt		: { *(.rel.plt) }');
+    Add('	.rela.plt		: { *(.rela.plt) }');
+    Add('');
+    Add('	.text      :');
+    Add('	{');
+    Add('		*(.text)');
+    Add('		*(.text.*)');
+    Add('		/* .gnu.warning sections are handled specially by elf32.em.  */');
+    Add('		*(.gnu.warning)');
+    Add('		*(.gnu.linkonce.t.*)');
+    Add('		. = ALIGN(32);   /* REQUIRED. LD is flaky without it. */');
+    Add('	} = 0');
+    Add('');
+    Add('	.fini      :');
+    Add('	{');
+    Add('		KEEP (*(.fini))');
+    Add('		. = ALIGN(32);   /* REQUIRED. LD is flaky without it. */');
+    Add('	} = 0');
+    Add('	');
+    Add('	PROVIDE (__etext = .);');
+    Add('	PROVIDE (_etext = .);');
+    Add('	PROVIDE (etext = .);');
+    Add('');
+    Add('	.rodata   : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } :data');
+    Add('	.rodata1   : { *(.rodata1) }');
+    Add('	.sdata2   : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) }');
+    Add('	.sbss2   : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) }');
+    Add('  /* Adjust the address for the data segment.  We want to adjust up to');
+    Add('     the same address within the page on the next page up.  */');
+    Add('  /* Ensure the __preinit_array_start label is properly aligned.  We');
+    Add('     could instead move the label definition inside the section, but');
+    Add('     the linker would then create the section even if it turns out to');
+    Add('     be empty, which isn''t pretty.  */');
+    Add('	. = ALIGN(32 / 8);');
+    Add('	PROVIDE (__preinit_array_start = .);');
+    Add('	.preinit_array     : { *(.preinit_array) }');
+    Add('	PROVIDE (__preinit_array_end = .);');
+    Add('	PROVIDE (__init_array_start = .);');
+    Add('	.init_array     : { *(.init_array) }');
+    Add('	PROVIDE (__init_array_end = .);');
+    Add('	PROVIDE (__fini_array_start = .);');
+    Add('	.fini_array     : { *(.fini_array) }');
+    Add('	PROVIDE (__fini_array_end = .);');
+    Add('	.data    :');
+    Add('	{');
+    Add('		*(.data)');
+    Add('		*(.data.*)');
+    Add('		*(.gnu.linkonce.d.*)');
+    Add('		SORT(CONSTRUCTORS)');
+    Add('		. = ALIGN(32);   /* REQUIRED. LD is flaky without it. */');
+    Add('	}');
+    Add('');
+    Add('	.data1   : { *(.data1) }');
+    Add('	.tdata	  : { *(.tdata .tdata.* .gnu.linkonce.td.*) }');
+    Add('	.tbss		  : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }');
+    Add('	.eh_frame : { KEEP (*(.eh_frame)) }');
+    Add('	.gcc_except_table : { *(.gcc_except_table) }');
+    Add('	.fixup          : { *(.fixup) }');
+    Add('	.got1           : { *(.got1) }');
+    Add('	.got2           : { *(.got2) }');
+    Add('	.dynamic       : { *(.dynamic) }');
+    Add('');
+    Add('	.ctors   :');
+    Add('	{');
+    Add('	/*	gcc uses crtbegin.o to find the start of');
+    Add('		the constructors, so we make sure it is');
+    Add('		first.  Because this is a wildcard, it');
+    Add('		doesn''t matter if the user does not');
+    Add('		actually link against crtbegin.o; the');
+    Add('		linker won''t look for a file to match a');
+    Add('		wildcard.  The wildcard also means that it');
+    Add('		doesn''t matter which directory crtbegin.o');
+    Add('		is in.  */');
+    Add('');
+    Add('		KEEP (*crtbegin.o(.ctors))');
+    Add('');
+    Add('    /*	We don''t want to include the .ctor section from');
+    Add('		from the crtend.o file until after the sorted ctors.');
+    Add('		The .ctor section from the crtend file contains the');
+    Add('		end of ctors marker and it must be last */');
+    Add('');
+    Add('		KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))');
+    Add('		KEEP (*(SORT(.ctors.*)))');
+    Add('		KEEP (*(.ctors))');
+    Add('		. = ALIGN(32);   /* REQUIRED. LD is flaky without it. */');
+    Add('	}');
+    Add('');
+    Add('	.dtors         :');
+    Add('	{');
+    Add('		KEEP (*crtbegin.o(.dtors))');
+    Add('		KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))');
+    Add('		KEEP (*(SORT(.dtors.*)))');
+    Add('		KEEP (*(.dtors))');
+    Add('		. = ALIGN(32);   /* REQUIRED. LD is flaky without it. */');
+    Add('	}');
+    Add('');
+    Add('	.jcr            : { KEEP (*(.jcr)) }');
+    Add('	.got		  : { *(.got.plt) *(.got) }');
+    Add('');
+    Add('');
+    Add('	/*	We want the small data sections together, so single-instruction offsets');
+    Add('		can access them all, and initialized data all before uninitialized, so');
+    Add('		we can shorten the on-disk segment size.  */');
+    Add('');
+    Add('	.sdata     :');
+    Add('	{');
+    Add('		*(.sdata)');
+    Add('		*(.sdata.*)');
+    Add('		*(.gnu.linkonce.s.*)');
+    Add('		. = ALIGN(32);   /* REQUIRED. LD is flaky without it. */');
+    Add('	}');
+    Add('');
+    Add('	_edata = .;');
+    Add('	PROVIDE (edata = .);');
+    Add('	');
+    Add('	.sbss      :');
+    Add('	{');
+    Add('		__sbss_start = .;');
+    Add('		PROVIDE (__sbss_start = .);');
+    Add('		PROVIDE (___sbss_start = .);');
+    Add('		*(.dynsbss)');
+    Add('		*(.sbss)');
+    Add('		*(.sbss.*)');
+    Add('		*(.gnu.linkonce.sb.*)');
+    Add('		*(.scommon)');
+    Add('		PROVIDE (__sbss_end = .);');
+    Add('		PROVIDE (___sbss_end = .);');
+    Add('		. = ALIGN(32);   /* REQUIRED. LD is flaky without it. */');
+    Add('		__sbss_end = .;');
+    Add('	}');
+    Add('');
+    Add('	.bss       :');
+    Add('	{');
+    Add('		__bss_start = .;');
+    Add('		PROVIDE (__bss_start = .);');
+    Add('		*(.dynbss)');
+    Add('		*(.bss)');
+    Add('		*(.bss.*)');
+    Add('		*(.gnu.linkonce.b.*)');
+    Add('		*(COMMON)');
+    Add('	/*	Align here to ensure that the .bss section occupies space up to');
+    Add('		_end.  Align after .bss to ensure correct alignment even if the');
+    Add('		.bss section disappears because there are no input sections.  */');
+    Add('');
+    Add('		. = ALIGN(32);');
+    Add('');
+    Add('		PROVIDE (__bss_end = .);');
+    Add('		__bss_end = .;');
+    Add('	}');
+    Add('');
+    Add('	_end = .;');
+    Add('	PROVIDE(end = .);');
+    Add('	/* Stabs debugging sections.  */');
+    Add('	.stab 0 : { *(.stab) }');
+    Add('	.stabstr 0 : { *(.stabstr) }');
+    Add('	.stab.excl 0 : { *(.stab.excl) }');
+    Add('	.stab.exclstr 0 : { *(.stab.exclstr) }');
+    Add('	.stab.index 0 : { *(.stab.index) }');
+    Add('	.stab.indexstr 0 : { *(.stab.indexstr) }');
+    Add('	.comment 0 : { *(.comment) }');
+    Add('	/*	DWARF debug sections.');
+    Add('		Symbols in the DWARF debugging sections are relative to the beginning');
+    Add('		of the section so we begin them at 0.  */');
+    Add('	/* DWARF 1 */');
+    Add('	.debug          0 : { *(.debug) }');
+    Add('	.line           0 : { *(.line) }');
+    Add('	/* GNU DWARF 1 extensions */');
+    Add('	.debug_srcinfo  0 : { *(.debug_srcinfo) }');
+    Add('	.debug_sfnames  0 : { *(.debug_sfnames) }');
+    Add('	/* DWARF 1.1 and DWARF 2 */');
+    Add('	.debug_aranges  0 : { *(.debug_aranges) }');
+    Add('	.debug_pubnames 0 : { *(.debug_pubnames) }');
+    Add('	/* DWARF 2 */');
+    Add('	.debug_info     0 : { *(.debug_info) }');
+    Add('	.debug_abbrev   0 : { *(.debug_abbrev) }');
+    Add('	.debug_line     0 : { *(.debug_line) }');
+    Add('	.debug_frame    0 : { *(.debug_frame) }');
+    Add('	.debug_str      0 : { *(.debug_str) }');
+    Add('	.debug_loc      0 : { *(.debug_loc) }');
+    Add('	.debug_macinfo  0 : { *(.debug_macinfo) }');
+    Add('	/* SGI/MIPS DWARF 2 extensions */');
+    Add('	.debug_weaknames 0 : { *(.debug_weaknames) }');
+    Add('	.debug_funcnames 0 : { *(.debug_funcnames) }');
+    Add('	.debug_typenames 0 : { *(.debug_typenames) }');
+    Add('	.debug_varnames  0 : { *(.debug_varnames) }');
+    Add('	/* These must appear regardless of  .  */');
+    Add('}');
+    Add('');
+    Add('__isIPL = 0;');
+    Add('__stack_addr = (__bss_start + SIZEOF(.bss) + 0x20000 + 7) & (-8);');
+    Add('__stack_end = (__bss_start + SIZEOF(.bss));');
+    Add('__intrstack_addr = (__stack_addr + 0x4000);');
+    Add('__intrstack_end = (__stack_addr);');
+    Add('__Arena1Lo = (__intrstack_addr + 31) & (-32);');
+    Add('__Arena1Hi = (0x817FEFF0);');
+    Add('__Arena2Lo = (0x90002000);');
+    Add('__Arena2Hi = (0x933E0000);');
+    Add('');
+    Add('__gxregs = (__Arena1Hi + 31) & (-32);');
+    Add('__ipcbufferLo = (0x933e0000);');
+    Add('__ipcbufferHi = (0x93400000);');
+    Add('');
+    Add('/* for backward compatibility with old crt0 */');
+    Add('PROVIDE (__stack = (0x817FEFF0));');
+    Add('');
+    Add('PROVIDE(__isIPL = __isIPL);');
+    Add('PROVIDE(__stack_addr = __stack_addr);');
+    Add('PROVIDE(__stack_end = __stack_end);');
+    Add('PROVIDE(__intrstack_addr = __intrstack_addr);');
+    Add('PROVIDE(__intrstack_end = __intrstack_end);');
+    Add('PROVIDE(__Arena1Lo = __Arena1Lo);');
+    Add('PROVIDE(__Arena1Hi = __Arena1Hi);');
+    Add('PROVIDE(__Arena2Lo = __Arena2Lo);');
+    Add('PROVIDE(__Arena2Hi = __Arena2Hi);');
+    Add('PROVIDE(__ipcbufferLo = __ipcbufferLo);');
+    Add('PROVIDE(__ipcbufferHi = __ipcbufferHi);');
+    Add('PROVIDE(__gxregs = __gxregs);');
+   end;
+   
+   
+{ Write and Close response }
+  linkres.writetodisk;
+  linkres.free;
+
+  WriteResponseFile:=True;
+
+end;
+
+
+function TLinkerWii.MakeExecutable:boolean;
+var
+  binstr,
+  cmdstr  : TCmdStr;
+  success : boolean;
+  StaticStr,
+  GCSectionsStr,
+  DynLinkStr,
+  StripStr: string;
+begin
+  StaticStr:='';
+  StripStr:='';
+  GCSectionsStr:='';
+  DynLinkStr:='';
+
+  if (cs_link_strip in current_settings.globalswitches) and
+     not(cs_link_separate_dbg_file in current_settings.globalswitches) then
+   StripStr:='-s';
+  if (cs_link_map in current_settings.globalswitches) then
+   StripStr:='-Map '+maybequoted(ChangeFileExt(current_module.exefilename^,'.map'));
+  if create_smartlink_sections then
+   GCSectionsStr:='--gc-sections';
+  if not(cs_link_nolink in current_settings.globalswitches) then
+   Message1(exec_i_linking,current_module.exefilename^);
+
+
+{ Write used files and libraries }
+  WriteResponseFile();
+
+{ Call linker }
+  SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
+  Replace(cmdstr,'$OPT',Info.ExtraOptions);
+
+  Replace(cmdstr,'$EXE',(maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename^,'.elf')))));
+  Replace(cmdstr,'$RES',(maybequoted(ScriptFixFileName(outputexedir+Info.ResName))));
+  Replace(cmdstr,'$STATIC',StaticStr);
+  Replace(cmdstr,'$STRIP',StripStr);
+  Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
+  Replace(cmdstr,'$DYNLINK',DynLinkStr);
+
+  success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false);
+
+{ Remove ReponseFile }
+  if (success) and not(cs_link_nolink in current_settings.globalswitches) then
+   DeleteFile(outputexedir+Info.ResName);
+   
+{ Post process }
+
+  if success then 
+   begin
+    success:=DoExec(FindUtil('elf2dol'),ChangeFileExt(current_module.exefilename^,'.elf')+' '+ 
+     current_module.exefilename^,true,false);
+   end;
+  MakeExecutable:=success;   { otherwise a recursive call to link method }
+end;
+
+
+{*****************************************************************************
+                                     Initialize
+*****************************************************************************}
+
+initialization
+  RegisterExternalLinker(system_powerpc_wii_info,TLinkerWii);
+  RegisterTarget(system_powerpc_wii_info);
+end.

+ 6 - 1
compiler/x86/rax86.pas

@@ -204,6 +204,11 @@ begin
         OS_32 : opsize:=S_IL;
         OS_64 : opsize:=S_IQ;
       end;
+    end
+  else
+    begin
+      if size=OS_64 then
+        opsize:=S_Q;
     end;
 end;
 
@@ -233,7 +238,7 @@ begin
          not(opr.ref.refaddr in [addr_pic,addr_pic_no_got]) then
         begin
           if (opr.ref.symbol.name <> '_GLOBAL_OFFSET_TABLE_') then
-            begin 
+            begin
               message(asmr_e_need_pic_ref);
               result:=false;
             end

+ 8 - 1
compiler/x86/rax86int.pas

@@ -1768,7 +1768,14 @@ Unit Rax86int;
                                 Message1(sym_e_unknown_id,expr);
                               expr:='';
                             end;
-                         end;
+                          { indexed access to variable? }
+                          if actasmtoken=AS_LBRACKET then
+                            begin
+                              { ... then the operand size is not known anymore }
+                              oper.size:=OS_NO;
+                              BuildReference(oper);
+                            end;
+                        end;
                      end;
                  end;
               end;

+ 1 - 0
packages/fcl-db/src/base/db.pas

@@ -499,6 +499,7 @@ type
     function GetDataSize: Integer; override;
   public
     constructor Create(aOwner: TComponent); override;
+    procedure SetFieldType(AValue: TFieldType); override;
     property Value: WideString read GetAsWideString write SetAsWideString;
   end;
 

+ 6 - 0
packages/fcl-db/src/base/fields.inc

@@ -1205,6 +1205,12 @@ begin
   SetDataType(ftWideString);
 end;
 
+procedure TWideStringField.SetFieldType(AValue: TFieldType);
+begin
+  if avalue in [ftWideString, ftFixedWideChar] then
+    SetDataType(AValue);
+end;
+
 function TWideStringField.GetValue(var aValue: WideString): Boolean;
 var
   FixBuffer : array[0..dsMaxStringSize div 2] of WideChar;

+ 17 - 8
packages/fcl-db/src/sqldb/sqlite/sqlite3conn.pp

@@ -181,10 +181,11 @@ begin
                 do1:= P.asfloat;
                 checkerror(sqlite3_bind_double(fstatement,I,do1));
                 end;
-        ftstring: begin
-                  str1:= p.asstring;
-                  checkerror(sqlite3_bind_text(fstatement,I,pcharstr(str1), length(str1),@freebindstring));
-                  end;
+        ftstring,
+        ftmemo: begin // According to SQLite documentation, CLOB's (ftMemo) have the Text affinity
+                str1:= p.asstring;
+                checkerror(sqlite3_bind_text(fstatement,I,pcharstr(str1), length(str1),@freebindstring));
+                end;
         ftblob: begin
                 str1:= P.asstring;
                 checkerror(sqlite3_bind_blob(fstatement,I,pcharstr(str1), length(str1),@freebindstring));
@@ -312,7 +313,7 @@ Type
   end;
   
 Const
-  FieldMapCount = 19;
+  FieldMapCount = 20;
   FieldMap : Array [1..FieldMapCount] of TFieldMap = (
    (n:'INT'; t: ftInteger),
    (n:'LARGEINT'; t:ftlargeInt),
@@ -332,6 +333,7 @@ Const
    (n:'NUMERIC'; t: ftBCD),
    (n:'DECIMAL'; t: ftBCD),
    (n:'TEXT'; t: ftmemo),
+   (n:'CLOB'; t: ftmemo),
    (n:'BLOB'; t: ftBlob)
 { Template:
   (n:''; t: ft)
@@ -362,9 +364,16 @@ begin
       ft1:=FieldMap[fi].t;
       break;
       end;
-    // Empty field types are allowed and used in calculated columns (aggregates)
-    // and by pragma-statements
-    if FD='' then ft1 := ftString;
+    // In case of an empty fieldtype (FD='', which is allowed and used in calculated
+    // columns (aggregates) and by pragma-statements) or an unknown fieldtype,
+    // use the field's affinity:
+    if ft1=ftUnknown then
+      case TStorageType(sqlite3_column_type(st,i)) of
+        stInteger: ft1:=ftLargeInt;
+        stFloat:   ft1:=ftFloat;
+        stBlob:    ft1:=ftBlob;
+        else       ft1:=ftString;
+      end;
     // handle some specials.
     size1:=0;
     case ft1 of

+ 1 - 1
packages/fcl-db/tests/sqldbtoolsunit.pas

@@ -42,7 +42,7 @@ const MySQLdbTypes = [mysql40,mysql41,mysql50];
           '',
           'CHAR(10)',
           '',
-          '',
+          'BIGINT',
           '',
           '',
           '',

+ 67 - 2
packages/fcl-db/tests/testfieldtypes.pas

@@ -1,6 +1,7 @@
 unit TestFieldTypes;
 
 {$mode objfpc}{$H+}
+{$modeswitch nestedprocvars}
 
 interface
 
@@ -9,10 +10,10 @@ uses
   db;
 
 type
-
-
   TParamProc = procedure(AParam:TParam; i : integer);
   TFieldProc = procedure(AField:TField; i : integer);
+  TGetSQLTextProc = function(const i: integer) : string; { is nested;}
+  TCheckFieldValueProc = procedure(AField:TField; i : integer) is nested;
 
   { TTestFieldTypes }
 
@@ -20,6 +21,9 @@ type
   private
     procedure CreateTableWithFieldType(ADatatype : TFieldType; ASQLTypeDecl : string);
     procedure TestFieldDeclaration(ADatatype: TFieldType; ADataSize: integer);
+    procedure TestSQLFieldType(ADatatype: TFieldType; ASQLTypeDecl: string;
+      ADataSize: integer; AGetSQLTextProc: TGetSQLTextProc;
+      ACheckFieldValueProc: TCheckFieldValueProc);
     procedure TestXXParamQuery(ADatatype : TFieldType; ASQLTypeDecl : string; testValuescount : integer; Cross : boolean = false);
     procedure TestSetBlobAsParam(asWhat : integer);
   protected
@@ -96,6 +100,10 @@ type
     procedure TestClearUpdateableStatus;
     procedure TestReadOnlyParseSQL; // bug 9254
     procedure TestGetTables;
+
+    // Test SQL-field type recognition
+    procedure TestSQLClob;
+    procedure TestSQLLargeint;
   end;
 
 implementation
@@ -1580,6 +1588,63 @@ begin
     end;
 end;
 
+procedure TTestFieldTypes.TestSQLFieldType(ADatatype : TFieldType; ASQLTypeDecl : string; ADataSize: integer; AGetSQLTextProc: TGetSQLTextProc; ACheckFieldValueProc: TCheckFieldValueProc);
+var
+  i          : byte;
+  s: string;
+begin
+  CreateTableWithFieldType(ADatatype,ASQLTypeDecl);
+  TestFieldDeclaration(ADatatype,ADataSize);
+
+  for i := 0 to testValuesCount-1 do
+    begin
+    s := AGetSQLTextProc(i);
+    TSQLDBConnector(DBConnector).Connection.ExecuteDirect('insert into FPDEV2 (FT) values (' + s + ')');
+    end;
+
+  with TSQLDBConnector(DBConnector).Query do
+    begin
+    Open;
+    for i := 0 to testValuesCount-1 do
+      begin
+      ACheckFieldValueProc(fields[0],i);
+      Next;
+      end;
+    close;
+    end;
+end;
+
+// Placed here, as long as bug 18702 is not solved
+function TestSQLClob_GetSQLText(const a: integer) : string;
+begin
+  result := QuotedStr(testStringValues[a]);
+end;
+
+procedure TTestFieldTypes.TestSQLClob;
+  procedure CheckFieldValue(AField:TField; a : integer);
+  begin
+    AssertEquals(testStringValues[a],AField.AsString);
+  end;
+begin
+  TestSQLFieldType(ftMemo, 'CLOB', 0, @TestSQLClob_GetSQLText, @CheckFieldValue);
+end;
+
+// Placed here, as long as bug 18702 is not solved
+function TestSQLLargeInt_GetSQLText(const a: integer) : string;
+begin
+  result := IntToStr(testLargeIntValues[a]);
+end;
+
+procedure TTestFieldTypes.TestSQLLargeint;
+  procedure CheckFieldValue(AField:TField; a : integer);
+  begin
+    AssertEquals(testLargeIntValues[a],AField.AsLargeInt);
+  end;
+begin
+  TestSQLFieldType(ftLargeint, 'LARGEINT', 8, @TestSQLLargeint_GetSQLText, @CheckFieldValue);
+end;
+
+
 procedure TTestFieldTypes.TestUpdateIndexDefs;
 var ds : TSQLQuery;
 begin

+ 10 - 92
packages/fcl-process/Makefile

@@ -1,8 +1,8 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2010/09/29]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2010/05/05]
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku
 LIMIT83fs = go32v2 os2 emx watcom
@@ -245,7 +245,7 @@ endif
 ifndef CROSSBINDIR
 CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
 endif
-ifneq ($(findstring $(OS_TARGET),darwin iphonesim),)
+ifeq ($(OS_TARGET),darwin)
 ifeq ($(OS_SOURCE),darwin)
 DARWIN2DARWIN=1
 endif
@@ -326,12 +326,6 @@ endif
 ifeq ($(FULL_TARGET),i386-symbian)
 override TARGET_UNITS+=pipes process
 endif
-ifeq ($(FULL_TARGET),i386-nativent)
-override TARGET_UNITS+=pipes process
-endif
-ifeq ($(FULL_TARGET),i386-iphonesim)
-override TARGET_UNITS+=pipes process  simpleipc dbugmsg dbugintf
-endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_UNITS+=pipes process  simpleipc dbugmsg dbugintf
 endif
@@ -395,9 +389,6 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_UNITS+=pipes process  simpleipc dbugmsg dbugintf
 endif
-ifeq ($(FULL_TARGET),x86_64-solaris)
-override TARGET_UNITS+=pipes process  simpleipc dbugmsg dbugintf
-endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
 override TARGET_UNITS+=pipes process  simpleipc dbugmsg dbugintf
 endif
@@ -449,9 +440,6 @@ endif
 ifeq ($(FULL_TARGET),armeb-embedded)
 override TARGET_UNITS+=pipes process
 endif
-ifeq ($(FULL_TARGET),mipsel-linux)
-override TARGET_UNITS+=pipes process  simpleipc dbugmsg dbugintf
-endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_RSTS+=process simpleipc
 endif
@@ -512,12 +500,6 @@ endif
 ifeq ($(FULL_TARGET),i386-symbian)
 override TARGET_RSTS+=process simpleipc
 endif
-ifeq ($(FULL_TARGET),i386-nativent)
-override TARGET_RSTS+=process simpleipc
-endif
-ifeq ($(FULL_TARGET),i386-iphonesim)
-override TARGET_RSTS+=process simpleipc
-endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_RSTS+=process simpleipc
 endif
@@ -581,9 +563,6 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_RSTS+=process simpleipc
 endif
-ifeq ($(FULL_TARGET),x86_64-solaris)
-override TARGET_RSTS+=process simpleipc
-endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
 override TARGET_RSTS+=process simpleipc
 endif
@@ -635,9 +614,6 @@ endif
 ifeq ($(FULL_TARGET),armeb-embedded)
 override TARGET_RSTS+=process simpleipc
 endif
-ifeq ($(FULL_TARGET),mipsel-linux)
-override TARGET_RSTS+=process simpleipc
-endif
 override INSTALL_FPCPACKAGE=y
 ifeq ($(FULL_TARGET),i386-linux)
 override COMPILER_OPTIONS+=-S2h
@@ -699,12 +675,6 @@ endif
 ifeq ($(FULL_TARGET),i386-symbian)
 override COMPILER_OPTIONS+=-S2h
 endif
-ifeq ($(FULL_TARGET),i386-nativent)
-override COMPILER_OPTIONS+=-S2h
-endif
-ifeq ($(FULL_TARGET),i386-iphonesim)
-override COMPILER_OPTIONS+=-S2h
-endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override COMPILER_OPTIONS+=-S2h
 endif
@@ -768,9 +738,6 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_OPTIONS+=-S2h
 endif
-ifeq ($(FULL_TARGET),x86_64-solaris)
-override COMPILER_OPTIONS+=-S2h
-endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
 override COMPILER_OPTIONS+=-S2h
 endif
@@ -822,9 +789,6 @@ endif
 ifeq ($(FULL_TARGET),armeb-embedded)
 override COMPILER_OPTIONS+=-S2h
 endif
-ifeq ($(FULL_TARGET),mipsel-linux)
-override COMPILER_OPTIONS+=-S2h
-endif
 ifeq ($(FULL_TARGET),i386-linux)
 override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src  src/unix src/dummy
 endif
@@ -856,7 +820,7 @@ ifeq ($(FULL_TARGET),i386-qnx)
 override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src  src/unix src/dummy
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src
+override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src  src/dummy
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
 override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src  src/unix src/dummy
@@ -874,7 +838,7 @@ ifeq ($(FULL_TARGET),i386-watcom)
 override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src
+override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src  src/dummy
 endif
 ifeq ($(FULL_TARGET),i386-wince)
 override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src  src/wince src/dummy
@@ -885,12 +849,6 @@ endif
 ifeq ($(FULL_TARGET),i386-symbian)
 override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src
 endif
-ifeq ($(FULL_TARGET),i386-nativent)
-override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src
-endif
-ifeq ($(FULL_TARGET),i386-iphonesim)
-override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src  src/unix src/dummy
-endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src  src/unix src/dummy
 endif
@@ -954,9 +912,6 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src  src/unix src/dummy
 endif
-ifeq ($(FULL_TARGET),x86_64-solaris)
-override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src  src/unix src/dummy
-endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
 override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src  src/unix src/dummy
 endif
@@ -1008,9 +963,6 @@ endif
 ifeq ($(FULL_TARGET),armeb-embedded)
 override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src
 endif
-ifeq ($(FULL_TARGET),mipsel-linux)
-override COMPILER_INCLUDEDIR+=src/$(OS_TARGET) src  src/unix src/dummy
-endif
 ifeq ($(FULL_TARGET),i386-linux)
 override COMPILER_SOURCEDIR+=src/$(OS_TARGET) src
 endif
@@ -1071,12 +1023,6 @@ endif
 ifeq ($(FULL_TARGET),i386-symbian)
 override COMPILER_SOURCEDIR+=src/$(OS_TARGET) src
 endif
-ifeq ($(FULL_TARGET),i386-nativent)
-override COMPILER_SOURCEDIR+=src/$(OS_TARGET) src
-endif
-ifeq ($(FULL_TARGET),i386-iphonesim)
-override COMPILER_SOURCEDIR+=src/$(OS_TARGET) src
-endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override COMPILER_SOURCEDIR+=src/$(OS_TARGET) src
 endif
@@ -1140,9 +1086,6 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_SOURCEDIR+=src/$(OS_TARGET) src
 endif
-ifeq ($(FULL_TARGET),x86_64-solaris)
-override COMPILER_SOURCEDIR+=src/$(OS_TARGET) src
-endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
 override COMPILER_SOURCEDIR+=src/$(OS_TARGET) src
 endif
@@ -1194,9 +1137,6 @@ endif
 ifeq ($(FULL_TARGET),armeb-embedded)
 override COMPILER_SOURCEDIR+=src/$(OS_TARGET) src
 endif
-ifeq ($(FULL_TARGET),mipsel-linux)
-override COMPILER_SOURCEDIR+=src/$(OS_TARGET) src
-endif
 ifdef REQUIRE_UNITSDIR
 override UNITSDIR+=$(REQUIRE_UNITSDIR)
 endif
@@ -1524,7 +1464,7 @@ DEBUGSYMEXT=.xcoff
 SHORTSUFFIX=mac
 IMPORTLIBPREFIX=imp
 endif
-ifneq ($(findstring $(OS_TARGET),darwin iphonesim),)
+ifeq ($(OS_TARGET),darwin)
 BATCHEXT=.sh
 EXEEXT=
 HASSHAREDLIB=1
@@ -1539,10 +1479,6 @@ ifeq ($(OS_TARGET),symbian)
 SHAREDLIBEXT=.dll
 SHORTSUFFIX=symbian
 endif
-ifeq ($(OS_TARGET),NativeNT)
-SHAREDLIBEXT=.dll
-SHORTSUFFIX=nativent
-endif
 else
 ifeq ($(OS_TARGET),go32v1)
 PPUEXT=.pp1
@@ -2028,12 +1964,6 @@ endif
 ifeq ($(FULL_TARGET),i386-symbian)
 REQUIRE_PACKAGES_RTL=1
 endif
-ifeq ($(FULL_TARGET),i386-nativent)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),i386-iphonesim)
-REQUIRE_PACKAGES_RTL=1
-endif
 ifeq ($(FULL_TARGET),m68k-linux)
 REQUIRE_PACKAGES_RTL=1
 endif
@@ -2097,9 +2027,6 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 REQUIRE_PACKAGES_RTL=1
 endif
-ifeq ($(FULL_TARGET),x86_64-solaris)
-REQUIRE_PACKAGES_RTL=1
-endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
 REQUIRE_PACKAGES_RTL=1
 endif
@@ -2151,9 +2078,6 @@ endif
 ifeq ($(FULL_TARGET),armeb-embedded)
 REQUIRE_PACKAGES_RTL=1
 endif
-ifeq ($(FULL_TARGET),mipsel-linux)
-REQUIRE_PACKAGES_RTL=1
-endif
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_RTL),)
@@ -2163,9 +2087,9 @@ else
 UNITDIR_RTL=$(PACKAGEDIR_RTL)
 endif
 ifdef CHECKDEPEND
-$(PACKAGEDIR_RTL)/$(OS_TARGET)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_RTL)/$(OS_TARGET) $(FPCMADE)
-override ALLDEPENDENCIES+=$(PACKAGEDIR_RTL)/$(OS_TARGET)/$(FPCMADE)
+$(PACKAGEDIR_RTL)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_RTL) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
 endif
 else
 PACKAGEDIR_RTL=
@@ -2535,7 +2459,7 @@ ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))
 ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))
 ifdef USETAR
 ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(TAREXT)
-ZIPCMD_ZIP:=$(TARPROG) c$(TAROPT)f $(ZIPDESTFILE) *
+ZIPCMD_ZIP:=$(TARPROG) cf$(TAROPT) $(ZIPDESTFILE) *
 else
 ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(ZIPEXT)
 ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDESTFILE) *
@@ -2580,9 +2504,6 @@ fpc_zipdistinstall:
 ifdef EXEFILES
 override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
 endif
-ifdef CLEAN_PROGRAMS
-override CLEANEXEFILES+=$(addprefix $(TARGETDIRPREFIX),$(addsuffix $(EXEEXT), $(CLEAN_PROGRAMS)))
-endif
 ifdef CLEAN_UNITS
 override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
 endif
@@ -2629,9 +2550,6 @@ endif
 ifdef CLEANRSTFILES
 	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
 endif
-endif
-ifdef CLEAN_FILES
-	-$(DEL) $(CLEAN_FILES)
 endif
 	-$(DELTREE) units
 	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)

+ 2 - 0
packages/fcl-process/Makefile.fpc

@@ -46,6 +46,8 @@ includedir_go32v2=src/dummy
 includedir_os2=src/os2 src/dummy
 includedir_morphos=src/dummy
 includedir_amiga=src/dummy
+includedir_netware=src/dummy
+includedir_netwlibc=src/dummy
 sourcedir=src/$(OS_TARGET) src
 
 [install]

+ 7 - 1
packages/fcl-web/src/base/fpweb.pp

@@ -449,7 +449,12 @@ begin
   InitSession(AResponse);
   If Assigned(FOnRequest) then
     FOnRequest(Self,ARequest,AResponse,B);
-  If Not B then
+  If B then
+    begin
+    if not AResponse.ContentSent then
+      AResponse.SendContent;
+    end
+  else
     if FTemplate.HasContent then
       GetTemplateContent(ARequest,AResponse)
     else
@@ -460,6 +465,7 @@ begin
       If Not B then
         Raise EFPWebError.Create(SErrRequestNotHandled);
       end;
+      
   DoAfterResponse(AResponse);
   UpdateSession(AResponse);
   FRequest := Nil;

+ 88 - 30
packages/fpvectorial/src/dxfvectorialreader.pas

@@ -66,8 +66,13 @@ type
 
   TvDXFVectorialReader = class(TvCustomVectorialReader)
   private
+    FPointSeparator: TFormatSettings;
+    // HEADER data
+    ANGBASE: Double;
+    ANGDIR: Integer;
     //
     function  SeparateString(AString: string; ASeparator: Char): T10Strings;
+    procedure ReadHEADER(ATokens: TDXFTokens; AData: TvVectorialDocument);
     procedure ReadENTITIES(ATokens: TDXFTokens; AData: TvVectorialDocument);
     procedure ReadENTITIES_LINE(ATokens: TDXFTokens; AData: TvVectorialDocument);
     procedure ReadENTITIES_ARC(ATokens: TDXFTokens; AData: TvVectorialDocument);
@@ -85,12 +90,24 @@ type
 
 implementation
 
+{$ifndef Windows}
 {$define FPVECTORIALDEBUG}
+{$endif}
 
 const
+  // Items in the HEADER section
+
+  // $ACADVER
+  DXF_AUTOCAD_R10         = 'AC1006'; // 1988
+  DXF_AUTOCAD_R11_and_R12 = 'AC1009'; // 1990
+  DXF_AUTOCAD_R13         = 'AC1012'; // 1994
+  DXF_AUTOCAD_R14         = 'AC1009'; // 1997  http://www.autodesk.com/techpubs/autocad/acadr14/dxf/index.htm
+  DXF_AUTOCAD_2000        = 'AC1500'; // 1999  http://www.autodesk.com/techpubs/autocad/acad2000/dxf/
+
   // Group Codes for ENTITIES
   DXF_ENTITIES_TYPE = 0;
   DXF_ENTITIES_HANDLE = 5;
+  DXF_ENTITIES_LINETYPE_NAME = 6;
   DXF_ENTITIES_APPLICATION_GROUP = 102;
   DXF_ENTITIES_AcDbEntity = 100;
   DXF_ENTITIES_MODEL_OR_PAPER_SPACE = 67; // default=0=model, 1=paper
@@ -306,6 +323,33 @@ begin
   end;
 end;
 
+procedure TvDXFVectorialReader.ReadHEADER(ATokens: TDXFTokens;
+  AData: TvVectorialDocument);
+var
+  i: Integer;
+  CurToken: TDXFToken;
+begin
+  i := 0;
+  while i < ATokens.Count do
+  begin
+    CurToken := TDXFToken(ATokens.Items[i]);
+    if CurToken.StrValue = '$ANGBASE' then
+    begin
+      CurToken := TDXFToken(ATokens.Items[i+1]);
+      ANGBASE := StrToFloat(CurToken.StrValue, FPointSeparator);
+      Inc(i);
+    end
+    else if CurToken.StrValue = '$ANGDIR' then
+    begin
+      CurToken := TDXFToken(ATokens.Items[i+1]);
+      ANGDIR := StrToInt(CurToken.StrValue);
+      Inc(i);
+    end;
+
+    Inc(i);
+  end;
+end;
+
 procedure TvDXFVectorialReader.ReadENTITIES(ATokens: TDXFTokens; AData: TvVectorialDocument);
 var
   i: Integer;
@@ -314,7 +358,8 @@ begin
   for i := 0 to ATokens.Count - 1 do
   begin
     CurToken := TDXFToken(ATokens.Items[i]);
-    if CurToken.StrValue = 'CIRCLE' then ReadENTITIES_CIRCLE(CurToken.Childs, AData)
+    if CurToken.StrValue = 'ARC' then ReadENTITIES_ARC(CurToken.Childs, AData)
+    else if CurToken.StrValue = 'CIRCLE' then ReadENTITIES_CIRCLE(CurToken.Childs, AData)
     else if CurToken.StrValue = 'ELLIPSE' then ReadENTITIES_ELLIPSE(CurToken.Childs, AData)
     else if CurToken.StrValue = 'LINE' then ReadENTITIES_LINE(CurToken.Childs, AData)
     else if CurToken.StrValue = 'TEXT' then
@@ -346,10 +391,10 @@ begin
     CurToken := TDXFToken(ATokens.Items[i]);
 
     // Avoid an exception by previously checking if the conversion can be made
-    if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or
-      (CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue;
-
-    CurToken.FloatValue :=  StrToFloat(Trim(CurToken.StrValue));
+    if CurToken.GroupCode in [10, 20, 30, 11, 21, 31] then
+    begin
+      CurToken.FloatValue :=  StrToFloat(Trim(CurToken.StrValue), FPointSeparator);
+    end;
 
     case CurToken.GroupCode of
       10: LineStartX := CurToken.FloatValue;
@@ -377,8 +422,8 @@ end;
 20, 30 DXF: Y and Z values of center point (in OCS)
 40 Radius
 100 Subclass marker (AcDbArc)
-50 Start angle
-51 End angle
+50 Start angle (degrees)
+51 End angle (degrees)
 210 Extrusion direction. (optional; default = 0, 0, 1) DXF: X value; APP: 3D vector
 220, 230 DXF: Y and Z values of extrusion direction (optional)
 }
@@ -402,16 +447,18 @@ begin
     CurToken := TDXFToken(ATokens.Items[i]);
 
     // Avoid an exception by previously checking if the conversion can be made
-    if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or
-      (CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue;
-
-    CurToken.FloatValue :=  StrToFloat(Trim(CurToken.StrValue));
+    if CurToken.GroupCode in [10, 20, 30, 40, 50, 51] then
+    begin
+      CurToken.FloatValue :=  StrToFloat(Trim(CurToken.StrValue), FPointSeparator);
+    end;
 
     case CurToken.GroupCode of
       10: CenterX := CurToken.FloatValue;
       20: CenterY := CurToken.FloatValue;
       30: CenterZ := CurToken.FloatValue;
       40: Radius := CurToken.FloatValue;
+      50: StartAngle := CurToken.FloatValue;
+      51: EndAngle := CurToken.FloatValue;
     end;
   end;
 
@@ -446,10 +493,10 @@ begin
     CurToken := TDXFToken(ATokens.Items[i]);
 
     // Avoid an exception by previously checking if the conversion can be made
-    if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or
-      (CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue;
-
-    CurToken.FloatValue :=  StrToFloat(Trim(CurToken.StrValue));
+    if CurToken.GroupCode in [10, 20, 30, 40] then
+    begin
+      CurToken.FloatValue :=  StrToFloat(Trim(CurToken.StrValue), FPointSeparator);
+    end;
 
     case CurToken.GroupCode of
       10: CircleCenterX := CurToken.FloatValue;
@@ -488,17 +535,16 @@ begin
     CurToken := TDXFToken(ATokens.Items[i]);
 
     // Avoid an exception by previously checking if the conversion can be made
-    if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or
-      (CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue;
-
-    CurToken.FloatValue :=  StrToFloat(Trim(CurToken.StrValue));
+    if CurToken.GroupCode in [10, 20, 30] then
+    begin
+      CurToken.FloatValue :=  StrToFloat(Trim(CurToken.StrValue), FPointSeparator);
+    end;
 
     case CurToken.GroupCode of
       10: CenterX := CurToken.FloatValue;
       20: CenterY := CurToken.FloatValue;
       30: CenterZ := CurToken.FloatValue;
     end;
-
   end;
 
   //
@@ -542,8 +588,11 @@ procedure TvDXFVectorialReader.ReadENTITIES_TEXT(ATokens: TDXFTokens;
 var
   CurToken: TDXFToken;
   i: Integer;
-  PosX, PosY, PosZ: Double;
-  Str: string;
+  PosX: Double = 0.0;
+  PosY: Double = 0.0;
+  PosZ: Double = 0.0;
+  FontSize: Double = 10.0;
+  Str: string = '';
 begin
   for i := 0 to ATokens.Count - 1 do
   begin
@@ -551,23 +600,22 @@ begin
     CurToken := TDXFToken(ATokens.Items[i]);
 
     // Avoid an exception by previously checking if the conversion can be made
-    if (CurToken.GroupCode = DXF_ENTITIES_HANDLE) or
-      (CurToken.GroupCode = 1) or
-      (CurToken.GroupCode = DXF_ENTITIES_AcDbEntity) then Continue;
-
-    CurToken.FloatValue :=  StrToFloat(Trim(CurToken.StrValue));
+    if CurToken.GroupCode in [10, 20, 30, 40] then
+    begin
+      CurToken.FloatValue :=  StrToFloat(Trim(CurToken.StrValue), FPointSeparator);
+    end;
 
     case CurToken.GroupCode of
       1:  Str := CurToken.StrValue;
       10: PosX := CurToken.FloatValue;
       20: PosY := CurToken.FloatValue;
       30: PosZ := CurToken.FloatValue;
+      40: FontSize := CurToken.FloatValue;
     end;
-
   end;
 
   //
-//  AData.AddEllipse(CenterX, CenterY, CenterZ, MajorHalfAxis, MinorHalfAxis, Angle);
+  AData.AddText(PosX, PosY, PosZ, '', Round(FontSize), Str);
 end;
 
 function TvDXFVectorialReader.GetCoordinateValue(AStr: shortstring): Double;
@@ -583,6 +631,14 @@ constructor TvDXFVectorialReader.Create;
 begin
   inherited Create;
 
+  FPointSeparator := DefaultFormatSettings;
+  FPointSeparator.DecimalSeparator := '.';
+  FPointSeparator.ThousandSeparator := '#';// disable the thousand separator
+
+  // Default HEADER data
+  ANGBASE := 0.0; // Starts pointing to the right / east
+  ANGDIR := 0; // counter-clock wise
+
   Tokenizer := TDXFTokenizer.Create;
 end;
 
@@ -610,7 +666,9 @@ begin
     CurToken := TDXFToken(Tokenizer.Tokens.Items[i]);
     CurTokenFirstChild := TDXFToken(CurToken.Childs.Items[0]);
 
-    if CurTokenFirstChild.StrValue = 'ENTITIES' then
+    if CurTokenFirstChild.StrValue = 'HEADER' then
+      ReadHEADER(CurToken.Childs, AData)
+    else if CurTokenFirstChild.StrValue = 'ENTITIES' then
       ReadENTITIES(CurToken.Childs, AData);
   end;
 end;

+ 2 - 1
packages/fpvectorial/src/fpvectorial.pas

@@ -139,6 +139,7 @@ type
   TvCircularArc = class(TvEntity)
   public
     CenterX, CenterY, CenterZ, Radius: Double;
+    {@@ The Angle is measured in degrees in relation to the positive X axis }
     StartAngle, EndAngle: Double;
   end;
 
@@ -151,7 +152,7 @@ type
   public
     // Mandatory fields
     CenterX, CenterY, CenterZ, MajorHalfAxis, MinorHalfAxis: Double;
-    {@@ The Angle is measured in radians in relation to the positive X axis }
+    {@@ The Angle is measured in degrees in relation to the positive X axis }
     Angle: Double;
     // Calculated fields
     BoundingRect: TRect;

+ 76 - 21
packages/fpvectorial/src/fpvtocanvas.pas

@@ -4,17 +4,28 @@ unit fpvtocanvas;
 
 interface
 
+{.$define USE_LCL_CANVAS}
+
 uses
-  Classes, SysUtils,
+  Classes, SysUtils, Math,
+  {$ifdef USE_LCL_CANVAS}
+  Graphics, LCLIntf,
+  {$else}
   fpcanvas,
+  {$endif}
   fpvectorial;
 
-procedure DrawFPVectorialToCanvas(ASource: TvVectorialDocument; ADest: TFPCustomCanvas;
+procedure DrawFPVectorialToCanvas(ASource: TvVectorialDocument;
+  {$ifdef USE_LCL_CANVAS}
+  ADest: TCanvas;
+  {$else}
+  ADest: TFPCustomCanvas;
+  {$endif}
   ADestX: Integer = 0; ADestY: Integer = 0; AMulX: Double = 1.0; AMulY: Double = 1.0);
 
 implementation
 
-{function Rotate2DPoint(P,Fix :TPoint; alpha:double): TPoint;
+function Rotate2DPoint(P,Fix :TPoint; alpha:double): TPoint;
 var
   sinus, cosinus : Extended;
 begin
@@ -23,31 +34,46 @@ begin
   P.y := P.y - Fix.y;
   result.x := Round(p.x*cosinus + p.y*sinus)  +  fix.x ;
   result.y := Round(-p.x*sinus + p.y*cosinus) +  Fix.y;
-end;}
+end;
 
-procedure DrawRotatedEllipse(ADest: TFPCustomCanvas; CurEllipse: TvEllipse);
-{var
+procedure DrawRotatedEllipse(
+  {$ifdef USE_LCL_CANVAS}
+  ADest: TCanvas;
+  {$else}
+  ADest: TFPCustomCanvas;
+  {$endif}
+  CurEllipse: TvEllipse;
+  ADestX: Integer = 0; ADestY: Integer = 0; AMulX: Double = 1.0; AMulY: Double = 1.0);
+var
   PointList: array[0..6] of TPoint;
   f: TPoint;
-  dk: Integer;}
+  dk, x1, x2, y1, y2: Integer;
 begin
-{  dk := Round(0.654 * Abs(y2-y1));
-  f.x := CurEllipse.CenterX;
-  f.y := CurEllipse.CenterY - 1;
-  PointList[0] := Rotate2DPoint(Point(x1, f.y), f, Alpha) ;  // Startpoint
-  PointList[1] := Rotate2DPoint(Point(x1,  f.y - dk), f, Alpha);
+  {$ifdef USE_LCL_CANVAS}
+  CurEllipse.CalculateBoundingRectangle();
+  x1 := CurEllipse.BoundingRect.Left;
+  x2 := CurEllipse.BoundingRect.Right;
+  y1 := CurEllipse.BoundingRect.Top;
+  y2 := CurEllipse.BoundingRect.Bottom;
+
+  dk := Round(0.654 * Abs(y2-y1));
+  f.x := Round(CurEllipse.CenterX);
+  f.y := Round(CurEllipse.CenterY - 1);
+  PointList[0] := Rotate2DPoint(Point(x1, f.y), f, CurEllipse.Angle) ;  // Startpoint
+  PointList[1] := Rotate2DPoint(Point(x1,  f.y - dk), f, CurEllipse.Angle);
   //Controlpoint of Startpoint first part
-  PointList[2] := Rotate2DPoint(Point(x2- 1,  f.y - dk), f, Alpha);
+  PointList[2] := Rotate2DPoint(Point(x2- 1,  f.y - dk), f, CurEllipse.Angle);
   //Controlpoint of secondpoint first part
-  PointList[3] := Rotate2DPoint(Point(x2 -1 , f.y), f, Alpha);
+  PointList[3] := Rotate2DPoint(Point(x2 -1 , f.y), f, CurEllipse.Angle);
   // Firstpoint of secondpart
-  PointList[4] := Rotate2DPoint(Point(x2-1 , f.y + dk), f, Alpha);
+  PointList[4] := Rotate2DPoint(Point(x2-1 , f.y + dk), f, CurEllipse.Angle);
   // Controllpoint of secondpart firstpoint
-  PointList[5] := Rotate2DPoint(Point(x1, f.y +  dk), f, Alpha);
+  PointList[5] := Rotate2DPoint(Point(x1, f.y +  dk), f, CurEllipse.Angle);
   // Conrollpoint of secondpart endpoint
   PointList[6] := PointList[0];   // Endpoint of
    // Back to the startpoint
-  PolyBezier(canvas.handle, Pointlist[0], 7);}
+  ADest.PolyBezier(Pointlist[0]);
+  {$endif}
 end;
 
 {@@
@@ -64,7 +90,12 @@ end;
 
   DrawFPVectorialToCanvas(ASource, ADest, 0, ASource.Height, 1.0, -1.0);
 }
-procedure DrawFPVectorialToCanvas(ASource: TvVectorialDocument; ADest: TFPCustomCanvas;
+procedure DrawFPVectorialToCanvas(ASource: TvVectorialDocument;
+  {$ifdef USE_LCL_CANVAS}
+  ADest: TCanvas;
+  {$else}
+  ADest: TFPCustomCanvas;
+  {$endif}
   ADestX: Integer = 0; ADestY: Integer = 0; AMulX: Double = 1.0; AMulY: Double = 1.0);
 var
   i, j, k: Integer;
@@ -76,11 +107,13 @@ var
   CurX, CurY: Integer; // Not modified by ADestX, etc
   CurveLength: Integer;
   t: Double;
+  // For text
+  CurText: TvText;
   // For entities
   CurEntity: TvEntity;
   CurCircle: TvCircle;
   CurEllipse: TvEllipse;
-  CurCircularArc: TvCircularArc;
+  CurArc: TvCircularArc;
 begin
   {$ifdef FPVECTORIALDEBUG}
   WriteLn(':>DrawFPVectorialToCanvas');
@@ -91,6 +124,7 @@ begin
 
   ADest.MoveTo(ADestX, ADestY);
 
+  // Draws all paths
   for i := 0 to ASource.PathCount - 1 do
   begin
     //WriteLn('i = ', i);
@@ -141,6 +175,7 @@ begin
     end;
   end;
 
+  // Draws all entities
   for i := 0 to ASource.GetEntityCount - 1 do
   begin
     CurEntity := ASource.GetEntity(i);
@@ -161,11 +196,31 @@ begin
     end
     else if CurEntity is TvCircularArc then
     begin
-      CurCircularArc := CurEntity as TvCircularArc;
-//      ADest.Arc(ADest, CurEllipse);
+      CurArc := CurEntity as TvCircularArc;
+      {$ifdef USE_LCL_CANVAS}
+      // Arc(ALeft, ATop, ARight, ABottom, Angle16Deg, Angle16DegLength: Integer);
+      ADest.Arc(
+        Round(ADestX + AmulX * (CurArc.CenterX - CurArc.Radius)),
+        Round(ADestY + AmulY * (CurArc.CenterY - CurArc.Radius)),
+        Round(ADestX + AmulX * (CurArc.CenterX + CurArc.Radius)),
+        Round(ADestY + AmulY * (CurArc.CenterY + CurArc.Radius)),
+        Round(16*CurArc.StartAngle),
+        Round(16*CurArc.EndAngle - CurArc.StartAngle)
+        );
+      {$endif}
     end;
   end;
 
+  // Draws all text
+  for i := 0 to ASource.GetTextCount - 1 do
+  begin
+    CurText := ASource.GetText(i);
+    ADest.Font.Height := Round(AmulY * CurText.FontSize);
+    ADest.Pen.Style := psSolid;
+    ADest.Pen.Color := clBlack;
+    ADest.TextOut(Round(CurText.X), Round(CurText.Y), CurText.Value);
+  end;
+
   {$ifdef FPVECTORIALDEBUG}
   WriteLn(':<DrawFPVectorialToCanvas');
   {$endif}

+ 1 - 1
packages/libgbafpc/src/gba.pp

@@ -14,8 +14,8 @@ uses
 {$linklib gba}
 
 {$linklib c}
-{$linklib g}
 {$linklib gcc}
+{$linklib g}
 {$linklib sysbase}
 
 {$define GBA_INTERFACE}

+ 12 - 0
packages/libgd/src/gd.pas

@@ -42,6 +42,18 @@ uses
     gdlib = 'libgd.'+sharedsuffix;
     clib = 'libc.'+sharedsuffix;
 {$ENDIF}
+{$IFDEF NETWARE}
+  {$DEFINE EXTDECL := cdecl}
+  const
+    gdlib = 'libgd.nlm';
+    clib = 'clib.nlm';
+{$ENDIF}
+{$IFDEF NETWLIBC}
+  {$DEFINE EXTDECL := cdecl}
+  const
+    gdlib = 'libgd.nlm';
+    clib = 'libc.nlm';
+{$ENDIF}
 {$IFDEF WINDOWS}
   {$DEFINE EXTDECL := stdcall}
   const

+ 0 - 93
packages/libndsfpc/examples/RealTimeClock/Watch/Makefile.fpc

@@ -1,93 +0,0 @@
-#
-#   Makefile.fpc for Free Pascal libndsfpc 2.x.y Examples
-#
-
-[target]
-loaders= 
-programs=watch
-
-[require]
-packages=libndsfpc
-tools=bin2s mmutil grit rmdir
-nortl=y
-
-[install]
-fpcpackage=y
-
-[default]
-cpu=arm
-target=nds
-fpcdir=../../../../..
-
-[compiler]
-options=-g -Xm
-#-d__THUMB__
-
-[clean]
-files=*.elf *.o *.s *.nds *.nef *.h *.bin \
-       $(BUILD)/* \
-       $(INC)/*
-units=*
-
-[prerules]
-BUILD = build
-INC = inc
-AUDIO_FILES = $(foreach dir, $(notdir $(wildcard audio/*.*)), $(CURDIR)/audio/$(dir))
-GFX_FILES = $(foreach dir,gfx,$(notdir $(wildcard $(dir)/*.png)))
-BIN_FILES = $(foreach dir,data,$(notdir $(wildcard $(dir)/*)))
-
-[rules]
-.NOTPARALLEL:
-clean: dir_delete fpc_clean fpc_cleanall
-all: dir_make $(BIN_FILES) $(GFX_FILES) fpc_all 
-
-#
-# Delete temp directories
-#
-dir_delete:
-        @$(DELTREE) $(CURDIR)/$(BUILD) 
-        @$(DELTREE) $(CURDIR)/$(INC) 
-        
-#
-# Create temp directories
-#
-dir_make:
-ifneq ($(BUILD), $(CURDIR))
-        @$(MKDIR) $(BUILD)
-endif
-ifneq ($(INC), $(CURDIR))
-        @$(MKDIR) $(INC)
-endif
-
-#
-# Audio files processing rule
-#
-soundbank.bin.o : $(AUDIO_FILES)
-        @$(MMUTIL) $^ -d -o$(BUILD)/soundbank.bin -h$(BUILD)/soundbank.h
-        $(BIN2S) $(BUILD)/soundbank.bin > $(BUILD)/soundbank.bin.s
-        $(AS) -o $(BUILD)/soundbank.bin.o $(BUILD)/soundbank.bin.s
-
-#
-# Png files processing rule
-#
-$(GFX_FILES): $(wildcard %.png) 
-        @echo 'Converting $(@) file to asm...'
-        $(GRIT) gfx/$(@) -fts -ff gfx/$(basename $(@)).grit -o$(BUILD)/$(@)
-        @echo 'Assembling $(@).s file...'
-        $(AS) -o $(BUILD)/$(basename $(@)).o $(BUILD)/$(basename $(@)).s
-        @echo 'Done!'
-
-#
-# Binary files processing rule
-# 
-$(BIN_FILES): $(wildcard %.*)
-        @echo 'Converting $(@) file to asm...'
-        @$(BIN2S) data/$(@) > $(BUILD)/$(@).s
-        @echo 'Creating $(@).inc include file...'
-        @echo "var" > `(echo "inc/"$(@F) | tr . .)`.inc
-        @echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end: array [0..0] of cuint8; cvar; external;" >> `(echo "inc/"$(@F) | tr . .)`.inc
-        @echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`": array [0..0] of cuint8; cvar; external;" >> `(echo "inc/"$(@F) | tr . .)`.inc
-        @echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size": cuint32; cvar; external;" >> `(echo "inc/"$(@F) | tr . .)`.inc
-        @echo 'Assembling $(@).s file...'
-        @$(AS) -o $(BUILD)/$(@).o $(BUILD)/$(@).s
-        @echo 'Done!'

+ 8 - 3
packages/libndsfpc/examples/graphics/3D/3D_Both_Screens/3DBothScreens.pp

@@ -104,6 +104,7 @@ procedure initSubSprites();
 var
   x: integer;
   y: integer;
+  id: integer;
   offset: pcuint16;
 begin
   oamInit(oamSub, SpriteMapping_Bmp_2D_256, false);
@@ -115,9 +116,13 @@ begin
   for y := 0 to 2 do
     for x := 0 to 3 do
     begin
-      offset := pcuint16(@SPRITE_GFX_SUB[(x * 64) + (y * 64 * 256)]);
-      oamSet(oamSub, x + y * 4, x * 64, y * 64, 0, 15, SpriteSize_64x64, 
-			SpriteColorFormat_Bmp, offset, -1, false,false,false,false,false);
+//      offset := pcuint16(@SPRITE_GFX_SUB[(x * 64) + (y * 64 * 256)]);
+//      oamSet(oamSub, x + y * 4, x * 64, y * 64, 0, 15, SpriteSize_64x64, 
+//      SpriteColorFormat_Bmp, offset, -1, false,false,false,false,false);
+      oamSub.oamMemory[id].attribute[0] := ATTR0_BMP or ATTR0_SQUARE or (64 * y);
+      oamSub.oamMemory[id].attribute[1] := ATTR1_SIZE_64 or (64 * x);
+      oamSub.oamMemory[id].attribute[2] := ATTR2_ALPHA(1) or (8 * 32 * y) or (8 * x);
+      inc(id);
     end;
  
   swiWaitForVBlank();

+ 1 - 1
packages/libndsfpc/examples/graphics/3D/Display_List/DisplayList.pp

@@ -61,7 +61,7 @@ begin
     glPushMatrix();
 
     //move it away from the camera
-    glTranslate3f32(0, 0, floattof32(-1.0));
+    glTranslatef32(0, 0, floattof32(-1.0));
 
     glRotateX(rotateX);
     glRotateY(rotateY);

+ 1 - 1
packages/libndsfpc/examples/graphics/3D/Env_Mapping/EnvMapping.pp

@@ -98,7 +98,7 @@ begin
 
 		glMatrixMode(GL_POSITION);
 		glLoadIdentity();
-		glTranslate3f32(0, 0, floattof32(-3));
+		glTranslatef32(0, 0, floattof32(-3));
 		glRotateXi(rotateX);
 		glRotateYi(rotateY);
 

+ 10 - 4
packages/libndsfpc/examples/graphics/3D/Paletted_Cube/PalettedCube.pp

@@ -129,7 +129,7 @@ type
 var
   textureIDS: array [0..9] of cint;
   textures: array [0..9] of TTextures;
-  i: integer;
+  i, j: integer;
   rotateX: cfloat = 0.0;
   rotateY: cfloat = 0.0;
   keyspressed: cuint16;
@@ -143,7 +143,7 @@ begin
   //set mode 0, enable BG0 and set it to 3D
   videoSetMode(MODE_0_3D);
   consoleDemoInit();
-
+  consoleDebugInit(DebugDevice_NOCASH);
 
   // initialize gl
   glInit();
@@ -175,7 +175,9 @@ begin
   glLight(0, RGB15(31,31,31) , 0, floattov10(-0.5), floattov10(-0.85));
 
   vramSetBankA(VRAM_A_TEXTURE);
-
+  vramSetBankF(VRAM_F_TEX_PALETTE_SLOT0);
+  vramSetBankG(VRAM_G_TEX_PALETTE_SLOT1);
+	
   glGenTextures(10, textureIDS);
 
   // inital full 16 bit colour texture
@@ -235,7 +237,10 @@ begin
   glBindTexture(0, textureIDS[8]);
   glTexImage2D(0, 0, GL_RGB32_A3, TEXTURE_SIZE_128, TEXTURE_SIZE_128, 0, TEXGEN_TEXCOORD, pcuint8(@texture8_RGB32_A3_tex_bin));
   textures[8].format := GL_RGB32_A3;
-  textures[8].pal_addr := gluTexLoadPal( pcuint16(@texture8_RGB32_A3_pal_bin), 32, GL_RGB32_A3 );
+	// this line seems stupid, but for purposes of a demo, it will prove that you can 
+	// load palettes to F and G by pushing the allocated textures from F and into G
+  for i := 0 to 299 do
+    textures[8].pal_addr := gluTexLoadPal( pcuint16(@texture8_RGB32_A3_pal_bin), 32, GL_RGB32_A3 );
   textures[8].size := texture8_RGB32_A3_tex_bin_size+texture8_RGB32_A3_pal_bin_size;
 
   glBindTexture(0, textureIDS[9]);
@@ -304,6 +309,7 @@ begin
     glPopMatrix(1);
 
     glFlush(0);
+    swiWaitForVBlank();
   end;
 
 end.

+ 6 - 6
packages/libndsfpc/examples/graphics/3D/Picking/Picking.pp

@@ -110,7 +110,7 @@ begin
 			glPushMatrix(); // save the state of the modelview matrix while making the first pass
 				// draw the scene for displaying
 				
-				glTranslate3f32(floattof32(2.9),floattof32(0),floattof32(0)); // translate the modelview matrix to the drawing location
+				glTranslatef32(floattof32(2.9),floattof32(0),floattof32(0)); // translate the modelview matrix to the drawing location
 				if (clicked = clCone) then
 					glPolyFmt(POLY_ALPHA(31) or POLY_CULL_BACK or POLY_FORMAT_LIGHT0 or POLY_ID(1)) // set a poly ID for outlining
 				else
@@ -119,7 +119,7 @@ begin
 				glCallList((@cone_bin)); // draw a green cone from a predefined packed command list
 
 				
-				glTranslate3f32(floattof32(-3),floattof32(1.8),floattof32(2)); // translate the modelview matrix to the drawing location
+				glTranslatef32(floattof32(-3),floattof32(1.8),floattof32(2)); // translate the modelview matrix to the drawing location
 				if (clicked = clCylinder) then
 					glPolyFmt(POLY_ALPHA(31) or POLY_CULL_BACK or POLY_FORMAT_LIGHT0 or POLY_ID(1)) // set a poly ID for outlining
 				else
@@ -128,7 +128,7 @@ begin
         glCallList((@cylinder_bin)); // draw a blue cylinder from a predefined packed command list
 
 
-				glTranslate3f32(floattof32(0.5),floattof32(-2.6),floattof32(-4)); // translate the modelview matrix to the drawing location
+				glTranslatef32(floattof32(0.5),floattof32(-2.6),floattof32(-4)); // translate the modelview matrix to the drawing location
 				if(clicked = clSphere) then
 					glPolyFmt(POLY_ALPHA(31) or POLY_CULL_BACK or POLY_FORMAT_LIGHT0 or POLY_ID(1)) // set a poly ID for outlining
 				else
@@ -153,17 +153,17 @@ begin
 				
 				glMatrixMode(GL_MODELVIEW); // switch back to modifying the modelview matrix for drawing
 				
-				glTranslate3f32(floattof32(2.9),floattof32(0),floattof32(0)); // translate the modelview matrix to the drawing location
+				glTranslatef32(floattof32(2.9),floattof32(0),floattof32(0)); // translate the modelview matrix to the drawing location
 				startCheck();
 				glCallList((@cone_bin)); // draw a cone from a predefined packed command list
 				endCheck(clCone);
 
-				glTranslate3f32(floattof32(-3),floattof32(1.8),floattof32(2)); // translate the modelview matrix to the drawing location
+				glTranslatef32(floattof32(-3),floattof32(1.8),floattof32(2)); // translate the modelview matrix to the drawing location
 				startCheck();
 				glCallList((@cylinder_bin)); // draw a cylinder from a predefined packed command list
 				endCheck(clCylinder);
 
-				glTranslate3f32(floattof32(0.5),floattof32(-2.6),floattof32(-4)); // translate the modelview matrix to the drawing location
+				glTranslatef32(floattof32(0.5),floattof32(-2.6),floattof32(-4)); // translate the modelview matrix to the drawing location
 				startCheck();
 				glCallList((@sphere_bin)); // draw a sphere from a predefined packed command list
 				endCheck(clSphere);

+ 1 - 1
packages/libndsfpc/examples/graphics/3D/Simple_Quad/SimpleQuad.pp

@@ -42,7 +42,7 @@ begin
     glPushMatrix();
 
     //move it away from the camera
-    glTranslate3f32(0, 0, floattof32(-1));
+    glTranslatef32(0, 0, floattof32(-1));
 
     glRotateX(rotateX);
     glRotateY(rotateY);

+ 1 - 1
packages/libndsfpc/examples/graphics/3D/Simple_Tri/SimpleTri.pp

@@ -43,7 +43,7 @@ begin
     glPushMatrix();
 
     //move it away from the camera
-    glTranslate3f32(0, 0, floattof32(-1));
+    glTranslatef32(0, 0, floattof32(-1));
 
     glRotateX(rotateX);
     glRotateY(rotateY);

+ 58 - 1
packages/libndsfpc/examples/graphics/3D/Textured_Cube/TexturedCube.pp

@@ -79,6 +79,28 @@ begin
   glVertex3v16(CubeVectors[f4*3], CubeVectors[f4*3 + 1], CubeVectors[f4*3 + 2] );
 end;
 
+procedure DisplayEnableMotionBlur();
+var
+  dispcnt: cuint32;
+begin
+  dispcnt := REG_DISPCNT^;
+  //set main display to display from VRAM
+  dispcnt := dispcnt and ($00030000 xor $FFFFFFFF); 
+  dispcnt := dispcnt or (2 shl 16); //choose to display screen from VRAM
+  dispcnt := dispcnt and ($000C0000 xor $FFFFFFFF); 
+  dispcnt := dispcnt or (1 shl 18); //choose to display screen from VRAM_B
+  REG_DISPCNT^ := dispcnt;
+end;
+ 
+procedure DisplayEnableNormal();
+var         
+  dispcnt: cuint32;
+begin
+  dispcnt := REG_DISPCNT^;
+  dispcnt := dispcnt and ($00030000 xor $FFFFFFFF); 
+  dispcnt := dispcnt or (1 shl 16); //choose to display screen from normal layer composition
+  REG_DISPCNT^ := dispcnt;
+end;
 
 var
   textureID: integer;
@@ -86,6 +108,7 @@ var
   rotateX: cfloat = 0.0;
   rotateY: cfloat = 0.0;
   keys: cuint16;
+  displayBlurred: boolean;
 
 begin
   Initialize();
@@ -109,6 +132,28 @@ begin
   glClearPolyID(63); // BG must have a unique polygon ID for AA to work
   glClearDepth($7FFF);
 
+
+  vramSetBankB(VRAM_B_LCD);
+  REG_DISPCAPCNT^ := DCAP_MODE(DCAP_MODE_BLEND) //blend source A and source B
+                      //or  DCAP_SRC_ADDR //this is not used since we are setting the display to render from VRAM
+                      or    DCAP_SRC_B(DCAP_SRC_B_VRAM)
+                      or    DCAP_SRC_A(DCAP_SRC_A_3DONLY)
+                      or    DCAP_SIZE(DCAP_SIZE_256x192)
+                      or    DCAP_OFFSET(0) //where to write the captured data within our chosen VRAM bank
+                      or    DCAP_BANK(DCAP_BANK_VRAM_B)
+                      or    DCAP_B(12) //blend mostly from B to make a very dramatic effect
+                      or    DCAP_A(4) //and blend only a little bit from the new scene
+                      ;
+  //but, dramatic effects tend to leave some garbage on the screen since the precision of the math is low,
+  //and we're not putting a lot of dampening on the effect.
+  //a more realistic value might be 8 and 8, but perhaps in a more complex 3d scene the garbage isn't such a bad thing
+  //since the scene is changing constantly
+ 
+  DisplayEnableMotionBlur();
+  displayBlurred := true;
+ 
+ 
+
   vramSetBankA(VRAM_A_TEXTURE);
 
   glGenTextures(1, @textureID);
@@ -135,7 +180,7 @@ begin
     glPushMatrix();
 
     //move it away from the camera
-    glTranslate3f32(0, 0, floattof32(-1));
+    glTranslatef32(0, 0, floattof32(-1));
 
     glRotateX(rotateX);
     glRotateY(rotateY);
@@ -166,6 +211,15 @@ begin
 		if((keys and KEY_LEFT)) <> 0 then rotateY := rotateY +3;
 		if((keys and KEY_RIGHT)) <> 0 then rotateY := rotateY -3;
 
+    if (keysDown() and KEY_A) <> 0 then
+    begin
+      displayBlurred := not displayBlurred;
+      if displayBlurred then
+        DisplayEnableMotionBlur()
+      else
+        DisplayEnableNormal();
+    end;
+
 		glBindTexture(0, textureID);
 
 		//draw the obj
@@ -179,5 +233,8 @@ begin
 		glFlush(0);
 
 		swiWaitForVBlank();
+    
+    //the display capture enable bit must be set again each frame if you want to continue capturing.
+    REG_DISPCAPCNT^ := REG_DISPCAPCNT^ or DCAP_ENABLE;		
   end;
 end.

+ 1 - 1
packages/libndsfpc/examples/graphics/3D/Textured_Quad/TexturedQuad.pp

@@ -58,7 +58,7 @@ begin
     glPushMatrix();
 
     //move it away from the camera
-    glTranslate3f32(0, 0, floattof32(-1));
+    glTranslatef32(0, 0, floattof32(-1));
 
     glRotateX(rotateX);
     glRotateY(rotateY);

BIN
packages/libndsfpc/examples/graphics/3D/nehe/lesson10/data/drunkenlogo.pcx


+ 130 - 5
packages/libndsfpc/examples/graphics/3D/nehe/lesson10/lesson10.pp

@@ -7,12 +7,14 @@ program Lesson10;
 
 {$L build/Mud.pcx.o}
 {$L build/World.txt.o}
+{$L build/drunkenlogo.pcx.o}
 
 uses
   ctypes, nds9;
 
 {$include inc/Mud.pcx.inc}
 {$include inc/World.txt.inc}
+{$include inc/drunkenlogo.pcx.inc}
 
 const
   piover180: cfloat = 0.0174532925;
@@ -47,10 +49,17 @@ type
   end;
   SECTOR = tagSECTOR;
 
+  TCubeRot = record
+    x, y, z: cfloat;
+  end;
+
 var
   sector1: SECTOR;        // Our Model Goes Here:
   Myfile: pchar;
+  cuberot: TCubeRot;
 
+procedure ShadowDemo(); forward;
+  
 function DrawGLScene(): boolean;
 var
   x_m, y_m, z_m:  cfloat;
@@ -104,6 +113,7 @@ begin
       glTexCoord2f(u_m,v_m); glVertex3f(x_m,y_m,z_m);
     glEnd();
   end;
+  ShadowDemo();
   DrawGLScene := true;                    // Everything Went OK
 end;
 
@@ -184,25 +194,125 @@ function LoadGLTextures(): boolean;
 var
   pcx: sImage;
 begin
+  glGenTextures(2, @texture[0]);
+
   //load our texture
   loadPCX(pcuint8(Mud_pcx), @pcx);
 
   image8to16(@pcx);
 
-  glGenTextures(1, @texture[0]);
   glBindTexture(0, texture[0]);
   glTexImage2D(0, 0, GL_RGB, TEXTURE_SIZE_128 , TEXTURE_SIZE_128, 0, TEXGEN_TEXCOORD or GL_TEXTURE_WRAP_S or GL_TEXTURE_WRAP_T, pcx.image.data8);
 
   imageDestroy(@pcx);
 
+  loadPCX(pcuint8(drunkenlogo_pcx), @pcx);
+  image8to16(@pcx);
+  glBindTexture(0, texture[1]);
+  glTexImage2D(0, 0, GL_RGB, TEXTURE_SIZE_128, TEXTURE_SIZE_128, 0, TEXGEN_TEXCOORD, pcx.image.data8);
+
+  imageDestroy(@pcx);
+
   result := true;
 end;
 
+procedure TransformCube();
+begin
+  glRotatef(cubeRot.x, 1.0, 0.0, 0.0);
+  glRotatef(cubeRot.y, 0.0, 1.0, 0.0);
+  glRotatef(cubeRot.z, 0.0, 0.0, 1.0);
+end;
+
+procedure EmitCube();
+begin
+  glPushMatrix();
+  glScalef(0.03, 0.03, 0.03);	
+  
+  glRotatef(cubeRot.x, 1.0, 0.0, 0.0);
+  glRotatef(cubeRot.y, 0.0, 1.0, 0.0);
+  glRotatef(cubeRot.z, 0.0, 0.0, 1.0);
+  
+  glBegin(GL_QUADS);
+    // Front Face
+    glTexCoord2f(0.0, 0.0); glVertex3f(-1.0, -1.0,  1.0);
+    glTexCoord2f(1.0, 0.0); glVertex3f( 1.0, -1.0,  1.0);
+    glTexCoord2f(1.0, 1.0); glVertex3f( 1.0,  1.0,  1.0);
+    glTexCoord2f(0.0, 1.0); glVertex3f(-1.0,  1.0,  1.0);
+    // Back Face
+    glTexCoord2f(1.0, 0.0); glVertex3f(-1.0, -1.0, -1.0);
+    glTexCoord2f(1.0, 1.0); glVertex3f(-1.0,  1.0, -1.0);
+    glTexCoord2f(0.0, 1.0); glVertex3f( 1.0,  1.0, -1.0);
+    glTexCoord2f(0.0, 0.0); glVertex3f( 1.0, -1.0, -1.0);
+    // Top Face
+    glTexCoord2f(0.0, 1.0); glVertex3f(-1.0,  1.0, -1.0);
+    glTexCoord2f(0.0, 0.0); glVertex3f(-1.0,  1.0,  1.0);
+    glTexCoord2f(1.0, 0.0); glVertex3f( 1.0,  1.0,  1.0);
+    glTexCoord2f(1.0, 1.0); glVertex3f( 1.0,  1.0, -1.0);
+    // Bottom Face
+    glTexCoord2f(1.0, 1.0); glVertex3f(-1.0, -1.0, -1.0);
+    glTexCoord2f(0.0, 1.0); glVertex3f( 1.0, -1.0, -1.0);
+    glTexCoord2f(0.0, 0.0); glVertex3f( 1.0, -1.0,  1.0);
+    glTexCoord2f(1.0, 0.0); glVertex3f(-1.0, -1.0,  1.0);
+    // Right face
+    glTexCoord2f(1.0, 0.0); glVertex3f( 1.0, -1.0, -1.0);
+    glTexCoord2f(1.0, 1.0); glVertex3f( 1.0,  1.0, -1.0);
+    glTexCoord2f(0.0, 1.0); glVertex3f( 1.0,  1.0,  1.0);
+    glTexCoord2f(0.0, 0.0); glVertex3f( 1.0, -1.0,  1.0);
+    // Left Face
+    glTexCoord2f(0.0, 0.0); glVertex3f(-1.0, -1.0, -1.0);
+    glTexCoord2f(1.0, 0.0); glVertex3f(-1.0, -1.0,  1.0);
+    glTexCoord2f(1.0, 1.0); glVertex3f(-1.0,  1.0,  1.0);
+    glTexCoord2f(0.0, 1.0); glVertex3f(-1.0,  1.0, -1.0);
+  glEnd();
+  glPopMatrix(1);
+end;
+
+procedure ShadowDemo();
+begin
+  cubeRot.y := cubeRot.y + 0.8;
+  
+  //draw the actual cube
+  glPushMatrix();
+  glTranslatef(0.0, 0.4, -0.4); //draw the cube up in the air
+  TransformCube();
+  glBindTexture(GL_TEXTURE_2D, texture[1]);
+  EmitCube();
+  glPopMatrix(1);
+  
+  //draw the shadow:
+  begin
+    //draw the cube shadow on the ground
+    glPushMatrix();
+    glTranslatef(0.0, 0.0, -0.4);
+    TransformCube();
+    
+    //use no texture. set shadow color: we'll use green just to show that it is possible
+    glBindTexture(0, 0);
+    glColor(RGB15(0, 8, 0));
+    
+    //1st shadow pass
+    //be sure to use opaque here
+    glPolyFmt(POLY_SHADOW or POLY_CULL_FRONT or POLY_ALPHA(31));
+    EmitCube();
+    
+    //2nd shadow pass
+    //be sure to use a different polyID here (shadow with polyID 0 can't be cast on surface with polyID 0)
+    //we set the fog bit here because we want the shadow to be fogged later. i think it may be buggy but it looks better.
+    glPolyFmt(POLY_SHADOW or POLY_CULL_BACK or POLY_ALPHA(15) or POLY_ID(1) or POLY_FOG);
+    EmitCube();
+    
+    //reset poly attribute
+    glPolyFmt(POLY_ALPHA(31) or POLY_CULL_NONE or POLY_FORMAT_LIGHT0 or POLY_FOG);
+    
+    glPopMatrix(1);
+  end;
+end;
+
 var
   thisXY: touchPosition;
   lastXY: touchPosition;
   dx, dy: cint16;
-
+  i: integer;
 begin
   MyFile := pchar(@World_txt);
   // Setup the Main screen for 3D
@@ -220,6 +330,9 @@ begin
   // enable antialiasing
   glEnable(GL_ANTIALIAS);
 
+  // enable alpha blending for shadow demo
+  glEnable(GL_BLEND);
+
   // setup the rear plane
   glClearColor(0,0,0,31); // BG must be opaque for AA to work
   glClearPolyID(63); // BG must have a unique polygon ID for AA to work
@@ -235,7 +348,7 @@ begin
   glLoadIdentity();
   gluPerspective(70, 256.0 / 192.0, 0.1, 100);
 
-  glLight(0, RGB15(31,31,31) , 0,         floattov10(-1.0),    0);
+  glLight(0, RGB15(31,31,31) , 0, floattov10(-1.0), 0);
 
   //need to set up some material properties since DS does not have them set by default
   glMaterialf(GL_AMBIENT, RGB15(16,16,16));
@@ -247,11 +360,24 @@ begin
   glMaterialShinyness();
 
   //ds specific, several attributes can be set here
-  glPolyFmt(POLY_ALPHA(31) or POLY_CULL_NONE or POLY_FORMAT_LIGHT0);
+  glPolyFmt(POLY_ALPHA(31) or POLY_CULL_NONE or POLY_FORMAT_LIGHT0 or POLY_FOG);
 
   // Set the current matrix to be the model matrix
   glMatrixMode(GL_MODELVIEW);
 
+  //setup demo fog parameters
+  //these parameters are somewhat arbitrary, and designed to illustrate fog in just this one case.
+  //you will certainly need to tweak them for your own use.
+  //be sure to have set the POLY_FOG bit on any material you want to be fogged.
+  glEnable(GL_FOG);
+  glFogShift(2);
+  glFogColor(0, 0, 0, 0);
+
+  for i := 0 to 31 do
+    glFogDensity(i, i * 4);
+
+  glFogDensity(31, 127);
+  glFogOffset($6000);
 
   while true do
   begin
@@ -299,7 +425,6 @@ begin
       walkbias := tsin(walkbiasangle) / 20.0;
     end;
 
-
     glColor3f(1,1,1);
 
     DrawGLScene();

+ 11 - 8
packages/libndsfpc/examples/graphics/3D/nehe/lesson10b/lesson10b.pp

@@ -72,7 +72,7 @@ begin
   glRotatef32i(lookupdown, (1 shl 12),          0, 0);
   glRotatef32i( sceneroty,          0, (1 shl 12), 0);
 
-  glTranslate3f32(xtrans, ytrans, ztrans);
+  glTranslatef32(xtrans, ytrans, ztrans);
   glBindTexture(GL_TEXTURE_2D, texture[0]);
 
   numtriangles := sector1.numtriangles;
@@ -182,6 +182,9 @@ begin
   result := true;
 end;
 
+var
+  held: integer;
+
 begin
   MyFile := pchar(@World_txt);
 
@@ -236,25 +239,25 @@ begin
   begin
     //these little button functions are pretty handy
     scanKeys();
+    held := keysHeld();
 
+    if (held and KEY_A) <> 0 then lookupdown := lookupdown - 1;
 
-    if (keysHeld() and KEY_A) <> 0 then lookupdown := lookupdown - 1;
-
-    if (keysHeld() and KEY_B) <> 0 then lookupdown := lookupdown + 1;
+    if (held and KEY_B) <> 0 then lookupdown := lookupdown + 1;
 
-    if (keysHeld() and KEY_LEFT) <> 0 then
+    if (held and KEY_LEFT) <> 0 then
     begin
       heading := heading + 64;
       yrot := heading;
     end;
 
-    if (keysHeld() and KEY_RIGHT) <> 0 then
+    if (held and KEY_RIGHT) <> 0 then
     begin
       heading := heading - 64;
       yrot := heading;
     end;
 
-    if (keysHeld() and KEY_DOWN) <> 0 then
+    if (held and KEY_DOWN) <> 0 then
     begin
 
       xpos := xpos + sinLerp(heading) div 20;
@@ -265,7 +268,7 @@ begin
       walkbias := sinLerp(walkbiasangle) div 20;
     end;
 
-    if (keysHeld() and KEY_UP) <> 0 then
+    if (held and KEY_UP) <> 0 then
     begin
       xpos := xpos - sinLerp(heading) div 20;
       zpos := zpos - cosLerp(heading) div 20;

+ 5 - 1
packages/libndsfpc/examples/graphics/Backgrounds/16bit_color_bmp/16bitColorBmp.pp

@@ -34,6 +34,10 @@ begin
   decompress(@drunkenlogoBitmap, BG_GFX,  LZ77Vram);
 
   while true do
+  begin
     swiWaitForVBlank();
-
+    ScanKeys();
+    if (keysDown() and KEY_START) <> 0 then 
+      break;
+  end;
 end.

+ 1 - 1
packages/libndsfpc/examples/graphics/Backgrounds/Double_Buffer/DoubleBuffer.pp

@@ -19,7 +19,7 @@ begin
 	//set the first two banks as background memory and the third as sub background memory
 	//D is not used..if you need a bigger background then you will need to map
 	//more vram banks consecutivly (VRAM A-D are all 0x20000 bytes in size)
-	vramSetMainBanks(	VRAM_A_MAIN_BG_0x06000000, VRAM_B_MAIN_BG_0x06020000, 
+	vramSetPrimaryBanks(VRAM_A_MAIN_BG_0x06000000, VRAM_B_MAIN_BG_0x06020000, 
 		VRAM_C_SUB_BG, VRAM_D_LCD);
 
 	consoleDemoInit();

+ 2 - 2
packages/libndsfpc/examples/graphics/Sprites/bitmap_sprites/BitmapSprites.pp

@@ -41,7 +41,7 @@ begin
     gfx := nil;
     size := SpriteSize_32x32;
     format := SpriteColorFormat_256Color;
-    rotationIndex := -1;
+    rotationIndex := 0;
     paletteAlpha := 0;
     x := 20;
     y := 80;
@@ -52,7 +52,7 @@ begin
     gfx := nil;
     size := SpriteSize_32x32;
     format := SpriteColorFormat_16Color;
-    rotationIndex := -1;
+    rotationIndex := 0;
     paletteAlpha := 1;
     x := 20;
     y := 136;

+ 1 - 1
packages/libndsfpc/examples/graphics/Sprites/fire_and_sprites/FireAndSprites.pp

@@ -83,7 +83,7 @@ begin
           DISPLAY_BG1_ACTIVE );
 
 	//vram banks are somewhat complex
-	vramSetMainBanks(VRAM_A_LCD, VRAM_B_LCD, VRAM_C_SUB_BG, VRAM_D_SUB_SPRITE);
+	vramSetPrimaryBanks(VRAM_A_LCD, VRAM_B_LCD, VRAM_C_SUB_BG, VRAM_D_SUB_SPRITE);
 
   //load our ball pcx file into an image
   loadPCX(pcuint8(ball_pcx), @ball);

+ 0 - 6
packages/libndsfpc/examples/input/Touch_Pad/touch_test/touchTest.pp

@@ -59,12 +59,6 @@ begin
   lcdMainOnBottom();
   
   initOAM();
-  //enable vram and map it to the right places
-  vramSetMainBanks(   VRAM_A_MAIN_SPRITE,         //A and B maped consecutively as sprite memory
-                      VRAM_B_MAIN_SPRITE,         //this gives us 256KB which is the max
-                      VRAM_C_MAIN_BG_0x06000000,  //map C to background memory
-                      VRAM_D_LCD                  //not using D
-                      ); 
    
   //set the video mode
   videoSetMode(  MODE_0_2D or 

+ 415 - 190
packages/libndsfpc/examples/RealTimeClock/Makefile → packages/libndsfpc/examples/time/Makefile

@@ -1,8 +1,8 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2010/09/29]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2010/11/11]
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-gamecube powerpc-wii sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku
 LIMIT83fs = go32v2 os2 emx watcom
@@ -245,7 +245,7 @@ endif
 ifndef CROSSBINDIR
 CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
 endif
-ifneq ($(findstring $(OS_TARGET),darwin iphonesim),)
+ifeq ($(OS_TARGET),darwin)
 ifeq ($(OS_SOURCE),darwin)
 DARWIN2DARWIN=1
 endif
@@ -265,190 +265,190 @@ UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
 endif
 PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),i386-haiku)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_DIRS+=Watch
-endif
-ifeq ($(FULL_TARGET),i386-nativent)
-override TARGET_DIRS+=Watch
-endif
-ifeq ($(FULL_TARGET),i386-iphonesim)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
+endif
+ifeq ($(FULL_TARGET),powerpc-gamecube)
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),arm-darwin)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),avr-embedded)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),armeb-embedded)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 ifeq ($(FULL_TARGET),mipsel-linux)
-override TARGET_DIRS+=Watch
+override TARGET_DIRS+=RealTimeClock timercallback stopwatch
 endif
 override INSTALL_FPCPACKAGE=y
 ifdef REQUIRE_UNITSDIR
@@ -778,7 +778,7 @@ DEBUGSYMEXT=.xcoff
 SHORTSUFFIX=mac
 IMPORTLIBPREFIX=imp
 endif
-ifneq ($(findstring $(OS_TARGET),darwin iphonesim),)
+ifeq ($(OS_TARGET),darwin)
 BATCHEXT=.sh
 EXEEXT=
 HASSHAREDLIB=1
@@ -789,13 +789,24 @@ EXEEXT=.gba
 SHAREDLIBEXT=.so
 SHORTSUFFIX=gba
 endif
+ifeq ($(OS_TARGET),nds)
+EXEEXT=.nds
+SHAREDLIBEXT=.so
+SHORTSUFFIX=nds
+endif
 ifeq ($(OS_TARGET),symbian)
 SHAREDLIBEXT=.dll
 SHORTSUFFIX=symbian
 endif
-ifeq ($(OS_TARGET),NativeNT)
-SHAREDLIBEXT=.dll
-SHORTSUFFIX=nativent
+ifeq ($(OS_TARGET),gamecube)
+EXEEXT=.dol
+SHAREDLIBEXT=.so
+SHORTSUFFIX=gamecube
+endif
+ifeq ($(OS_TARGET),wii)
+EXEEXT=.dol
+SHAREDLIBEXT=.so
+SHORTSUFFIX=wii
 endif
 else
 ifeq ($(OS_TARGET),go32v1)
@@ -1282,12 +1293,6 @@ endif
 ifeq ($(FULL_TARGET),i386-symbian)
 REQUIRE_PACKAGES_LIBNDSFPC=1
 endif
-ifeq ($(FULL_TARGET),i386-nativent)
-REQUIRE_PACKAGES_LIBNDSFPC=1
-endif
-ifeq ($(FULL_TARGET),i386-iphonesim)
-REQUIRE_PACKAGES_LIBNDSFPC=1
-endif
 ifeq ($(FULL_TARGET),m68k-linux)
 REQUIRE_PACKAGES_LIBNDSFPC=1
 endif
@@ -1333,6 +1338,12 @@ endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
 REQUIRE_PACKAGES_LIBNDSFPC=1
 endif
+ifeq ($(FULL_TARGET),powerpc-gamecube)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
 ifeq ($(FULL_TARGET),sparc-linux)
 REQUIRE_PACKAGES_LIBNDSFPC=1
 endif
@@ -1771,235 +1782,449 @@ fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIR
 fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
 fpc_makefiles: fpc_makefile fpc_makefile_dirs
 ifeq ($(FULL_TARGET),i386-linux)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),i386-haiku)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-TARGET_DIRS_WATCH=1
-endif
-ifeq ($(FULL_TARGET),i386-nativent)
-TARGET_DIRS_WATCH=1
-endif
-ifeq ($(FULL_TARGET),i386-iphonesim)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
+endif
+ifeq ($(FULL_TARGET),powerpc-gamecube)
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),arm-darwin)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),avr-embedded)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),armeb-embedded)
-TARGET_DIRS_WATCH=1
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
 endif
 ifeq ($(FULL_TARGET),mipsel-linux)
-TARGET_DIRS_WATCH=1
-endif
-ifdef TARGET_DIRS_WATCH
-Watch_all:
-	$(MAKE) -C Watch all
-Watch_debug:
-	$(MAKE) -C Watch debug
-Watch_smart:
-	$(MAKE) -C Watch smart
-Watch_release:
-	$(MAKE) -C Watch release
-Watch_units:
-	$(MAKE) -C Watch units
-Watch_examples:
-	$(MAKE) -C Watch examples
-Watch_shared:
-	$(MAKE) -C Watch shared
-Watch_install:
-	$(MAKE) -C Watch install
-Watch_sourceinstall:
-	$(MAKE) -C Watch sourceinstall
-Watch_exampleinstall:
-	$(MAKE) -C Watch exampleinstall
-Watch_distinstall:
-	$(MAKE) -C Watch distinstall
-Watch_zipinstall:
-	$(MAKE) -C Watch zipinstall
-Watch_zipsourceinstall:
-	$(MAKE) -C Watch zipsourceinstall
-Watch_zipexampleinstall:
-	$(MAKE) -C Watch zipexampleinstall
-Watch_zipdistinstall:
-	$(MAKE) -C Watch zipdistinstall
-Watch_clean:
-	$(MAKE) -C Watch clean
-Watch_distclean:
-	$(MAKE) -C Watch distclean
-Watch_cleanall:
-	$(MAKE) -C Watch cleanall
-Watch_info:
-	$(MAKE) -C Watch info
-Watch_makefiles:
-	$(MAKE) -C Watch makefiles
-Watch:
-	$(MAKE) -C Watch all
-.PHONY: Watch_all Watch_debug Watch_smart Watch_release Watch_units Watch_examples Watch_shared Watch_install Watch_sourceinstall Watch_exampleinstall Watch_distinstall Watch_zipinstall Watch_zipsourceinstall Watch_zipexampleinstall Watch_zipdistinstall Watch_clean Watch_distclean Watch_cleanall Watch_info Watch_makefiles Watch
+TARGET_DIRS_REALTIMECLOCK=1
+TARGET_DIRS_TIMERCALLBACK=1
+TARGET_DIRS_STOPWATCH=1
+endif
+ifdef TARGET_DIRS_REALTIMECLOCK
+RealTimeClock_all:
+	$(MAKE) -C RealTimeClock all
+RealTimeClock_debug:
+	$(MAKE) -C RealTimeClock debug
+RealTimeClock_smart:
+	$(MAKE) -C RealTimeClock smart
+RealTimeClock_release:
+	$(MAKE) -C RealTimeClock release
+RealTimeClock_units:
+	$(MAKE) -C RealTimeClock units
+RealTimeClock_examples:
+	$(MAKE) -C RealTimeClock examples
+RealTimeClock_shared:
+	$(MAKE) -C RealTimeClock shared
+RealTimeClock_install:
+	$(MAKE) -C RealTimeClock install
+RealTimeClock_sourceinstall:
+	$(MAKE) -C RealTimeClock sourceinstall
+RealTimeClock_exampleinstall:
+	$(MAKE) -C RealTimeClock exampleinstall
+RealTimeClock_distinstall:
+	$(MAKE) -C RealTimeClock distinstall
+RealTimeClock_zipinstall:
+	$(MAKE) -C RealTimeClock zipinstall
+RealTimeClock_zipsourceinstall:
+	$(MAKE) -C RealTimeClock zipsourceinstall
+RealTimeClock_zipexampleinstall:
+	$(MAKE) -C RealTimeClock zipexampleinstall
+RealTimeClock_zipdistinstall:
+	$(MAKE) -C RealTimeClock zipdistinstall
+RealTimeClock_clean:
+	$(MAKE) -C RealTimeClock clean
+RealTimeClock_distclean:
+	$(MAKE) -C RealTimeClock distclean
+RealTimeClock_cleanall:
+	$(MAKE) -C RealTimeClock cleanall
+RealTimeClock_info:
+	$(MAKE) -C RealTimeClock info
+RealTimeClock_makefiles:
+	$(MAKE) -C RealTimeClock makefiles
+RealTimeClock:
+	$(MAKE) -C RealTimeClock all
+.PHONY: RealTimeClock_all RealTimeClock_debug RealTimeClock_smart RealTimeClock_release RealTimeClock_units RealTimeClock_examples RealTimeClock_shared RealTimeClock_install RealTimeClock_sourceinstall RealTimeClock_exampleinstall RealTimeClock_distinstall RealTimeClock_zipinstall RealTimeClock_zipsourceinstall RealTimeClock_zipexampleinstall RealTimeClock_zipdistinstall RealTimeClock_clean RealTimeClock_distclean RealTimeClock_cleanall RealTimeClock_info RealTimeClock_makefiles RealTimeClock
+endif
+ifdef TARGET_DIRS_TIMERCALLBACK
+timercallback_all:
+	$(MAKE) -C timercallback all
+timercallback_debug:
+	$(MAKE) -C timercallback debug
+timercallback_smart:
+	$(MAKE) -C timercallback smart
+timercallback_release:
+	$(MAKE) -C timercallback release
+timercallback_units:
+	$(MAKE) -C timercallback units
+timercallback_examples:
+	$(MAKE) -C timercallback examples
+timercallback_shared:
+	$(MAKE) -C timercallback shared
+timercallback_install:
+	$(MAKE) -C timercallback install
+timercallback_sourceinstall:
+	$(MAKE) -C timercallback sourceinstall
+timercallback_exampleinstall:
+	$(MAKE) -C timercallback exampleinstall
+timercallback_distinstall:
+	$(MAKE) -C timercallback distinstall
+timercallback_zipinstall:
+	$(MAKE) -C timercallback zipinstall
+timercallback_zipsourceinstall:
+	$(MAKE) -C timercallback zipsourceinstall
+timercallback_zipexampleinstall:
+	$(MAKE) -C timercallback zipexampleinstall
+timercallback_zipdistinstall:
+	$(MAKE) -C timercallback zipdistinstall
+timercallback_clean:
+	$(MAKE) -C timercallback clean
+timercallback_distclean:
+	$(MAKE) -C timercallback distclean
+timercallback_cleanall:
+	$(MAKE) -C timercallback cleanall
+timercallback_info:
+	$(MAKE) -C timercallback info
+timercallback_makefiles:
+	$(MAKE) -C timercallback makefiles
+timercallback:
+	$(MAKE) -C timercallback all
+.PHONY: timercallback_all timercallback_debug timercallback_smart timercallback_release timercallback_units timercallback_examples timercallback_shared timercallback_install timercallback_sourceinstall timercallback_exampleinstall timercallback_distinstall timercallback_zipinstall timercallback_zipsourceinstall timercallback_zipexampleinstall timercallback_zipdistinstall timercallback_clean timercallback_distclean timercallback_cleanall timercallback_info timercallback_makefiles timercallback
+endif
+ifdef TARGET_DIRS_STOPWATCH
+stopwatch_all:
+	$(MAKE) -C stopwatch all
+stopwatch_debug:
+	$(MAKE) -C stopwatch debug
+stopwatch_smart:
+	$(MAKE) -C stopwatch smart
+stopwatch_release:
+	$(MAKE) -C stopwatch release
+stopwatch_units:
+	$(MAKE) -C stopwatch units
+stopwatch_examples:
+	$(MAKE) -C stopwatch examples
+stopwatch_shared:
+	$(MAKE) -C stopwatch shared
+stopwatch_install:
+	$(MAKE) -C stopwatch install
+stopwatch_sourceinstall:
+	$(MAKE) -C stopwatch sourceinstall
+stopwatch_exampleinstall:
+	$(MAKE) -C stopwatch exampleinstall
+stopwatch_distinstall:
+	$(MAKE) -C stopwatch distinstall
+stopwatch_zipinstall:
+	$(MAKE) -C stopwatch zipinstall
+stopwatch_zipsourceinstall:
+	$(MAKE) -C stopwatch zipsourceinstall
+stopwatch_zipexampleinstall:
+	$(MAKE) -C stopwatch zipexampleinstall
+stopwatch_zipdistinstall:
+	$(MAKE) -C stopwatch zipdistinstall
+stopwatch_clean:
+	$(MAKE) -C stopwatch clean
+stopwatch_distclean:
+	$(MAKE) -C stopwatch distclean
+stopwatch_cleanall:
+	$(MAKE) -C stopwatch cleanall
+stopwatch_info:
+	$(MAKE) -C stopwatch info
+stopwatch_makefiles:
+	$(MAKE) -C stopwatch makefiles
+stopwatch:
+	$(MAKE) -C stopwatch all
+.PHONY: stopwatch_all stopwatch_debug stopwatch_smart stopwatch_release stopwatch_units stopwatch_examples stopwatch_shared stopwatch_install stopwatch_sourceinstall stopwatch_exampleinstall stopwatch_distinstall stopwatch_zipinstall stopwatch_zipsourceinstall stopwatch_zipexampleinstall stopwatch_zipdistinstall stopwatch_clean stopwatch_distclean stopwatch_cleanall stopwatch_info stopwatch_makefiles stopwatch
 endif
 all: $(addsuffix _all,$(TARGET_DIRS))
 debug: $(addsuffix _debug,$(TARGET_DIRS))

+ 1 - 1
packages/libndsfpc/examples/RealTimeClock/Makefile.fpc → packages/libndsfpc/examples/time/Makefile.fpc

@@ -3,7 +3,7 @@
 #
 
 [target]
-dirs=Watch
+dirs=RealTimeClock timercallback stopwatch
 
 [require]
 packages=libndsfpc

+ 170 - 376
packages/libndsfpc/examples/RealTimeClock/Watch/Makefile → packages/libndsfpc/examples/time/RealTimeClock/Makefile

@@ -1,8 +1,8 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2010/09/29]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2010/11/11]
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-gamecube powerpc-wii sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku
 LIMIT83fs = go32v2 os2 emx watcom
@@ -247,7 +247,7 @@ endif
 ifndef CROSSBINDIR
 CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
 endif
-ifneq ($(findstring $(OS_TARGET),darwin iphonesim),)
+ifeq ($(OS_TARGET),darwin)
 ifeq ($(OS_SOURCE),darwin)
 DARWIN2DARWIN=1
 endif
@@ -267,195 +267,193 @@ UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
 endif
 PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
 BUILD = build
-INC = inc
-AUDIO_FILES = $(foreach dir, $(notdir $(wildcard audio/*.*)), $(CURDIR)/audio/$(dir))
+AUDIO_FILES = $(foreach dir,$(notdir $(wildcard audio/*.*)),$(CURDIR)/audio/$(dir))
 GFX_FILES = $(foreach dir,gfx,$(notdir $(wildcard $(dir)/*.png)))
-BIN_FILES = $(foreach dir,data,$(notdir $(wildcard $(dir)/*)))
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),i386-haiku)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_PROGRAMS+=watch
-endif
-ifeq ($(FULL_TARGET),i386-nativent)
-override TARGET_PROGRAMS+=watch
-endif
-ifeq ($(FULL_TARGET),i386-iphonesim)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
+endif
+ifeq ($(FULL_TARGET),powerpc-gamecube)
+override TARGET_PROGRAMS+=RealTimeClock
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),arm-darwin)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),avr-embedded)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),armeb-embedded)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),mipsel-linux)
-override TARGET_PROGRAMS+=watch
+override TARGET_PROGRAMS+=RealTimeClock
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override CLEAN_UNITS+=*
@@ -517,12 +515,6 @@ endif
 ifeq ($(FULL_TARGET),i386-symbian)
 override CLEAN_UNITS+=*
 endif
-ifeq ($(FULL_TARGET),i386-nativent)
-override CLEAN_UNITS+=*
-endif
-ifeq ($(FULL_TARGET),i386-iphonesim)
-override CLEAN_UNITS+=*
-endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override CLEAN_UNITS+=*
 endif
@@ -568,6 +560,12 @@ endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
 override CLEAN_UNITS+=*
 endif
+ifeq ($(FULL_TARGET),powerpc-gamecube)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+override CLEAN_UNITS+=*
+endif
 ifeq ($(FULL_TARGET),sparc-linux)
 override CLEAN_UNITS+=*
 endif
@@ -644,378 +642,192 @@ ifeq ($(FULL_TARGET),mipsel-linux)
 override CLEAN_UNITS+=*
 endif
 ifeq ($(FULL_TARGET),i386-linux)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),i386-haiku)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),i386-nativent)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),i386-iphonesim)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),sparc-linux)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),sparc-netbsd)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),sparc-solaris)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),sparc-embedded)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),x86_64-linux)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),x86_64-freebsd)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),x86_64-solaris)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),x86_64-darwin)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),x86_64-win64)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),x86_64-embedded)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),arm-linux)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),arm-palmos)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),arm-darwin)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),arm-wince)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),arm-gba)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),arm-nds)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),arm-embedded)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),arm-symbian)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),powerpc64-linux)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),powerpc64-darwin)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),powerpc64-embedded)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),avr-embedded)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),armeb-linux)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),armeb-embedded)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-ifeq ($(FULL_TARGET),mipsel-linux)
-override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/* $(INC)/*
-endif
-override INSTALL_FPCPACKAGE=y
-ifeq ($(FULL_TARGET),i386-linux)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),i386-go32v2)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),i386-win32)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),i386-os2)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),i386-freebsd)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),i386-beos)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
-ifeq ($(FULL_TARGET),i386-haiku)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),i386-netbsd)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),i386-solaris)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),i386-qnx)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),i386-netware)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),i386-openbsd)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),i386-wdosx)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),i386-darwin)
-override COMPILER_OPTIONS+=-g -Xm
+ifeq ($(FULL_TARGET),powerpc-gamecube)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
-ifeq ($(FULL_TARGET),i386-emx)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),i386-watcom)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),i386-netwlibc)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),i386-wince)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),i386-embedded)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),i386-symbian)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),i386-nativent)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),i386-iphonesim)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),m68k-linux)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),m68k-freebsd)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),m68k-netbsd)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),m68k-amiga)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),m68k-atari)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),m68k-openbsd)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),m68k-palmos)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),m68k-embedded)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),powerpc-linux)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),powerpc-netbsd)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),powerpc-amiga)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),powerpc-macos)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),powerpc-darwin)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),powerpc-morphos)
-override COMPILER_OPTIONS+=-g -Xm
-endif
-ifeq ($(FULL_TARGET),powerpc-embedded)
-override COMPILER_OPTIONS+=-g -Xm
+ifeq ($(FULL_TARGET),powerpc-wii)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),arm-darwin)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),avr-embedded)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),armeb-embedded)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
 ifeq ($(FULL_TARGET),mipsel-linux)
-override COMPILER_OPTIONS+=-g -Xm
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
 endif
+override INSTALL_FPCPACKAGE=y
 ifdef REQUIRE_UNITSDIR
 override UNITSDIR+=$(REQUIRE_UNITSDIR)
 endif
@@ -1343,7 +1155,7 @@ DEBUGSYMEXT=.xcoff
 SHORTSUFFIX=mac
 IMPORTLIBPREFIX=imp
 endif
-ifneq ($(findstring $(OS_TARGET),darwin iphonesim),)
+ifeq ($(OS_TARGET),darwin)
 BATCHEXT=.sh
 EXEEXT=
 HASSHAREDLIB=1
@@ -1354,13 +1166,24 @@ EXEEXT=.gba
 SHAREDLIBEXT=.so
 SHORTSUFFIX=gba
 endif
+ifeq ($(OS_TARGET),nds)
+EXEEXT=.nds
+SHAREDLIBEXT=.so
+SHORTSUFFIX=nds
+endif
 ifeq ($(OS_TARGET),symbian)
 SHAREDLIBEXT=.dll
 SHORTSUFFIX=symbian
 endif
-ifeq ($(OS_TARGET),NativeNT)
-SHAREDLIBEXT=.dll
-SHORTSUFFIX=nativent
+ifeq ($(OS_TARGET),gamecube)
+EXEEXT=.dol
+SHAREDLIBEXT=.so
+SHORTSUFFIX=gamecube
+endif
+ifeq ($(OS_TARGET),wii)
+EXEEXT=.dol
+SHAREDLIBEXT=.so
+SHORTSUFFIX=wii
 endif
 else
 ifeq ($(OS_TARGET),go32v1)
@@ -1847,12 +1670,6 @@ endif
 ifeq ($(FULL_TARGET),i386-symbian)
 REQUIRE_PACKAGES_LIBNDSFPC=1
 endif
-ifeq ($(FULL_TARGET),i386-nativent)
-REQUIRE_PACKAGES_LIBNDSFPC=1
-endif
-ifeq ($(FULL_TARGET),i386-iphonesim)
-REQUIRE_PACKAGES_LIBNDSFPC=1
-endif
 ifeq ($(FULL_TARGET),m68k-linux)
 REQUIRE_PACKAGES_LIBNDSFPC=1
 endif
@@ -1898,6 +1715,12 @@ endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
 REQUIRE_PACKAGES_LIBNDSFPC=1
 endif
+ifeq ($(FULL_TARGET),powerpc-gamecube)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
 ifeq ($(FULL_TARGET),sparc-linux)
 REQUIRE_PACKAGES_LIBNDSFPC=1
 endif
@@ -2523,15 +2346,6 @@ GRIT:=$(firstword $(GRIT))
 endif
 endif
 export GRIT
-ifndef RMDIR
-RMDIR:=$(strip $(wildcard $(addsuffix /rmdir$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(RMDIR),)
-RMDIR= __missing_command_RMDIR
-else
-RMDIR:=$(firstword $(RMDIR))
-endif
-endif
-export RMDIR
 debug: fpc_debug
 smart: fpc_smart
 release: fpc_release
@@ -2546,45 +2360,25 @@ zipinstall:
 zipsourceinstall:
 zipexampleinstall:
 zipdistinstall:
+clean: fpc_clean
 distclean: fpc_distclean
 cleanall: fpc_cleanall
 info: fpc_info
 makefiles: fpc_makefiles
-.PHONY: debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall distclean cleanall info makefiles
+.PHONY: debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 endif
 .NOTPARALLEL:
-clean: dir_delete fpc_clean fpc_cleanall
-all: dir_make $(BIN_FILES) $(GFX_FILES) fpc_all 
-dir_delete:
-	@$(DELTREE) $(CURDIR)/$(BUILD) 
-	@$(DELTREE) $(CURDIR)/$(INC) 
-dir_make:
+all: direc fpc_all 
+direc:
 ifneq ($(BUILD), $(CURDIR))
-	@$(MKDIR) $(BUILD)
-endif
-ifneq ($(INC), $(CURDIR))
-	@$(MKDIR) $(INC)
+	$(MKDIR) $(BUILD)
 endif
 soundbank.bin.o : $(AUDIO_FILES)
 	@$(MMUTIL) $^ -d -o$(BUILD)/soundbank.bin -h$(BUILD)/soundbank.h
 	$(BIN2S) $(BUILD)/soundbank.bin > $(BUILD)/soundbank.bin.s
 	$(AS) -o $(BUILD)/soundbank.bin.o $(BUILD)/soundbank.bin.s
-$(GFX_FILES): $(wildcard %.png) 
-	@echo 'Converting $(@) file to asm...'
-	$(GRIT) gfx/$(@) -fts -ff gfx/$(basename $(@)).grit -o$(BUILD)/$(@)
-	@echo 'Assembling $(@).s file...'
-	$(AS) -o $(BUILD)/$(basename $(@)).o $(BUILD)/$(basename $(@)).s
-	@echo 'Done!'
-$(BIN_FILES): $(wildcard %.*)
-	@echo 'Converting $(@) file to asm...'
-	@$(BIN2S) data/$(@) > $(BUILD)/$(@).s
-	@echo 'Creating $(@).inc include file...'
-	@echo "var" > `(echo "inc/"$(@F) | tr . .)`.inc
-	@echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end: array [0..0] of cuint8; cvar; external;" >> `(echo "inc/"$(@F) | tr . .)`.inc
-	@echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`": array [0..0] of cuint8; cvar; external;" >> `(echo "inc/"$(@F) | tr . .)`.inc
-	@echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size": cuint32; cvar; external;" >> `(echo "inc/"$(@F) | tr . .)`.inc
-	@echo 'Assembling $(@).s file...'
-	@$(AS) -o $(BUILD)/$(@).o $(BUILD)/$(@).s
-	@echo 'Done!'
+$(GFX_FILES).o: 
+	$(GRIT) gfx/$(GFX_FILES) -fts -ff gfx/$(basename $(GFX_FILES)).grit -o$(BUILD)/$(GFX_FILES)
+	$(AS) -o $(BUILD)/$(basename $(GFX_FILES)).o $(BUILD)/$(basename $(GFX_FILES)).s

+ 46 - 0
packages/libndsfpc/examples/time/RealTimeClock/Makefile.fpc

@@ -0,0 +1,46 @@
+#
+#   Makefile.fpc for Free Pascal libndsfpc 2.x.y Examples
+#
+
+[target]
+loaders=
+programs=RealTimeClock
+
+[require]
+packages=libndsfpc
+tools=bin2s mmutil grit
+nortl=y
+
+[install]
+fpcpackage=y
+
+[default]
+cpu=arm
+target=nds
+fpcdir=../../../../..
+
+[clean]
+files=*.elf *.o *.s *.nds *.nef *.h *.bin \
+       $(BUILD)/*
+units=*
+
+[prerules]
+BUILD = build
+AUDIO_FILES = $(foreach dir,$(notdir $(wildcard audio/*.*)),$(CURDIR)/audio/$(dir))
+GFX_FILES = $(foreach dir,gfx,$(notdir $(wildcard $(dir)/*.png)))
+
+[rules]
+.NOTPARALLEL:
+all: direc fpc_all 
+direc:
+ifneq ($(BUILD), $(CURDIR))
+        $(MKDIR) $(BUILD)
+endif
+soundbank.bin.o : $(AUDIO_FILES)
+        @$(MMUTIL) $^ -d -o$(BUILD)/soundbank.bin -h$(BUILD)/soundbank.h
+        $(BIN2S) $(BUILD)/soundbank.bin > $(BUILD)/soundbank.bin.s
+        $(AS) -o $(BUILD)/soundbank.bin.o $(BUILD)/soundbank.bin.s
+
+$(GFX_FILES).o: 
+        $(GRIT) gfx/$(GFX_FILES) -fts -ff gfx/$(basename $(GFX_FILES)).grit -o$(BUILD)/$(GFX_FILES)
+        $(AS) -o $(BUILD)/$(basename $(GFX_FILES)).o $(BUILD)/$(basename $(GFX_FILES)).s

+ 1 - 1
packages/libndsfpc/examples/RealTimeClock/Watch/watch.pp → packages/libndsfpc/examples/time/RealTimeClock/realtimeclock.pp

@@ -1,4 +1,4 @@
-program watch;
+program realtimeclock;
 
 {$mode objfpc}
 

+ 2384 - 0
packages/libndsfpc/examples/time/stopwatch/Makefile

@@ -0,0 +1,2384 @@
+#
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2010/11/11]
+#
+default: all
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-gamecube powerpc-wii sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
+BSDs = freebsd netbsd openbsd darwin
+UNIXs = linux $(BSDs) solaris qnx haiku
+LIMIT83fs = go32v2 os2 emx watcom
+OSNeedsComspecToRunBatch = go32v2 watcom
+FORCE:
+.PHONY: FORCE
+override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
+ifneq ($(findstring darwin,$(OSTYPE)),)
+inUnix=1 #darwin
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+ifeq ($(findstring ;,$(PATH)),)
+inUnix=1
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+SEARCHPATH:=$(subst ;, ,$(PATH))
+endif
+endif
+SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
+PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
+ifeq ($(PWD),)
+PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
+ifeq ($(PWD),)
+$(error You need the GNU utils package to use this Makefile)
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=
+endif
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=.exe
+endif
+ifndef inUnix
+ifeq ($(OS),Windows_NT)
+inWinNT=1
+else
+ifdef OS2_SHELL
+inOS2=1
+endif
+endif
+else
+ifneq ($(findstring cygdrive,$(PATH)),)
+inCygWin=1
+endif
+endif
+ifdef inUnix
+SRCBATCHEXT=.sh
+else
+ifdef inOS2
+SRCBATCHEXT=.cmd
+else
+SRCBATCHEXT=.bat
+endif
+endif
+ifdef COMSPEC
+ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
+ifndef RUNBATCH
+RUNBATCH=$(COMSPEC) /C
+endif
+endif
+endif
+ifdef inUnix
+PATHSEP=/
+else
+PATHSEP:=$(subst /,\,/)
+ifdef inCygWin
+PATHSEP=/
+endif
+endif
+ifdef PWD
+BASEDIR:=$(subst \,/,$(shell $(PWD)))
+ifdef inCygWin
+ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
+BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
+BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
+BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
+endif
+endif
+else
+BASEDIR=.
+endif
+ifdef inOS2
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+endif
+override OS_TARGET_DEFAULT=nds
+override CPU_TARGET_DEFAULT=arm
+override DEFAULT_FPCDIR=../../../../..
+ifndef FPC
+ifdef PP
+FPC=$(PP)
+endif
+endif
+ifndef FPC
+FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
+ifneq ($(FPCPROG),)
+FPCPROG:=$(firstword $(FPCPROG))
+ifneq ($(CPU_TARGET),)
+FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB)
+else
+FPC:=$(shell $(FPCPROG) -PB)
+endif
+ifneq ($(findstring Error,$(FPC)),)
+override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+else
+ifeq ($(strip $(wildcard $(FPC))),)
+FPC:=$(firstword $(FPCPROG))
+endif
+endif
+else
+override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+endif
+endif
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
+FOUNDFPC:=$(strip $(wildcard $(FPC)))
+ifeq ($(FOUNDFPC),)
+FOUNDFPC=$(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))
+ifeq ($(FOUNDFPC),)
+$(error Compiler $(FPC) not found)
+endif
+endif
+ifndef FPC_COMPILERINFO
+FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO)
+endif
+ifndef FPC_VERSION
+FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))
+endif
+export FPC FPC_VERSION FPC_COMPILERINFO
+unexport CHECKDEPEND ALLDEPENDENCIES
+ifndef CPU_TARGET
+ifdef CPU_TARGET_DEFAULT
+CPU_TARGET=$(CPU_TARGET_DEFAULT)
+endif
+endif
+ifndef OS_TARGET
+ifdef OS_TARGET_DEFAULT
+OS_TARGET=$(OS_TARGET_DEFAULT)
+endif
+endif
+ifneq ($(words $(FPC_COMPILERINFO)),5)
+FPC_COMPILERINFO+=$(shell $(FPC) -iSP)
+FPC_COMPILERINFO+=$(shell $(FPC) -iTP)
+FPC_COMPILERINFO+=$(shell $(FPC) -iSO)
+FPC_COMPILERINFO+=$(shell $(FPC) -iTO)
+endif
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))
+endif
+ifndef CPU_TARGET
+CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))
+endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
+endif
+FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifeq ($(CPU_TARGET),armeb)
+ARCH=arm
+override FPCOPT+=-Cb
+else
+ifeq ($(CPU_TARGET),armel)
+ARCH=arm
+override FPCOPT+=-CaEABI
+else
+ARCH=$(CPU_TARGET)
+endif
+endif
+ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+TARGETSUFFIX=$(OS_TARGET)
+SOURCESUFFIX=$(OS_SOURCE)
+else
+TARGETSUFFIX=$(FULL_TARGET)
+SOURCESUFFIX=$(FULL_SOURCE)
+endif
+ifneq ($(FULL_TARGET),$(FULL_SOURCE))
+CROSSCOMPILE=1
+endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(FULL_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first)
+endif
+endif
+ifneq ($(findstring $(OS_TARGET),$(BSDs)),)
+BSDhier=1
+endif
+ifeq ($(OS_TARGET),linux)
+linuxHier=1
+endif
+export OS_TARGET OS_SOURCE ARCH CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=wrong
+endif
+else
+override FPCDIR=wrong
+endif
+ifdef DEFAULT_FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=wrong
+endif
+endif
+endif
+ifeq ($(FPCDIR),wrong)
+ifdef inUnix
+override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
+ifeq ($(wildcard $(FPCDIR)/units),)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+endif
+else
+override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR:=$(BASEDIR)
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=c:/pp
+endif
+endif
+endif
+endif
+endif
+ifndef CROSSBINDIR
+CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
+endif
+ifeq ($(OS_TARGET),darwin)
+ifeq ($(OS_SOURCE),darwin)
+DARWIN2DARWIN=1
+endif
+endif
+ifndef BINUTILSPREFIX
+ifndef CROSSBINDIR
+ifdef CROSSCOMPILE
+ifndef DARWIN2DARWIN
+BINUTILSPREFIX=$(CPU_TARGET)-$(OS_TARGET)-
+endif
+endif
+endif
+endif
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(TARGETSUFFIX))
+ifeq ($(UNITSDIR),)
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
+endif
+PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
+BUILD = build
+AUDIO_FILES = $(foreach dir,$(notdir $(wildcard audio/*.*)),$(CURDIR)/audio/$(dir))
+GFX_FILES = $(foreach dir,gfx,$(notdir $(wildcard $(dir)/*.png)))
+ifeq ($(FULL_TARGET),i386-linux)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),powerpc-gamecube)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override TARGET_PROGRAMS+=stopwatch
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc-gamecube)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc-gamecube)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+override INSTALL_FPCPACKAGE=y
+ifdef REQUIRE_UNITSDIR
+override UNITSDIR+=$(REQUIRE_UNITSDIR)
+endif
+ifdef REQUIRE_PACKAGESDIR
+override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
+endif
+ifdef ZIPINSTALL
+ifneq ($(findstring $(OS_TARGET),$(UNIXs)),)
+UNIXHier=1
+endif
+else
+ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),)
+UNIXHier=1
+endif
+endif
+ifndef INSTALL_PREFIX
+ifdef PREFIX
+INSTALL_PREFIX=$(PREFIX)
+endif
+endif
+ifndef INSTALL_PREFIX
+ifdef UNIXHier
+INSTALL_PREFIX=/usr/local
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_BASEDIR:=/pp
+else
+INSTALL_BASEDIR:=/$(PACKAGE_NAME)
+endif
+endif
+endif
+export INSTALL_PREFIX
+ifdef INSTALL_FPCSUBDIR
+export INSTALL_FPCSUBDIR
+endif
+ifndef DIST_DESTDIR
+DIST_DESTDIR:=$(BASEDIR)
+endif
+export DIST_DESTDIR
+ifndef COMPILER_UNITTARGETDIR
+ifdef PACKAGEDIR_MAIN
+COMPILER_UNITTARGETDIR=$(PACKAGEDIR_MAIN)/units/$(TARGETSUFFIX)
+else
+COMPILER_UNITTARGETDIR=units/$(TARGETSUFFIX)
+endif
+endif
+ifndef COMPILER_TARGETDIR
+COMPILER_TARGETDIR=.
+endif
+ifndef INSTALL_BASEDIR
+ifdef UNIXHier
+ifdef INSTALL_FPCPACKAGE
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
+else
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
+endif
+else
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)
+endif
+endif
+ifndef INSTALL_BINDIR
+ifdef UNIXHier
+INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
+else
+INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
+ifdef INSTALL_FPCPACKAGE
+ifdef CROSSCOMPILE
+ifdef CROSSINSTALL
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(SOURCESUFFIX)
+else
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
+endif
+else
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
+endif
+endif
+endif
+endif
+ifndef INSTALL_UNITDIR
+INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(TARGETSUFFIX)
+ifdef INSTALL_FPCPACKAGE
+ifdef PACKAGE_NAME
+INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
+endif
+endif
+endif
+ifndef INSTALL_LIBDIR
+ifdef UNIXHier
+INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
+else
+INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
+endif
+endif
+ifndef INSTALL_SOURCEDIR
+ifdef UNIXHier
+ifdef BSDhier
+SRCPREFIXDIR=share/src
+else
+ifdef linuxHier
+SRCPREFIXDIR=share/src
+else
+SRCPREFIXDIR=src
+endif
+endif
+ifdef INSTALL_FPCPACKAGE
+ifdef INSTALL_FPCSUBDIR
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
+else
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+endif
+else
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+ifdef INSTALL_FPCSUBDIR
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
+else
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
+endif
+else
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
+endif
+endif
+endif
+ifndef INSTALL_DOCDIR
+ifdef UNIXHier
+ifdef BSDhier
+DOCPREFIXDIR=share/doc
+else
+ifdef linuxHier
+DOCPREFIXDIR=share/doc
+else
+DOCPREFIXDIR=doc
+endif
+endif
+ifdef INSTALL_FPCPACKAGE
+INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+else
+INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
+else
+INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
+endif
+endif
+endif
+ifndef INSTALL_EXAMPLEDIR
+ifdef UNIXHier
+ifdef INSTALL_FPCPACKAGE
+ifdef BSDhier
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+else
+ifdef linuxHier
+INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
+endif
+endif
+else
+ifdef BSDhier
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+else
+ifdef linuxHier
+INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+endif
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
+endif
+endif
+endif
+ifndef INSTALL_DATADIR
+INSTALL_DATADIR=$(INSTALL_BASEDIR)
+endif
+ifndef INSTALL_SHAREDDIR
+INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib
+endif
+ifdef CROSSCOMPILE
+ifndef CROSSBINDIR
+CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX))
+ifeq ($(CROSSBINDIR),)
+CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(TARGETSUFFIX)/bin/$(FULL_SOURCE))
+endif
+endif
+else
+CROSSBINDIR=
+endif
+BATCHEXT=.bat
+LOADEREXT=.as
+EXEEXT=.exe
+PPLEXT=.ppl
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.so
+SHAREDLIBPREFIX=libfp
+STATICLIBPREFIX=libp
+IMPORTLIBPREFIX=libimp
+RSTEXT=.rst
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),go32v1)
+STATICLIBPREFIX=
+SHORTSUFFIX=v1
+endif
+ifeq ($(OS_TARGET),go32v2)
+STATICLIBPREFIX=
+SHORTSUFFIX=dos
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),watcom)
+STATICLIBPREFIX=
+OEXT=.obj
+ASMEXT=.asm
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=wat
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),linux)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=lnx
+endif
+ifeq ($(OS_TARGET),freebsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=fbs
+endif
+ifeq ($(OS_TARGET),netbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=nbs
+endif
+ifeq ($(OS_TARGET),openbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=obs
+endif
+ifeq ($(OS_TARGET),win32)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=w32
+endif
+ifeq ($(OS_TARGET),os2)
+BATCHEXT=.cmd
+AOUTEXT=.out
+STATICLIBPREFIX=
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=os2
+ECHO=echo
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),emx)
+BATCHEXT=.cmd
+AOUTEXT=.out
+STATICLIBPREFIX=
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=emx
+ECHO=echo
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),amiga)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=amg
+endif
+ifeq ($(OS_TARGET),morphos)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=mos
+endif
+ifeq ($(OS_TARGET),atari)
+EXEEXT=.ttp
+SHORTSUFFIX=ata
+endif
+ifeq ($(OS_TARGET),beos)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=be
+endif
+ifeq ($(OS_TARGET),haiku)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=hai
+endif
+ifeq ($(OS_TARGET),solaris)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=sun
+endif
+ifeq ($(OS_TARGET),qnx)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=qnx
+endif
+ifeq ($(OS_TARGET),netware)
+EXEEXT=.nlm
+STATICLIBPREFIX=
+SHORTSUFFIX=nw
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),netwlibc)
+EXEEXT=.nlm
+STATICLIBPREFIX=
+SHORTSUFFIX=nwl
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),macos)
+BATCHEXT=
+EXEEXT=
+DEBUGSYMEXT=.xcoff
+SHORTSUFFIX=mac
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),darwin)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=dwn
+endif
+ifeq ($(OS_TARGET),gba)
+EXEEXT=.gba
+SHAREDLIBEXT=.so
+SHORTSUFFIX=gba
+endif
+ifeq ($(OS_TARGET),nds)
+EXEEXT=.nds
+SHAREDLIBEXT=.so
+SHORTSUFFIX=nds
+endif
+ifeq ($(OS_TARGET),symbian)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=symbian
+endif
+ifeq ($(OS_TARGET),gamecube)
+EXEEXT=.dol
+SHAREDLIBEXT=.so
+SHORTSUFFIX=gamecube
+endif
+ifeq ($(OS_TARGET),wii)
+EXEEXT=.dol
+SHAREDLIBEXT=.so
+SHORTSUFFIX=wii
+endif
+else
+ifeq ($(OS_TARGET),go32v1)
+PPUEXT=.pp1
+OEXT=.o1
+ASMEXT=.s1
+SMARTEXT=.sl1
+STATICLIBEXT=.a1
+SHAREDLIBEXT=.so1
+STATICLIBPREFIX=
+SHORTSUFFIX=v1
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),go32v2)
+STATICLIBPREFIX=
+SHORTSUFFIX=dos
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),watcom)
+STATICLIBPREFIX=
+SHORTSUFFIX=wat
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),linux)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=lnx
+endif
+ifeq ($(OS_TARGET),freebsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=fbs
+endif
+ifeq ($(OS_TARGET),netbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=nbs
+endif
+ifeq ($(OS_TARGET),openbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=obs
+endif
+ifeq ($(OS_TARGET),win32)
+PPUEXT=.ppw
+OEXT=.ow
+ASMEXT=.sw
+SMARTEXT=.slw
+STATICLIBEXT=.aw
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=w32
+endif
+ifeq ($(OS_TARGET),os2)
+BATCHEXT=.cmd
+PPUEXT=.ppo
+ASMEXT=.so2
+OEXT=.oo2
+AOUTEXT=.out
+SMARTEXT=.sl2
+STATICLIBPREFIX=
+STATICLIBEXT=.ao2
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=os2
+ECHO=echo
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),amiga)
+EXEEXT=
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.library
+SHORTSUFFIX=amg
+endif
+ifeq ($(OS_TARGET),atari)
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=.ttp
+SHORTSUFFIX=ata
+endif
+ifeq ($(OS_TARGET),beos)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=be
+endif
+ifeq ($(OS_TARGET),solaris)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=sun
+endif
+ifeq ($(OS_TARGET),qnx)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=qnx
+endif
+ifeq ($(OS_TARGET),netware)
+STATICLIBPREFIX=
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.nlm
+EXEEXT=.nlm
+SHORTSUFFIX=nw
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),netwlibc)
+STATICLIBPREFIX=
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.nlm
+EXEEXT=.nlm
+SHORTSUFFIX=nwl
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),macos)
+BATCHEXT=
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+DEBUGSYMEXT=.xcoff
+SHORTSUFFIX=mac
+IMPORTLIBPREFIX=imp
+endif
+endif
+ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+FPCMADE=fpcmade.$(SHORTSUFFIX)
+ZIPSUFFIX=$(SHORTSUFFIX)
+ZIPCROSSPREFIX=
+ZIPSOURCESUFFIX=src
+ZIPEXAMPLESUFFIX=exm
+else
+FPCMADE=fpcmade.$(TARGETSUFFIX)
+ZIPSOURCESUFFIX=.source
+ZIPEXAMPLESUFFIX=.examples
+ifdef CROSSCOMPILE
+ZIPSUFFIX=.$(SOURCESUFFIX)
+ZIPCROSSPREFIX=$(TARGETSUFFIX)-
+else
+ZIPSUFFIX=.$(TARGETSUFFIX)
+ZIPCROSSPREFIX=
+endif
+endif
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO= __missing_command_ECHO
+else
+ECHO:=$(firstword $(ECHO))
+endif
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+ifndef DATE
+DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(DATE),)
+DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(DATE),)
+DATE= __missing_command_DATE
+else
+DATE:=$(firstword $(DATE))
+endif
+else
+DATE:=$(firstword $(DATE))
+endif
+endif
+export DATE
+ifndef GINSTALL
+GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(GINSTALL),)
+GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(GINSTALL),)
+GINSTALL= __missing_command_GINSTALL
+else
+GINSTALL:=$(firstword $(GINSTALL))
+endif
+else
+GINSTALL:=$(firstword $(GINSTALL))
+endif
+endif
+export GINSTALL
+ifndef CPPROG
+CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(CPPROG),)
+CPPROG= __missing_command_CPPROG
+else
+CPPROG:=$(firstword $(CPPROG))
+endif
+endif
+export CPPROG
+ifndef RMPROG
+RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(RMPROG),)
+RMPROG= __missing_command_RMPROG
+else
+RMPROG:=$(firstword $(RMPROG))
+endif
+endif
+export RMPROG
+ifndef MVPROG
+MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MVPROG),)
+MVPROG= __missing_command_MVPROG
+else
+MVPROG:=$(firstword $(MVPROG))
+endif
+endif
+export MVPROG
+ifndef MKDIRPROG
+MKDIRPROG:=$(strip $(wildcard $(addsuffix /gmkdir$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MKDIRPROG),)
+MKDIRPROG:=$(strip $(wildcard $(addsuffix /mkdir$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MKDIRPROG),)
+MKDIRPROG= __missing_command_MKDIRPROG
+else
+MKDIRPROG:=$(firstword $(MKDIRPROG))
+endif
+else
+MKDIRPROG:=$(firstword $(MKDIRPROG))
+endif
+endif
+export MKDIRPROG
+ifndef ECHOREDIR
+ifndef inUnix
+ECHOREDIR=echo
+else
+ECHOREDIR=$(ECHO)
+endif
+endif
+ifndef COPY
+COPY:=$(CPPROG) -fp
+endif
+ifndef COPYTREE
+COPYTREE:=$(CPPROG) -Rfp
+endif
+ifndef MKDIRTREE
+MKDIRTREE:=$(MKDIRPROG) -p
+endif
+ifndef MOVE
+MOVE:=$(MVPROG) -f
+endif
+ifndef DEL
+DEL:=$(RMPROG) -f
+endif
+ifndef DELTREE
+DELTREE:=$(RMPROG) -rf
+endif
+ifndef INSTALL
+ifdef inUnix
+INSTALL:=$(GINSTALL) -c -m 644
+else
+INSTALL:=$(COPY)
+endif
+endif
+ifndef INSTALLEXE
+ifdef inUnix
+INSTALLEXE:=$(GINSTALL) -c -m 755
+else
+INSTALLEXE:=$(COPY)
+endif
+endif
+ifndef MKDIR
+MKDIR:=$(GINSTALL) -m 755 -d
+endif
+export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE= __missing_command_PPUMOVE
+else
+PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+export PPUMOVE
+ifndef FPCMAKE
+FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(FPCMAKE),)
+FPCMAKE= __missing_command_FPCMAKE
+else
+FPCMAKE:=$(firstword $(FPCMAKE))
+endif
+endif
+export FPCMAKE
+ifndef ZIPPROG
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ZIPPROG),)
+ZIPPROG= __missing_command_ZIPPROG
+else
+ZIPPROG:=$(firstword $(ZIPPROG))
+endif
+endif
+export ZIPPROG
+ifndef TARPROG
+TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
+TARPROG= __missing_command_TARPROG
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
+endif
+export TARPROG
+ASNAME=$(BINUTILSPREFIX)as
+LDNAME=$(BINUTILSPREFIX)ld
+ARNAME=$(BINUTILSPREFIX)ar
+RCNAME=$(BINUTILSPREFIX)rc
+ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),win32)
+ifeq ($(CROSSBINDIR),)
+ASNAME=asw
+LDNAME=ldw
+ARNAME=arw
+endif
+endif
+endif
+ifndef ASPROG
+ifdef CROSSBINDIR
+ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT)
+else
+ASPROG=$(ASNAME)
+endif
+endif
+ifndef LDPROG
+ifdef CROSSBINDIR
+LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT)
+else
+LDPROG=$(LDNAME)
+endif
+endif
+ifndef RCPROG
+ifdef CROSSBINDIR
+RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT)
+else
+RCPROG=$(RCNAME)
+endif
+endif
+ifndef ARPROG
+ifdef CROSSBINDIR
+ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT)
+else
+ARPROG=$(ARNAME)
+endif
+endif
+AS=$(ASPROG)
+LD=$(LDPROG)
+RC=$(RCPROG)
+AR=$(ARPROG)
+PPAS=ppas$(SRCBATCHEXT)
+ifdef inUnix
+LDCONFIG=ldconfig
+else
+LDCONFIG=
+endif
+ifdef DATE
+DATESTR:=$(shell $(DATE) +%Y%m%d)
+else
+DATESTR=
+endif
+ifndef UPXPROG
+ifeq ($(OS_TARGET),go32v2)
+UPXPROG:=1
+endif
+ifeq ($(OS_TARGET),win32)
+UPXPROG:=1
+endif
+ifdef UPXPROG
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(UPXPROG),)
+UPXPROG=
+else
+UPXPROG:=$(firstword $(UPXPROG))
+endif
+else
+UPXPROG=
+endif
+endif
+export UPXPROG
+ZIPOPT=-9
+ZIPEXT=.zip
+ifeq ($(USETAR),bz2)
+TAROPT=vj
+TAREXT=.tar.bz2
+else
+TAROPT=vz
+TAREXT=.tar.gz
+endif
+override REQUIRE_PACKAGES=libndsfpc
+ifeq ($(FULL_TARGET),i386-linux)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc-gamecube)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifdef REQUIRE_PACKAGES_LIBNDSFPC
+PACKAGEDIR_LIBNDSFPC:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /libndsfpc/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_LIBNDSFPC),)
+ifneq ($(wildcard $(PACKAGEDIR_LIBNDSFPC)/units/$(TARGETSUFFIX)),)
+UNITDIR_LIBNDSFPC=$(PACKAGEDIR_LIBNDSFPC)/units/$(TARGETSUFFIX)
+else
+UNITDIR_LIBNDSFPC=$(PACKAGEDIR_LIBNDSFPC)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_LIBNDSFPC)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_LIBNDSFPC) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_LIBNDSFPC)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_LIBNDSFPC=
+UNITDIR_LIBNDSFPC:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /libndsfpc/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_LIBNDSFPC),)
+UNITDIR_LIBNDSFPC:=$(firstword $(UNITDIR_LIBNDSFPC))
+else
+UNITDIR_LIBNDSFPC=
+endif
+endif
+ifdef UNITDIR_LIBNDSFPC
+override COMPILER_UNITDIR+=$(UNITDIR_LIBNDSFPC)
+endif
+endif
+ifndef NOCPUDEF
+override FPCOPTDEF=$(ARCH)
+endif
+ifneq ($(OS_TARGET),$(OS_SOURCE))
+override FPCOPT+=-T$(OS_TARGET)
+endif
+ifneq ($(CPU_TARGET),$(CPU_SOURCE))
+override FPCOPT+=-P$(ARCH)
+endif
+ifeq ($(OS_SOURCE),openbsd)
+override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
+endif
+ifndef CROSSBOOTSTRAP
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-XP$(BINUTILSPREFIX)
+endif
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-Xr$(RLINKPATH)
+endif
+endif
+ifdef UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
+endif
+ifdef LIBDIR
+override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
+endif
+ifdef OBJDIR
+override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
+endif
+ifdef INCDIR
+override FPCOPT+=$(addprefix -Fi,$(INCDIR))
+endif
+ifdef LINKSMART
+override FPCOPT+=-XX
+endif
+ifdef CREATESMART
+override FPCOPT+=-CX
+endif
+ifdef DEBUG
+override FPCOPT+=-gl
+override FPCOPTDEF+=DEBUG
+endif
+ifdef RELEASE
+ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
+ifeq ($(CPU_TARGET),i386)
+FPCCPUOPT:=-OG2p3
+endif
+ifeq ($(CPU_TARGET),powerpc)
+FPCCPUOPT:=-O1r
+endif
+else
+FPCCPUOPT:=-O2
+endif
+override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
+override FPCOPTDEF+=RELEASE
+endif
+ifdef STRIP
+override FPCOPT+=-Xs
+endif
+ifdef OPTIMIZE
+override FPCOPT+=-O2
+endif
+ifdef VERBOSE
+override FPCOPT+=-vwni
+endif
+ifdef COMPILER_OPTIONS
+override FPCOPT+=$(COMPILER_OPTIONS)
+endif
+ifdef COMPILER_UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
+endif
+ifdef COMPILER_LIBRARYDIR
+override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
+endif
+ifdef COMPILER_OBJECTDIR
+override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
+endif
+ifdef COMPILER_INCLUDEDIR
+override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
+endif
+ifdef CROSSBINDIR
+override FPCOPT+=-FD$(CROSSBINDIR)
+endif
+ifdef COMPILER_TARGETDIR
+override FPCOPT+=-FE$(COMPILER_TARGETDIR)
+ifeq ($(COMPILER_TARGETDIR),.)
+override TARGETDIRPREFIX=
+else
+override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
+endif
+endif
+ifdef COMPILER_UNITTARGETDIR
+override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
+ifeq ($(COMPILER_UNITTARGETDIR),.)
+override UNITTARGETDIRPREFIX=
+else
+override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
+endif
+else
+ifdef COMPILER_TARGETDIR
+override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
+override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
+endif
+endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+ifeq ($(CPU_TARGET),i386)
+override FPCOPT+=-Aas
+endif
+endif
+ifeq ($(findstring 2.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),linux)
+ifeq ($(CPU_TARGET),x86_64)
+override FPCOPT+=-Cg
+endif
+endif
+endif
+ifdef LINKSHARED
+endif
+ifdef OPT
+override FPCOPT+=$(OPT)
+endif
+ifdef FPCOPTDEF
+override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
+endif
+ifdef CFGFILE
+override FPCOPT+=@$(CFGFILE)
+endif
+ifdef USEENV
+override FPCEXTCMD:=$(FPCOPT)
+override FPCOPT:=!FPCEXTCMD
+export FPCEXTCMD
+endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
+override COMPILER:=$(FPC) $(FPCOPT)
+ifeq (,$(findstring -s ,$(COMPILER)))
+EXECPPAS=
+else
+ifeq ($(FULL_SOURCE),$(FULL_TARGET))
+ifdef RUNBATCH
+EXECPPAS:=@$(RUNBATCH) $(PPAS)
+else
+EXECPPAS:=@$(PPAS)
+endif
+endif
+endif
+.PHONY: fpc_exes
+ifndef CROSSINSTALL
+ifneq ($(TARGET_PROGRAMS),)
+override EXEFILES=$(addsuffix $(EXEEXT),$(TARGET_PROGRAMS))
+override EXEOFILES:=$(addsuffix $(OEXT),$(TARGET_PROGRAMS)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS))) $(addprefix $(IMPORTLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS)))
+override ALLTARGET+=fpc_exes
+override INSTALLEXEFILES+=$(EXEFILES)
+override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)
+ifeq ($(OS_TARGET),os2)
+override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))
+endif
+ifeq ($(OS_TARGET),emx)
+override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))
+endif
+endif
+endif
+fpc_exes: $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) $(EXEFILES)
+ifdef TARGET_RSTS
+override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
+override CLEANRSTFILES+=$(RSTFILES)
+endif
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared
+$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
+	@$(ECHOREDIR) Compiled > $(FPCMADE)
+fpc_all: $(FPCMADE)
+fpc_smart:
+	$(MAKE) all LINKSMART=1 CREATESMART=1
+fpc_debug:
+	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .lpr .dpr .pp .rc .res
+$(COMPILER_UNITTARGETDIR):
+	$(MKDIRTREE) $(COMPILER_UNITTARGETDIR)
+$(COMPILER_TARGETDIR):
+	$(MKDIRTREE) $(COMPILER_TARGETDIR)
+%$(PPUEXT): %.pp
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(PPUEXT): %.pas
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.pp
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.pas
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.lpr
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.dpr
+	$(COMPILER) $<
+	$(EXECPPAS)
+%.res: %.rc
+	windres -i $< -o $@
+vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.inc $(COMPILER_INCLUDEDIR)
+vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
+vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
+.PHONY: fpc_shared
+override INSTALLTARGET+=fpc_shared_install
+ifndef SHARED_LIBVERSION
+SHARED_LIBVERSION=$(FPC_VERSION)
+endif
+ifndef SHARED_LIBNAME
+SHARED_LIBNAME=$(PACKAGE_NAME)
+endif
+ifndef SHARED_FULLNAME
+SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT)
+endif
+ifndef SHARED_LIBUNITS
+SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS)
+override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS))
+endif
+fpc_shared:
+ifdef HASSHAREDLIB
+	$(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1
+ifneq ($(SHARED_BUILD),n)
+	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR)
+endif
+else
+	@$(ECHO) Shared Libraries not supported
+endif
+fpc_shared_install:
+ifneq ($(SHARED_BUILD),n)
+ifneq ($(SHARED_LIBUNITS),)
+ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),)
+	$(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR)
+endif
+endif
+endif
+.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
+ifdef INSTALL_UNITS
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
+endif
+ifdef INSTALL_BUILDUNIT
+override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
+endif
+ifdef INSTALLPPUFILES
+override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
+ifneq ($(UNITTARGETDIRPREFIX),)
+override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
+override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
+endif
+override INSTALL_CREATEPACKAGEFPC=1
+endif
+ifdef INSTALLEXEFILES
+ifneq ($(TARGETDIRPREFIX),)
+override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES)))
+endif
+endif
+fpc_install: all $(INSTALLTARGET)
+ifdef INSTALLEXEFILES
+	$(MKDIR) $(INSTALL_BINDIR)
+ifdef UPXPROG
+	-$(UPXPROG) $(INSTALLEXEFILES)
+endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
+endif
+ifdef INSTALL_CREATEPACKAGEFPC
+ifdef FPCMAKE
+ifdef PACKAGE_VERSION
+ifneq ($(wildcard Makefile.fpc),)
+	$(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) Package.fpc $(INSTALL_UNITDIR)
+endif
+endif
+endif
+endif
+ifdef INSTALLPPUFILES
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
+endif
+ifneq ($(wildcard $(LIB_FULLNAME)),)
+	$(MKDIR) $(INSTALL_LIBDIR)
+	$(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
+ifdef inUnix
+	ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
+endif
+endif
+endif
+ifdef INSTALL_FILES
+	$(MKDIR) $(INSTALL_DATADIR)
+	$(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
+endif
+fpc_sourceinstall: distclean
+	$(MKDIR) $(INSTALL_SOURCEDIR)
+	$(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
+fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
+ifdef HASEXAMPLES
+	$(MKDIR) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef EXAMPLESOURCEFILES
+	$(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
+endif
+.PHONY: fpc_clean fpc_cleanall fpc_distclean
+ifdef EXEFILES
+override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
+endif
+ifdef CLEAN_PROGRAMS
+override CLEANEXEFILES+=$(addprefix $(TARGETDIRPREFIX),$(addsuffix $(EXEEXT), $(CLEAN_PROGRAMS)))
+endif
+ifdef CLEAN_UNITS
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
+endif
+ifdef CLEANPPUFILES
+override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
+ifdef DEBUGSYMEXT
+override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
+endif
+override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
+override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
+endif
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
+endif
+ifdef CLEAN_FILES
+	-$(DEL) $(CLEAN_FILES)
+endif
+ifdef LIB_NAME
+	-$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
+endif
+	-$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
+	-$(DEL) *$(ASMEXT) *_ppas$(BATCHEXT)
+fpc_cleanall: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef COMPILER_UNITTARGETDIR
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
+endif
+endif
+ifdef CLEAN_FILES
+	-$(DEL) $(CLEAN_FILES)
+endif
+	-$(DELTREE) units
+	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
+ifneq ($(PPUEXT),.ppu)
+	-$(DEL) *.o *.ppu *.a
+endif
+	-$(DELTREE) *$(SMARTEXT)
+	-$(DEL) fpcmade.* Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
+	-$(DEL) *_ppas$(BATCHEXT)
+ifdef AOUTEXT
+	-$(DEL) *$(AOUTEXT)
+endif
+ifdef DEBUGSYMEXT
+	-$(DEL) *$(DEBUGSYMEXT)
+endif
+fpc_distclean: cleanall
+.PHONY: fpc_baseinfo
+override INFORULES+=fpc_baseinfo
+fpc_baseinfo:
+	@$(ECHO)
+	@$(ECHO)  == Package info ==
+	@$(ECHO)  Package Name..... $(PACKAGE_NAME)
+	@$(ECHO)  Package Version.. $(PACKAGE_VERSION)
+	@$(ECHO)
+	@$(ECHO)  == Configuration info ==
+	@$(ECHO)
+	@$(ECHO)  FPC.......... $(FPC)
+	@$(ECHO)  FPC Version.. $(FPC_VERSION)
+	@$(ECHO)  Source CPU... $(CPU_SOURCE)
+	@$(ECHO)  Target CPU... $(CPU_TARGET)
+	@$(ECHO)  Source OS.... $(OS_SOURCE)
+	@$(ECHO)  Target OS.... $(OS_TARGET)
+	@$(ECHO)  Full Source.. $(FULL_SOURCE)
+	@$(ECHO)  Full Target.. $(FULL_TARGET)
+	@$(ECHO)  SourceSuffix. $(SOURCESUFFIX)
+	@$(ECHO)  TargetSuffix. $(TARGETSUFFIX)
+	@$(ECHO)
+	@$(ECHO)  == Directory info ==
+	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
+	@$(ECHO)  Basedir......... $(BASEDIR)
+	@$(ECHO)  FPCDir.......... $(FPCDIR)
+	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
+	@$(ECHO)  UnitsDir........ $(UNITSDIR)
+	@$(ECHO)  PackagesDir..... $(PACKAGESDIR)
+	@$(ECHO)
+	@$(ECHO)  GCC library..... $(GCCLIBDIR)
+	@$(ECHO)  Other library... $(OTHERLIBDIR)
+	@$(ECHO)
+	@$(ECHO)  == Tools info ==
+	@$(ECHO)
+	@$(ECHO)  As........ $(AS)
+	@$(ECHO)  Ld........ $(LD)
+	@$(ECHO)  Ar........ $(AR)
+	@$(ECHO)  Rc........ $(RC)
+	@$(ECHO)
+	@$(ECHO)  Mv........ $(MVPROG)
+	@$(ECHO)  Cp........ $(CPPROG)
+	@$(ECHO)  Rm........ $(RMPROG)
+	@$(ECHO)  GInstall.. $(GINSTALL)
+	@$(ECHO)  Echo...... $(ECHO)
+	@$(ECHO)  Shell..... $(SHELL)
+	@$(ECHO)  Date...... $(DATE)
+	@$(ECHO)  FPCMake... $(FPCMAKE)
+	@$(ECHO)  PPUMove... $(PPUMOVE)
+	@$(ECHO)  Upx....... $(UPXPROG)
+	@$(ECHO)  Zip....... $(ZIPPROG)
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  Target Loaders........ $(TARGET_LOADERS)
+	@$(ECHO)  Target Units.......... $(TARGET_UNITS)
+	@$(ECHO)  Target Implicit Units. $(TARGET_IMPLICITUNITS)
+	@$(ECHO)  Target Programs....... $(TARGET_PROGRAMS)
+	@$(ECHO)  Target Dirs........... $(TARGET_DIRS)
+	@$(ECHO)  Target Examples....... $(TARGET_EXAMPLES)
+	@$(ECHO)  Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
+	@$(ECHO)
+	@$(ECHO)  Clean Units......... $(CLEAN_UNITS)
+	@$(ECHO)  Clean Files......... $(CLEAN_FILES)
+	@$(ECHO)
+	@$(ECHO)  Install Units....... $(INSTALL_UNITS)
+	@$(ECHO)  Install Files....... $(INSTALL_FILES)
+	@$(ECHO)
+	@$(ECHO)  == Install info ==
+	@$(ECHO)
+	@$(ECHO)  DateStr.............. $(DATESTR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)  ZipPrefix............ $(ZIPPREFIX)
+	@$(ECHO)  ZipCrossPrefix....... $(ZIPCROSSPREFIX)
+	@$(ECHO)  ZipSuffix............ $(ZIPSUFFIX)
+	@$(ECHO)  FullZipName.......... $(FULLZIPNAME)
+	@$(ECHO)  Install FPC Package.. $(INSTALL_FPCPACKAGE)
+	@$(ECHO)
+	@$(ECHO)  Install base dir..... $(INSTALL_BASEDIR)
+	@$(ECHO)  Install binary dir... $(INSTALL_BINDIR)
+	@$(ECHO)  Install library dir.. $(INSTALL_LIBDIR)
+	@$(ECHO)  Install units dir.... $(INSTALL_UNITDIR)
+	@$(ECHO)  Install source dir... $(INSTALL_SOURCEDIR)
+	@$(ECHO)  Install doc dir...... $(INSTALL_DOCDIR)
+	@$(ECHO)  Install example dir.. $(INSTALL_EXAMPLEDIR)
+	@$(ECHO)  Install data dir..... $(INSTALL_DATADIR)
+	@$(ECHO)
+	@$(ECHO)  Dist destination dir. $(DIST_DESTDIR)
+	@$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
+	@$(ECHO)
+.PHONY: fpc_info
+fpc_info: $(INFORULES)
+.PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
+	fpc_makefile_dirs
+fpc_makefile:
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
+fpc_makefile_sub1:
+ifdef TARGET_DIRS
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+endif
+fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
+fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
+fpc_makefiles: fpc_makefile fpc_makefile_dirs
+ifndef BIN2S
+BIN2S:=$(strip $(wildcard $(addsuffix /bin2s$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(BIN2S),)
+BIN2S= __missing_command_BIN2S
+else
+BIN2S:=$(firstword $(BIN2S))
+endif
+endif
+export BIN2S
+ifndef MMUTIL
+MMUTIL:=$(strip $(wildcard $(addsuffix /mmutil$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MMUTIL),)
+MMUTIL= __missing_command_MMUTIL
+else
+MMUTIL:=$(firstword $(MMUTIL))
+endif
+endif
+export MMUTIL
+ifndef GRIT
+GRIT:=$(strip $(wildcard $(addsuffix /grit$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(GRIT),)
+GRIT= __missing_command_GRIT
+else
+GRIT:=$(firstword $(GRIT))
+endif
+endif
+export GRIT
+debug: fpc_debug
+smart: fpc_smart
+release: fpc_release
+units: fpc_units
+examples:
+shared: fpc_shared
+install: fpc_install
+sourceinstall: fpc_sourceinstall
+exampleinstall: fpc_exampleinstall
+distinstall:
+zipinstall:
+zipsourceinstall:
+zipexampleinstall:
+zipdistinstall:
+clean: fpc_clean
+distclean: fpc_distclean
+cleanall: fpc_cleanall
+info: fpc_info
+makefiles: fpc_makefiles
+.PHONY: debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
+.NOTPARALLEL:
+all: direc fpc_all 
+direc:
+ifneq ($(BUILD), $(CURDIR))
+	$(MKDIR) $(BUILD)
+endif
+soundbank.bin.o : $(AUDIO_FILES)
+	@$(MMUTIL) $^ -d -o$(BUILD)/soundbank.bin -h$(BUILD)/soundbank.h
+	$(BIN2S) $(BUILD)/soundbank.bin > $(BUILD)/soundbank.bin.s
+	$(AS) -o $(BUILD)/soundbank.bin.o $(BUILD)/soundbank.bin.s
+$(GFX_FILES).o: 
+	$(GRIT) gfx/$(GFX_FILES) -fts -ff gfx/$(basename $(GFX_FILES)).grit -o$(BUILD)/$(GFX_FILES)
+	$(AS) -o $(BUILD)/$(basename $(GFX_FILES)).o $(BUILD)/$(basename $(GFX_FILES)).s

+ 46 - 0
packages/libndsfpc/examples/time/stopwatch/Makefile.fpc

@@ -0,0 +1,46 @@
+#
+#   Makefile.fpc for Free Pascal libndsfpc 2.x.y Examples
+#
+
+[target]
+loaders=
+programs=stopwatch
+
+[require]
+packages=libndsfpc
+tools=bin2s mmutil grit
+nortl=y
+
+[install]
+fpcpackage=y
+
+[default]
+cpu=arm
+target=nds
+fpcdir=../../../../..
+
+[clean]
+files=*.elf *.o *.s *.nds *.nef *.h *.bin \
+       $(BUILD)/*
+units=*
+
+[prerules]
+BUILD = build
+AUDIO_FILES = $(foreach dir,$(notdir $(wildcard audio/*.*)),$(CURDIR)/audio/$(dir))
+GFX_FILES = $(foreach dir,gfx,$(notdir $(wildcard $(dir)/*.png)))
+
+[rules]
+.NOTPARALLEL:
+all: direc fpc_all 
+direc:
+ifneq ($(BUILD), $(CURDIR))
+        $(MKDIR) $(BUILD)
+endif
+soundbank.bin.o : $(AUDIO_FILES)
+        @$(MMUTIL) $^ -d -o$(BUILD)/soundbank.bin -h$(BUILD)/soundbank.h
+        $(BIN2S) $(BUILD)/soundbank.bin > $(BUILD)/soundbank.bin.s
+        $(AS) -o $(BUILD)/soundbank.bin.o $(BUILD)/soundbank.bin.s
+
+$(GFX_FILES).o: 
+        $(GRIT) gfx/$(GFX_FILES) -fts -ff gfx/$(basename $(GFX_FILES)).grit -o$(BUILD)/$(GFX_FILES)
+        $(AS) -o $(BUILD)/$(basename $(GFX_FILES)).o $(BUILD)/$(basename $(GFX_FILES)).s

+ 68 - 0
packages/libndsfpc/examples/time/stopwatch/stopwatch.pp

@@ -0,0 +1,68 @@
+program stopwatch;
+
+{$mode objfpc}
+
+uses
+  ctypes, nds9;
+
+//the speed of the timer when using ClockDivider_1024
+const
+  TIMER_SPEED = (BUS_CLOCK div 1024);
+
+type
+  TTimerStates = (timerState_Stop, timerState_Pause, timerState_Running);
+
+var
+  ticks: cuint = 0;
+	state: TTimerStates = timerState_Stop;
+	down: cint;
+      
+begin
+  consoleDemoInit();
+
+  down := keysDown();
+
+  while (down and KEY_START) = 0 do
+  begin
+		swiWaitForVBlank();
+		consoleClear();
+		scanKeys();
+		down := keysDown();
+
+		if (state = timerState_Running) then
+			ticks := ticks + timerElapsed(0);
+
+		if (down and KEY_A) <> 0 then
+		begin
+			if (state = timerState_Stop) then
+			begin
+				timerStart(0, ClockDivider_1024, 0, nil);
+				state := timerState_Running;
+			end else 
+      if (state = timerState_Pause) then
+			begin
+				timerUnpause(0);
+				state := timerState_Running;
+			end else 
+      if (state = timerState_Running) then
+			begin
+				ticks := ticks + timerPause(0);
+				state := timerState_Pause;
+			end;
+		end else 
+    if (down and KEY_B) <> 0 then
+		begin
+			timerStop(0);
+			ticks := 0;
+			state := timerState_Stop;
+		end;
+
+		iprintf('Press A to start and pause the '#10'timer, B to clear the timer '#10'and start to quit the program.'#10#10);
+		iprintf('ticks:  %u'#10, ticks);
+		iprintf('second: %u:%u'#10, ticks div TIMER_SPEED, ((ticks mod TIMER_SPEED) * 1000) div TIMER_SPEED);
+	end;
+
+	if (state <> timerState_Stop) then
+		timerStop(0);
+
+end.

+ 2384 - 0
packages/libndsfpc/examples/time/timercallback/Makefile

@@ -0,0 +1,2384 @@
+#
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2010/11/11]
+#
+default: all
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-gamecube powerpc-wii sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
+BSDs = freebsd netbsd openbsd darwin
+UNIXs = linux $(BSDs) solaris qnx haiku
+LIMIT83fs = go32v2 os2 emx watcom
+OSNeedsComspecToRunBatch = go32v2 watcom
+FORCE:
+.PHONY: FORCE
+override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
+ifneq ($(findstring darwin,$(OSTYPE)),)
+inUnix=1 #darwin
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+ifeq ($(findstring ;,$(PATH)),)
+inUnix=1
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+SEARCHPATH:=$(subst ;, ,$(PATH))
+endif
+endif
+SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
+PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
+ifeq ($(PWD),)
+PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
+ifeq ($(PWD),)
+$(error You need the GNU utils package to use this Makefile)
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=
+endif
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=.exe
+endif
+ifndef inUnix
+ifeq ($(OS),Windows_NT)
+inWinNT=1
+else
+ifdef OS2_SHELL
+inOS2=1
+endif
+endif
+else
+ifneq ($(findstring cygdrive,$(PATH)),)
+inCygWin=1
+endif
+endif
+ifdef inUnix
+SRCBATCHEXT=.sh
+else
+ifdef inOS2
+SRCBATCHEXT=.cmd
+else
+SRCBATCHEXT=.bat
+endif
+endif
+ifdef COMSPEC
+ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
+ifndef RUNBATCH
+RUNBATCH=$(COMSPEC) /C
+endif
+endif
+endif
+ifdef inUnix
+PATHSEP=/
+else
+PATHSEP:=$(subst /,\,/)
+ifdef inCygWin
+PATHSEP=/
+endif
+endif
+ifdef PWD
+BASEDIR:=$(subst \,/,$(shell $(PWD)))
+ifdef inCygWin
+ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
+BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
+BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
+BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
+endif
+endif
+else
+BASEDIR=.
+endif
+ifdef inOS2
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+endif
+override OS_TARGET_DEFAULT=nds
+override CPU_TARGET_DEFAULT=arm
+override DEFAULT_FPCDIR=../../../../..
+ifndef FPC
+ifdef PP
+FPC=$(PP)
+endif
+endif
+ifndef FPC
+FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
+ifneq ($(FPCPROG),)
+FPCPROG:=$(firstword $(FPCPROG))
+ifneq ($(CPU_TARGET),)
+FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB)
+else
+FPC:=$(shell $(FPCPROG) -PB)
+endif
+ifneq ($(findstring Error,$(FPC)),)
+override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+else
+ifeq ($(strip $(wildcard $(FPC))),)
+FPC:=$(firstword $(FPCPROG))
+endif
+endif
+else
+override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+endif
+endif
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
+FOUNDFPC:=$(strip $(wildcard $(FPC)))
+ifeq ($(FOUNDFPC),)
+FOUNDFPC=$(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))
+ifeq ($(FOUNDFPC),)
+$(error Compiler $(FPC) not found)
+endif
+endif
+ifndef FPC_COMPILERINFO
+FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO)
+endif
+ifndef FPC_VERSION
+FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))
+endif
+export FPC FPC_VERSION FPC_COMPILERINFO
+unexport CHECKDEPEND ALLDEPENDENCIES
+ifndef CPU_TARGET
+ifdef CPU_TARGET_DEFAULT
+CPU_TARGET=$(CPU_TARGET_DEFAULT)
+endif
+endif
+ifndef OS_TARGET
+ifdef OS_TARGET_DEFAULT
+OS_TARGET=$(OS_TARGET_DEFAULT)
+endif
+endif
+ifneq ($(words $(FPC_COMPILERINFO)),5)
+FPC_COMPILERINFO+=$(shell $(FPC) -iSP)
+FPC_COMPILERINFO+=$(shell $(FPC) -iTP)
+FPC_COMPILERINFO+=$(shell $(FPC) -iSO)
+FPC_COMPILERINFO+=$(shell $(FPC) -iTO)
+endif
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))
+endif
+ifndef CPU_TARGET
+CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))
+endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
+endif
+FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifeq ($(CPU_TARGET),armeb)
+ARCH=arm
+override FPCOPT+=-Cb
+else
+ifeq ($(CPU_TARGET),armel)
+ARCH=arm
+override FPCOPT+=-CaEABI
+else
+ARCH=$(CPU_TARGET)
+endif
+endif
+ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+TARGETSUFFIX=$(OS_TARGET)
+SOURCESUFFIX=$(OS_SOURCE)
+else
+TARGETSUFFIX=$(FULL_TARGET)
+SOURCESUFFIX=$(FULL_SOURCE)
+endif
+ifneq ($(FULL_TARGET),$(FULL_SOURCE))
+CROSSCOMPILE=1
+endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(FULL_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first)
+endif
+endif
+ifneq ($(findstring $(OS_TARGET),$(BSDs)),)
+BSDhier=1
+endif
+ifeq ($(OS_TARGET),linux)
+linuxHier=1
+endif
+export OS_TARGET OS_SOURCE ARCH CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=wrong
+endif
+else
+override FPCDIR=wrong
+endif
+ifdef DEFAULT_FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=wrong
+endif
+endif
+endif
+ifeq ($(FPCDIR),wrong)
+ifdef inUnix
+override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
+ifeq ($(wildcard $(FPCDIR)/units),)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+endif
+else
+override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR:=$(BASEDIR)
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=c:/pp
+endif
+endif
+endif
+endif
+endif
+ifndef CROSSBINDIR
+CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
+endif
+ifeq ($(OS_TARGET),darwin)
+ifeq ($(OS_SOURCE),darwin)
+DARWIN2DARWIN=1
+endif
+endif
+ifndef BINUTILSPREFIX
+ifndef CROSSBINDIR
+ifdef CROSSCOMPILE
+ifndef DARWIN2DARWIN
+BINUTILSPREFIX=$(CPU_TARGET)-$(OS_TARGET)-
+endif
+endif
+endif
+endif
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(TARGETSUFFIX))
+ifeq ($(UNITSDIR),)
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
+endif
+PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
+BUILD = build
+AUDIO_FILES = $(foreach dir,$(notdir $(wildcard audio/*.*)),$(CURDIR)/audio/$(dir))
+GFX_FILES = $(foreach dir,gfx,$(notdir $(wildcard $(dir)/*.png)))
+ifeq ($(FULL_TARGET),i386-linux)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),powerpc-gamecube)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override TARGET_PROGRAMS+=timercallback
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc-gamecube)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override CLEAN_UNITS+=*
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc-gamecube)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override CLEAN_FILES+=*.elf *.o *.s *.nds *.nef *.h *.bin $(BUILD)/*
+endif
+override INSTALL_FPCPACKAGE=y
+ifdef REQUIRE_UNITSDIR
+override UNITSDIR+=$(REQUIRE_UNITSDIR)
+endif
+ifdef REQUIRE_PACKAGESDIR
+override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
+endif
+ifdef ZIPINSTALL
+ifneq ($(findstring $(OS_TARGET),$(UNIXs)),)
+UNIXHier=1
+endif
+else
+ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),)
+UNIXHier=1
+endif
+endif
+ifndef INSTALL_PREFIX
+ifdef PREFIX
+INSTALL_PREFIX=$(PREFIX)
+endif
+endif
+ifndef INSTALL_PREFIX
+ifdef UNIXHier
+INSTALL_PREFIX=/usr/local
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_BASEDIR:=/pp
+else
+INSTALL_BASEDIR:=/$(PACKAGE_NAME)
+endif
+endif
+endif
+export INSTALL_PREFIX
+ifdef INSTALL_FPCSUBDIR
+export INSTALL_FPCSUBDIR
+endif
+ifndef DIST_DESTDIR
+DIST_DESTDIR:=$(BASEDIR)
+endif
+export DIST_DESTDIR
+ifndef COMPILER_UNITTARGETDIR
+ifdef PACKAGEDIR_MAIN
+COMPILER_UNITTARGETDIR=$(PACKAGEDIR_MAIN)/units/$(TARGETSUFFIX)
+else
+COMPILER_UNITTARGETDIR=units/$(TARGETSUFFIX)
+endif
+endif
+ifndef COMPILER_TARGETDIR
+COMPILER_TARGETDIR=.
+endif
+ifndef INSTALL_BASEDIR
+ifdef UNIXHier
+ifdef INSTALL_FPCPACKAGE
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
+else
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
+endif
+else
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)
+endif
+endif
+ifndef INSTALL_BINDIR
+ifdef UNIXHier
+INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
+else
+INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
+ifdef INSTALL_FPCPACKAGE
+ifdef CROSSCOMPILE
+ifdef CROSSINSTALL
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(SOURCESUFFIX)
+else
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
+endif
+else
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
+endif
+endif
+endif
+endif
+ifndef INSTALL_UNITDIR
+INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(TARGETSUFFIX)
+ifdef INSTALL_FPCPACKAGE
+ifdef PACKAGE_NAME
+INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
+endif
+endif
+endif
+ifndef INSTALL_LIBDIR
+ifdef UNIXHier
+INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
+else
+INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
+endif
+endif
+ifndef INSTALL_SOURCEDIR
+ifdef UNIXHier
+ifdef BSDhier
+SRCPREFIXDIR=share/src
+else
+ifdef linuxHier
+SRCPREFIXDIR=share/src
+else
+SRCPREFIXDIR=src
+endif
+endif
+ifdef INSTALL_FPCPACKAGE
+ifdef INSTALL_FPCSUBDIR
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
+else
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+endif
+else
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+ifdef INSTALL_FPCSUBDIR
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
+else
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
+endif
+else
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
+endif
+endif
+endif
+ifndef INSTALL_DOCDIR
+ifdef UNIXHier
+ifdef BSDhier
+DOCPREFIXDIR=share/doc
+else
+ifdef linuxHier
+DOCPREFIXDIR=share/doc
+else
+DOCPREFIXDIR=doc
+endif
+endif
+ifdef INSTALL_FPCPACKAGE
+INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+else
+INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
+else
+INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
+endif
+endif
+endif
+ifndef INSTALL_EXAMPLEDIR
+ifdef UNIXHier
+ifdef INSTALL_FPCPACKAGE
+ifdef BSDhier
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+else
+ifdef linuxHier
+INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
+endif
+endif
+else
+ifdef BSDhier
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+else
+ifdef linuxHier
+INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+endif
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
+endif
+endif
+endif
+ifndef INSTALL_DATADIR
+INSTALL_DATADIR=$(INSTALL_BASEDIR)
+endif
+ifndef INSTALL_SHAREDDIR
+INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib
+endif
+ifdef CROSSCOMPILE
+ifndef CROSSBINDIR
+CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX))
+ifeq ($(CROSSBINDIR),)
+CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(TARGETSUFFIX)/bin/$(FULL_SOURCE))
+endif
+endif
+else
+CROSSBINDIR=
+endif
+BATCHEXT=.bat
+LOADEREXT=.as
+EXEEXT=.exe
+PPLEXT=.ppl
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.so
+SHAREDLIBPREFIX=libfp
+STATICLIBPREFIX=libp
+IMPORTLIBPREFIX=libimp
+RSTEXT=.rst
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),go32v1)
+STATICLIBPREFIX=
+SHORTSUFFIX=v1
+endif
+ifeq ($(OS_TARGET),go32v2)
+STATICLIBPREFIX=
+SHORTSUFFIX=dos
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),watcom)
+STATICLIBPREFIX=
+OEXT=.obj
+ASMEXT=.asm
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=wat
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),linux)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=lnx
+endif
+ifeq ($(OS_TARGET),freebsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=fbs
+endif
+ifeq ($(OS_TARGET),netbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=nbs
+endif
+ifeq ($(OS_TARGET),openbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=obs
+endif
+ifeq ($(OS_TARGET),win32)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=w32
+endif
+ifeq ($(OS_TARGET),os2)
+BATCHEXT=.cmd
+AOUTEXT=.out
+STATICLIBPREFIX=
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=os2
+ECHO=echo
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),emx)
+BATCHEXT=.cmd
+AOUTEXT=.out
+STATICLIBPREFIX=
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=emx
+ECHO=echo
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),amiga)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=amg
+endif
+ifeq ($(OS_TARGET),morphos)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=mos
+endif
+ifeq ($(OS_TARGET),atari)
+EXEEXT=.ttp
+SHORTSUFFIX=ata
+endif
+ifeq ($(OS_TARGET),beos)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=be
+endif
+ifeq ($(OS_TARGET),haiku)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=hai
+endif
+ifeq ($(OS_TARGET),solaris)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=sun
+endif
+ifeq ($(OS_TARGET),qnx)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=qnx
+endif
+ifeq ($(OS_TARGET),netware)
+EXEEXT=.nlm
+STATICLIBPREFIX=
+SHORTSUFFIX=nw
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),netwlibc)
+EXEEXT=.nlm
+STATICLIBPREFIX=
+SHORTSUFFIX=nwl
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),macos)
+BATCHEXT=
+EXEEXT=
+DEBUGSYMEXT=.xcoff
+SHORTSUFFIX=mac
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),darwin)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=dwn
+endif
+ifeq ($(OS_TARGET),gba)
+EXEEXT=.gba
+SHAREDLIBEXT=.so
+SHORTSUFFIX=gba
+endif
+ifeq ($(OS_TARGET),nds)
+EXEEXT=.nds
+SHAREDLIBEXT=.so
+SHORTSUFFIX=nds
+endif
+ifeq ($(OS_TARGET),symbian)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=symbian
+endif
+ifeq ($(OS_TARGET),gamecube)
+EXEEXT=.dol
+SHAREDLIBEXT=.so
+SHORTSUFFIX=gamecube
+endif
+ifeq ($(OS_TARGET),wii)
+EXEEXT=.dol
+SHAREDLIBEXT=.so
+SHORTSUFFIX=wii
+endif
+else
+ifeq ($(OS_TARGET),go32v1)
+PPUEXT=.pp1
+OEXT=.o1
+ASMEXT=.s1
+SMARTEXT=.sl1
+STATICLIBEXT=.a1
+SHAREDLIBEXT=.so1
+STATICLIBPREFIX=
+SHORTSUFFIX=v1
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),go32v2)
+STATICLIBPREFIX=
+SHORTSUFFIX=dos
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),watcom)
+STATICLIBPREFIX=
+SHORTSUFFIX=wat
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),linux)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=lnx
+endif
+ifeq ($(OS_TARGET),freebsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=fbs
+endif
+ifeq ($(OS_TARGET),netbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=nbs
+endif
+ifeq ($(OS_TARGET),openbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=obs
+endif
+ifeq ($(OS_TARGET),win32)
+PPUEXT=.ppw
+OEXT=.ow
+ASMEXT=.sw
+SMARTEXT=.slw
+STATICLIBEXT=.aw
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=w32
+endif
+ifeq ($(OS_TARGET),os2)
+BATCHEXT=.cmd
+PPUEXT=.ppo
+ASMEXT=.so2
+OEXT=.oo2
+AOUTEXT=.out
+SMARTEXT=.sl2
+STATICLIBPREFIX=
+STATICLIBEXT=.ao2
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=os2
+ECHO=echo
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),amiga)
+EXEEXT=
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.library
+SHORTSUFFIX=amg
+endif
+ifeq ($(OS_TARGET),atari)
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=.ttp
+SHORTSUFFIX=ata
+endif
+ifeq ($(OS_TARGET),beos)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=be
+endif
+ifeq ($(OS_TARGET),solaris)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=sun
+endif
+ifeq ($(OS_TARGET),qnx)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=qnx
+endif
+ifeq ($(OS_TARGET),netware)
+STATICLIBPREFIX=
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.nlm
+EXEEXT=.nlm
+SHORTSUFFIX=nw
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),netwlibc)
+STATICLIBPREFIX=
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.nlm
+EXEEXT=.nlm
+SHORTSUFFIX=nwl
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),macos)
+BATCHEXT=
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+DEBUGSYMEXT=.xcoff
+SHORTSUFFIX=mac
+IMPORTLIBPREFIX=imp
+endif
+endif
+ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+FPCMADE=fpcmade.$(SHORTSUFFIX)
+ZIPSUFFIX=$(SHORTSUFFIX)
+ZIPCROSSPREFIX=
+ZIPSOURCESUFFIX=src
+ZIPEXAMPLESUFFIX=exm
+else
+FPCMADE=fpcmade.$(TARGETSUFFIX)
+ZIPSOURCESUFFIX=.source
+ZIPEXAMPLESUFFIX=.examples
+ifdef CROSSCOMPILE
+ZIPSUFFIX=.$(SOURCESUFFIX)
+ZIPCROSSPREFIX=$(TARGETSUFFIX)-
+else
+ZIPSUFFIX=.$(TARGETSUFFIX)
+ZIPCROSSPREFIX=
+endif
+endif
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO= __missing_command_ECHO
+else
+ECHO:=$(firstword $(ECHO))
+endif
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+ifndef DATE
+DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(DATE),)
+DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(DATE),)
+DATE= __missing_command_DATE
+else
+DATE:=$(firstword $(DATE))
+endif
+else
+DATE:=$(firstword $(DATE))
+endif
+endif
+export DATE
+ifndef GINSTALL
+GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(GINSTALL),)
+GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(GINSTALL),)
+GINSTALL= __missing_command_GINSTALL
+else
+GINSTALL:=$(firstword $(GINSTALL))
+endif
+else
+GINSTALL:=$(firstword $(GINSTALL))
+endif
+endif
+export GINSTALL
+ifndef CPPROG
+CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(CPPROG),)
+CPPROG= __missing_command_CPPROG
+else
+CPPROG:=$(firstword $(CPPROG))
+endif
+endif
+export CPPROG
+ifndef RMPROG
+RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(RMPROG),)
+RMPROG= __missing_command_RMPROG
+else
+RMPROG:=$(firstword $(RMPROG))
+endif
+endif
+export RMPROG
+ifndef MVPROG
+MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MVPROG),)
+MVPROG= __missing_command_MVPROG
+else
+MVPROG:=$(firstword $(MVPROG))
+endif
+endif
+export MVPROG
+ifndef MKDIRPROG
+MKDIRPROG:=$(strip $(wildcard $(addsuffix /gmkdir$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MKDIRPROG),)
+MKDIRPROG:=$(strip $(wildcard $(addsuffix /mkdir$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MKDIRPROG),)
+MKDIRPROG= __missing_command_MKDIRPROG
+else
+MKDIRPROG:=$(firstword $(MKDIRPROG))
+endif
+else
+MKDIRPROG:=$(firstword $(MKDIRPROG))
+endif
+endif
+export MKDIRPROG
+ifndef ECHOREDIR
+ifndef inUnix
+ECHOREDIR=echo
+else
+ECHOREDIR=$(ECHO)
+endif
+endif
+ifndef COPY
+COPY:=$(CPPROG) -fp
+endif
+ifndef COPYTREE
+COPYTREE:=$(CPPROG) -Rfp
+endif
+ifndef MKDIRTREE
+MKDIRTREE:=$(MKDIRPROG) -p
+endif
+ifndef MOVE
+MOVE:=$(MVPROG) -f
+endif
+ifndef DEL
+DEL:=$(RMPROG) -f
+endif
+ifndef DELTREE
+DELTREE:=$(RMPROG) -rf
+endif
+ifndef INSTALL
+ifdef inUnix
+INSTALL:=$(GINSTALL) -c -m 644
+else
+INSTALL:=$(COPY)
+endif
+endif
+ifndef INSTALLEXE
+ifdef inUnix
+INSTALLEXE:=$(GINSTALL) -c -m 755
+else
+INSTALLEXE:=$(COPY)
+endif
+endif
+ifndef MKDIR
+MKDIR:=$(GINSTALL) -m 755 -d
+endif
+export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE= __missing_command_PPUMOVE
+else
+PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+export PPUMOVE
+ifndef FPCMAKE
+FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(FPCMAKE),)
+FPCMAKE= __missing_command_FPCMAKE
+else
+FPCMAKE:=$(firstword $(FPCMAKE))
+endif
+endif
+export FPCMAKE
+ifndef ZIPPROG
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ZIPPROG),)
+ZIPPROG= __missing_command_ZIPPROG
+else
+ZIPPROG:=$(firstword $(ZIPPROG))
+endif
+endif
+export ZIPPROG
+ifndef TARPROG
+TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
+TARPROG= __missing_command_TARPROG
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
+endif
+export TARPROG
+ASNAME=$(BINUTILSPREFIX)as
+LDNAME=$(BINUTILSPREFIX)ld
+ARNAME=$(BINUTILSPREFIX)ar
+RCNAME=$(BINUTILSPREFIX)rc
+ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),win32)
+ifeq ($(CROSSBINDIR),)
+ASNAME=asw
+LDNAME=ldw
+ARNAME=arw
+endif
+endif
+endif
+ifndef ASPROG
+ifdef CROSSBINDIR
+ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT)
+else
+ASPROG=$(ASNAME)
+endif
+endif
+ifndef LDPROG
+ifdef CROSSBINDIR
+LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT)
+else
+LDPROG=$(LDNAME)
+endif
+endif
+ifndef RCPROG
+ifdef CROSSBINDIR
+RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT)
+else
+RCPROG=$(RCNAME)
+endif
+endif
+ifndef ARPROG
+ifdef CROSSBINDIR
+ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT)
+else
+ARPROG=$(ARNAME)
+endif
+endif
+AS=$(ASPROG)
+LD=$(LDPROG)
+RC=$(RCPROG)
+AR=$(ARPROG)
+PPAS=ppas$(SRCBATCHEXT)
+ifdef inUnix
+LDCONFIG=ldconfig
+else
+LDCONFIG=
+endif
+ifdef DATE
+DATESTR:=$(shell $(DATE) +%Y%m%d)
+else
+DATESTR=
+endif
+ifndef UPXPROG
+ifeq ($(OS_TARGET),go32v2)
+UPXPROG:=1
+endif
+ifeq ($(OS_TARGET),win32)
+UPXPROG:=1
+endif
+ifdef UPXPROG
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(UPXPROG),)
+UPXPROG=
+else
+UPXPROG:=$(firstword $(UPXPROG))
+endif
+else
+UPXPROG=
+endif
+endif
+export UPXPROG
+ZIPOPT=-9
+ZIPEXT=.zip
+ifeq ($(USETAR),bz2)
+TAROPT=vj
+TAREXT=.tar.bz2
+else
+TAROPT=vz
+TAREXT=.tar.gz
+endif
+override REQUIRE_PACKAGES=libndsfpc
+ifeq ($(FULL_TARGET),i386-linux)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc-gamecube)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+REQUIRE_PACKAGES_LIBNDSFPC=1
+endif
+ifdef REQUIRE_PACKAGES_LIBNDSFPC
+PACKAGEDIR_LIBNDSFPC:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /libndsfpc/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_LIBNDSFPC),)
+ifneq ($(wildcard $(PACKAGEDIR_LIBNDSFPC)/units/$(TARGETSUFFIX)),)
+UNITDIR_LIBNDSFPC=$(PACKAGEDIR_LIBNDSFPC)/units/$(TARGETSUFFIX)
+else
+UNITDIR_LIBNDSFPC=$(PACKAGEDIR_LIBNDSFPC)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_LIBNDSFPC)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_LIBNDSFPC) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_LIBNDSFPC)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_LIBNDSFPC=
+UNITDIR_LIBNDSFPC:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /libndsfpc/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_LIBNDSFPC),)
+UNITDIR_LIBNDSFPC:=$(firstword $(UNITDIR_LIBNDSFPC))
+else
+UNITDIR_LIBNDSFPC=
+endif
+endif
+ifdef UNITDIR_LIBNDSFPC
+override COMPILER_UNITDIR+=$(UNITDIR_LIBNDSFPC)
+endif
+endif
+ifndef NOCPUDEF
+override FPCOPTDEF=$(ARCH)
+endif
+ifneq ($(OS_TARGET),$(OS_SOURCE))
+override FPCOPT+=-T$(OS_TARGET)
+endif
+ifneq ($(CPU_TARGET),$(CPU_SOURCE))
+override FPCOPT+=-P$(ARCH)
+endif
+ifeq ($(OS_SOURCE),openbsd)
+override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
+endif
+ifndef CROSSBOOTSTRAP
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-XP$(BINUTILSPREFIX)
+endif
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-Xr$(RLINKPATH)
+endif
+endif
+ifdef UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
+endif
+ifdef LIBDIR
+override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
+endif
+ifdef OBJDIR
+override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
+endif
+ifdef INCDIR
+override FPCOPT+=$(addprefix -Fi,$(INCDIR))
+endif
+ifdef LINKSMART
+override FPCOPT+=-XX
+endif
+ifdef CREATESMART
+override FPCOPT+=-CX
+endif
+ifdef DEBUG
+override FPCOPT+=-gl
+override FPCOPTDEF+=DEBUG
+endif
+ifdef RELEASE
+ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
+ifeq ($(CPU_TARGET),i386)
+FPCCPUOPT:=-OG2p3
+endif
+ifeq ($(CPU_TARGET),powerpc)
+FPCCPUOPT:=-O1r
+endif
+else
+FPCCPUOPT:=-O2
+endif
+override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
+override FPCOPTDEF+=RELEASE
+endif
+ifdef STRIP
+override FPCOPT+=-Xs
+endif
+ifdef OPTIMIZE
+override FPCOPT+=-O2
+endif
+ifdef VERBOSE
+override FPCOPT+=-vwni
+endif
+ifdef COMPILER_OPTIONS
+override FPCOPT+=$(COMPILER_OPTIONS)
+endif
+ifdef COMPILER_UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
+endif
+ifdef COMPILER_LIBRARYDIR
+override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
+endif
+ifdef COMPILER_OBJECTDIR
+override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
+endif
+ifdef COMPILER_INCLUDEDIR
+override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
+endif
+ifdef CROSSBINDIR
+override FPCOPT+=-FD$(CROSSBINDIR)
+endif
+ifdef COMPILER_TARGETDIR
+override FPCOPT+=-FE$(COMPILER_TARGETDIR)
+ifeq ($(COMPILER_TARGETDIR),.)
+override TARGETDIRPREFIX=
+else
+override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
+endif
+endif
+ifdef COMPILER_UNITTARGETDIR
+override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
+ifeq ($(COMPILER_UNITTARGETDIR),.)
+override UNITTARGETDIRPREFIX=
+else
+override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
+endif
+else
+ifdef COMPILER_TARGETDIR
+override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
+override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
+endif
+endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+ifeq ($(CPU_TARGET),i386)
+override FPCOPT+=-Aas
+endif
+endif
+ifeq ($(findstring 2.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),linux)
+ifeq ($(CPU_TARGET),x86_64)
+override FPCOPT+=-Cg
+endif
+endif
+endif
+ifdef LINKSHARED
+endif
+ifdef OPT
+override FPCOPT+=$(OPT)
+endif
+ifdef FPCOPTDEF
+override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
+endif
+ifdef CFGFILE
+override FPCOPT+=@$(CFGFILE)
+endif
+ifdef USEENV
+override FPCEXTCMD:=$(FPCOPT)
+override FPCOPT:=!FPCEXTCMD
+export FPCEXTCMD
+endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
+override COMPILER:=$(FPC) $(FPCOPT)
+ifeq (,$(findstring -s ,$(COMPILER)))
+EXECPPAS=
+else
+ifeq ($(FULL_SOURCE),$(FULL_TARGET))
+ifdef RUNBATCH
+EXECPPAS:=@$(RUNBATCH) $(PPAS)
+else
+EXECPPAS:=@$(PPAS)
+endif
+endif
+endif
+.PHONY: fpc_exes
+ifndef CROSSINSTALL
+ifneq ($(TARGET_PROGRAMS),)
+override EXEFILES=$(addsuffix $(EXEEXT),$(TARGET_PROGRAMS))
+override EXEOFILES:=$(addsuffix $(OEXT),$(TARGET_PROGRAMS)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS))) $(addprefix $(IMPORTLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS)))
+override ALLTARGET+=fpc_exes
+override INSTALLEXEFILES+=$(EXEFILES)
+override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)
+ifeq ($(OS_TARGET),os2)
+override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))
+endif
+ifeq ($(OS_TARGET),emx)
+override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))
+endif
+endif
+endif
+fpc_exes: $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) $(EXEFILES)
+ifdef TARGET_RSTS
+override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
+override CLEANRSTFILES+=$(RSTFILES)
+endif
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared
+$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
+	@$(ECHOREDIR) Compiled > $(FPCMADE)
+fpc_all: $(FPCMADE)
+fpc_smart:
+	$(MAKE) all LINKSMART=1 CREATESMART=1
+fpc_debug:
+	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .lpr .dpr .pp .rc .res
+$(COMPILER_UNITTARGETDIR):
+	$(MKDIRTREE) $(COMPILER_UNITTARGETDIR)
+$(COMPILER_TARGETDIR):
+	$(MKDIRTREE) $(COMPILER_TARGETDIR)
+%$(PPUEXT): %.pp
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(PPUEXT): %.pas
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.pp
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.pas
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.lpr
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.dpr
+	$(COMPILER) $<
+	$(EXECPPAS)
+%.res: %.rc
+	windres -i $< -o $@
+vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.inc $(COMPILER_INCLUDEDIR)
+vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
+vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
+.PHONY: fpc_shared
+override INSTALLTARGET+=fpc_shared_install
+ifndef SHARED_LIBVERSION
+SHARED_LIBVERSION=$(FPC_VERSION)
+endif
+ifndef SHARED_LIBNAME
+SHARED_LIBNAME=$(PACKAGE_NAME)
+endif
+ifndef SHARED_FULLNAME
+SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT)
+endif
+ifndef SHARED_LIBUNITS
+SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS)
+override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS))
+endif
+fpc_shared:
+ifdef HASSHAREDLIB
+	$(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1
+ifneq ($(SHARED_BUILD),n)
+	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR)
+endif
+else
+	@$(ECHO) Shared Libraries not supported
+endif
+fpc_shared_install:
+ifneq ($(SHARED_BUILD),n)
+ifneq ($(SHARED_LIBUNITS),)
+ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),)
+	$(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR)
+endif
+endif
+endif
+.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
+ifdef INSTALL_UNITS
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
+endif
+ifdef INSTALL_BUILDUNIT
+override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
+endif
+ifdef INSTALLPPUFILES
+override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
+ifneq ($(UNITTARGETDIRPREFIX),)
+override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
+override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
+endif
+override INSTALL_CREATEPACKAGEFPC=1
+endif
+ifdef INSTALLEXEFILES
+ifneq ($(TARGETDIRPREFIX),)
+override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES)))
+endif
+endif
+fpc_install: all $(INSTALLTARGET)
+ifdef INSTALLEXEFILES
+	$(MKDIR) $(INSTALL_BINDIR)
+ifdef UPXPROG
+	-$(UPXPROG) $(INSTALLEXEFILES)
+endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
+endif
+ifdef INSTALL_CREATEPACKAGEFPC
+ifdef FPCMAKE
+ifdef PACKAGE_VERSION
+ifneq ($(wildcard Makefile.fpc),)
+	$(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) Package.fpc $(INSTALL_UNITDIR)
+endif
+endif
+endif
+endif
+ifdef INSTALLPPUFILES
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
+endif
+ifneq ($(wildcard $(LIB_FULLNAME)),)
+	$(MKDIR) $(INSTALL_LIBDIR)
+	$(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
+ifdef inUnix
+	ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
+endif
+endif
+endif
+ifdef INSTALL_FILES
+	$(MKDIR) $(INSTALL_DATADIR)
+	$(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
+endif
+fpc_sourceinstall: distclean
+	$(MKDIR) $(INSTALL_SOURCEDIR)
+	$(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
+fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
+ifdef HASEXAMPLES
+	$(MKDIR) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef EXAMPLESOURCEFILES
+	$(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
+endif
+.PHONY: fpc_clean fpc_cleanall fpc_distclean
+ifdef EXEFILES
+override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
+endif
+ifdef CLEAN_PROGRAMS
+override CLEANEXEFILES+=$(addprefix $(TARGETDIRPREFIX),$(addsuffix $(EXEEXT), $(CLEAN_PROGRAMS)))
+endif
+ifdef CLEAN_UNITS
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
+endif
+ifdef CLEANPPUFILES
+override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
+ifdef DEBUGSYMEXT
+override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
+endif
+override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
+override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
+endif
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
+endif
+ifdef CLEAN_FILES
+	-$(DEL) $(CLEAN_FILES)
+endif
+ifdef LIB_NAME
+	-$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
+endif
+	-$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
+	-$(DEL) *$(ASMEXT) *_ppas$(BATCHEXT)
+fpc_cleanall: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef COMPILER_UNITTARGETDIR
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
+endif
+endif
+ifdef CLEAN_FILES
+	-$(DEL) $(CLEAN_FILES)
+endif
+	-$(DELTREE) units
+	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
+ifneq ($(PPUEXT),.ppu)
+	-$(DEL) *.o *.ppu *.a
+endif
+	-$(DELTREE) *$(SMARTEXT)
+	-$(DEL) fpcmade.* Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
+	-$(DEL) *_ppas$(BATCHEXT)
+ifdef AOUTEXT
+	-$(DEL) *$(AOUTEXT)
+endif
+ifdef DEBUGSYMEXT
+	-$(DEL) *$(DEBUGSYMEXT)
+endif
+fpc_distclean: cleanall
+.PHONY: fpc_baseinfo
+override INFORULES+=fpc_baseinfo
+fpc_baseinfo:
+	@$(ECHO)
+	@$(ECHO)  == Package info ==
+	@$(ECHO)  Package Name..... $(PACKAGE_NAME)
+	@$(ECHO)  Package Version.. $(PACKAGE_VERSION)
+	@$(ECHO)
+	@$(ECHO)  == Configuration info ==
+	@$(ECHO)
+	@$(ECHO)  FPC.......... $(FPC)
+	@$(ECHO)  FPC Version.. $(FPC_VERSION)
+	@$(ECHO)  Source CPU... $(CPU_SOURCE)
+	@$(ECHO)  Target CPU... $(CPU_TARGET)
+	@$(ECHO)  Source OS.... $(OS_SOURCE)
+	@$(ECHO)  Target OS.... $(OS_TARGET)
+	@$(ECHO)  Full Source.. $(FULL_SOURCE)
+	@$(ECHO)  Full Target.. $(FULL_TARGET)
+	@$(ECHO)  SourceSuffix. $(SOURCESUFFIX)
+	@$(ECHO)  TargetSuffix. $(TARGETSUFFIX)
+	@$(ECHO)
+	@$(ECHO)  == Directory info ==
+	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
+	@$(ECHO)  Basedir......... $(BASEDIR)
+	@$(ECHO)  FPCDir.......... $(FPCDIR)
+	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
+	@$(ECHO)  UnitsDir........ $(UNITSDIR)
+	@$(ECHO)  PackagesDir..... $(PACKAGESDIR)
+	@$(ECHO)
+	@$(ECHO)  GCC library..... $(GCCLIBDIR)
+	@$(ECHO)  Other library... $(OTHERLIBDIR)
+	@$(ECHO)
+	@$(ECHO)  == Tools info ==
+	@$(ECHO)
+	@$(ECHO)  As........ $(AS)
+	@$(ECHO)  Ld........ $(LD)
+	@$(ECHO)  Ar........ $(AR)
+	@$(ECHO)  Rc........ $(RC)
+	@$(ECHO)
+	@$(ECHO)  Mv........ $(MVPROG)
+	@$(ECHO)  Cp........ $(CPPROG)
+	@$(ECHO)  Rm........ $(RMPROG)
+	@$(ECHO)  GInstall.. $(GINSTALL)
+	@$(ECHO)  Echo...... $(ECHO)
+	@$(ECHO)  Shell..... $(SHELL)
+	@$(ECHO)  Date...... $(DATE)
+	@$(ECHO)  FPCMake... $(FPCMAKE)
+	@$(ECHO)  PPUMove... $(PPUMOVE)
+	@$(ECHO)  Upx....... $(UPXPROG)
+	@$(ECHO)  Zip....... $(ZIPPROG)
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  Target Loaders........ $(TARGET_LOADERS)
+	@$(ECHO)  Target Units.......... $(TARGET_UNITS)
+	@$(ECHO)  Target Implicit Units. $(TARGET_IMPLICITUNITS)
+	@$(ECHO)  Target Programs....... $(TARGET_PROGRAMS)
+	@$(ECHO)  Target Dirs........... $(TARGET_DIRS)
+	@$(ECHO)  Target Examples....... $(TARGET_EXAMPLES)
+	@$(ECHO)  Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
+	@$(ECHO)
+	@$(ECHO)  Clean Units......... $(CLEAN_UNITS)
+	@$(ECHO)  Clean Files......... $(CLEAN_FILES)
+	@$(ECHO)
+	@$(ECHO)  Install Units....... $(INSTALL_UNITS)
+	@$(ECHO)  Install Files....... $(INSTALL_FILES)
+	@$(ECHO)
+	@$(ECHO)  == Install info ==
+	@$(ECHO)
+	@$(ECHO)  DateStr.............. $(DATESTR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)  ZipPrefix............ $(ZIPPREFIX)
+	@$(ECHO)  ZipCrossPrefix....... $(ZIPCROSSPREFIX)
+	@$(ECHO)  ZipSuffix............ $(ZIPSUFFIX)
+	@$(ECHO)  FullZipName.......... $(FULLZIPNAME)
+	@$(ECHO)  Install FPC Package.. $(INSTALL_FPCPACKAGE)
+	@$(ECHO)
+	@$(ECHO)  Install base dir..... $(INSTALL_BASEDIR)
+	@$(ECHO)  Install binary dir... $(INSTALL_BINDIR)
+	@$(ECHO)  Install library dir.. $(INSTALL_LIBDIR)
+	@$(ECHO)  Install units dir.... $(INSTALL_UNITDIR)
+	@$(ECHO)  Install source dir... $(INSTALL_SOURCEDIR)
+	@$(ECHO)  Install doc dir...... $(INSTALL_DOCDIR)
+	@$(ECHO)  Install example dir.. $(INSTALL_EXAMPLEDIR)
+	@$(ECHO)  Install data dir..... $(INSTALL_DATADIR)
+	@$(ECHO)
+	@$(ECHO)  Dist destination dir. $(DIST_DESTDIR)
+	@$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
+	@$(ECHO)
+.PHONY: fpc_info
+fpc_info: $(INFORULES)
+.PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
+	fpc_makefile_dirs
+fpc_makefile:
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
+fpc_makefile_sub1:
+ifdef TARGET_DIRS
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+endif
+fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
+fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
+fpc_makefiles: fpc_makefile fpc_makefile_dirs
+ifndef BIN2S
+BIN2S:=$(strip $(wildcard $(addsuffix /bin2s$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(BIN2S),)
+BIN2S= __missing_command_BIN2S
+else
+BIN2S:=$(firstword $(BIN2S))
+endif
+endif
+export BIN2S
+ifndef MMUTIL
+MMUTIL:=$(strip $(wildcard $(addsuffix /mmutil$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MMUTIL),)
+MMUTIL= __missing_command_MMUTIL
+else
+MMUTIL:=$(firstword $(MMUTIL))
+endif
+endif
+export MMUTIL
+ifndef GRIT
+GRIT:=$(strip $(wildcard $(addsuffix /grit$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(GRIT),)
+GRIT= __missing_command_GRIT
+else
+GRIT:=$(firstword $(GRIT))
+endif
+endif
+export GRIT
+debug: fpc_debug
+smart: fpc_smart
+release: fpc_release
+units: fpc_units
+examples:
+shared: fpc_shared
+install: fpc_install
+sourceinstall: fpc_sourceinstall
+exampleinstall: fpc_exampleinstall
+distinstall:
+zipinstall:
+zipsourceinstall:
+zipexampleinstall:
+zipdistinstall:
+clean: fpc_clean
+distclean: fpc_distclean
+cleanall: fpc_cleanall
+info: fpc_info
+makefiles: fpc_makefiles
+.PHONY: debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
+.NOTPARALLEL:
+all: direc fpc_all 
+direc:
+ifneq ($(BUILD), $(CURDIR))
+	$(MKDIR) $(BUILD)
+endif
+soundbank.bin.o : $(AUDIO_FILES)
+	@$(MMUTIL) $^ -d -o$(BUILD)/soundbank.bin -h$(BUILD)/soundbank.h
+	$(BIN2S) $(BUILD)/soundbank.bin > $(BUILD)/soundbank.bin.s
+	$(AS) -o $(BUILD)/soundbank.bin.o $(BUILD)/soundbank.bin.s
+$(GFX_FILES).o: 
+	$(GRIT) gfx/$(GFX_FILES) -fts -ff gfx/$(basename $(GFX_FILES)).grit -o$(BUILD)/$(GFX_FILES)
+	$(AS) -o $(BUILD)/$(basename $(GFX_FILES)).o $(BUILD)/$(basename $(GFX_FILES)).s

+ 46 - 0
packages/libndsfpc/examples/time/timercallback/Makefile.fpc

@@ -0,0 +1,46 @@
+#
+#   Makefile.fpc for Free Pascal libndsfpc 2.x.y Examples
+#
+
+[target]
+loaders=
+programs=timercallback
+
+[require]
+packages=libndsfpc
+tools=bin2s mmutil grit
+nortl=y
+
+[install]
+fpcpackage=y
+
+[default]
+cpu=arm
+target=nds
+fpcdir=../../../../..
+
+[clean]
+files=*.elf *.o *.s *.nds *.nef *.h *.bin \
+       $(BUILD)/*
+units=*
+
+[prerules]
+BUILD = build
+AUDIO_FILES = $(foreach dir,$(notdir $(wildcard audio/*.*)),$(CURDIR)/audio/$(dir))
+GFX_FILES = $(foreach dir,gfx,$(notdir $(wildcard $(dir)/*.png)))
+
+[rules]
+.NOTPARALLEL:
+all: direc fpc_all 
+direc:
+ifneq ($(BUILD), $(CURDIR))
+        $(MKDIR) $(BUILD)
+endif
+soundbank.bin.o : $(AUDIO_FILES)
+        @$(MMUTIL) $^ -d -o$(BUILD)/soundbank.bin -h$(BUILD)/soundbank.h
+        $(BIN2S) $(BUILD)/soundbank.bin > $(BUILD)/soundbank.bin.s
+        $(AS) -o $(BUILD)/soundbank.bin.o $(BUILD)/soundbank.bin.s
+
+$(GFX_FILES).o: 
+        $(GRIT) gfx/$(GFX_FILES) -fts -ff gfx/$(basename $(GFX_FILES)).grit -o$(BUILD)/$(GFX_FILES)
+        $(AS) -o $(BUILD)/$(basename $(GFX_FILES)).o $(BUILD)/$(basename $(GFX_FILES)).s

+ 44 - 0
packages/libndsfpc/examples/time/timercallback/timercallback.pp

@@ -0,0 +1,44 @@
+program timercallback;
+
+
+{$mode objfpc}
+
+uses
+  ctypes, nds9;
+  
+  
+procedure waitfor(keys: cint);
+begin
+  scanKeys();
+  while ((keysDown() and keys) = 0) do
+  begin
+    swiWaitForVBlank();
+    scanKeys();
+  end;
+end;
+
+var
+  channel: cuint = 0;
+  play: boolean = true;
+
+//this function will be called by the timer.
+procedure timerCallBack();
+begin
+	if (play) then
+		soundPause(channel)
+	else
+		soundResume(channel);
+
+	play := not play;
+end;
+
+begin
+	soundEnable();
+	channel := soundPlayPSG(DutyCycle_50, 10000, 127, 64);
+
+	//calls the timerCallBack function 5 times per second.
+	timerStart(0, ClockDivider_1024, TIMER_FREQ_1024(5), @timerCallBack);
+
+	waitfor(KEY_A);
+
+end.

+ 1 - 41
packages/libndsfpc/src/nds/arm7/audio.inc

@@ -1,45 +1,5 @@
-(*
-  $Id: audio.inc 25 2007-12-10 21:06:46Z p4p3r0 $
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2005
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  	
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  	
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  	
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-    
-    
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2006  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
 {$ifndef ARM7}
-{$error Audio is only available on the ARM7}
+  {$error Audio is only available on the ARM7}
 {$endif ARM7}
 
 

+ 1 - 41
packages/libndsfpc/src/nds/arm7/clock.inc

@@ -1,45 +1,5 @@
-(*
-  $Id: clock.inc 25 2007-12-10 21:06:46Z p4p3r0 $
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2005
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  	
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  	
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  	
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-    
-    
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2006  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
 {$ifndef ARM7}
-{$error The clock is only available on the ARM7}
+  {$error The clock is only available on the ARM7}
 {$endif ARM7}
 
 {$ifdef NDS_INTERFACE}

+ 34 - 0
packages/libndsfpc/src/nds/arm7/i2c.inc

@@ -0,0 +1,34 @@
+{$ifndef ARM7}
+  {$error i2c header is for ARM7 only}
+{$endif}
+
+{$ifdef NDS_INTERFACE}
+const
+  REG_I2CDATA : pcuint8 = pointer($4004500);
+  REG_I2CCNT	: pcuint8 = pointer($4004501);
+
+procedure i2cWaitBusy(); inline;
+
+type
+  i2cDevices = integer;
+const
+	I2C_CAM0: i2cDevices = $7A;
+	I2C_CAM1: i2cDevices = $78;
+	I2C_UNK1: i2cDevices = $A0;
+	I2C_UNK2: i2cDevices = $E0;
+	I2C_PM  : i2cDevices = $4A;
+	I2C_UNK3: i2cDevices = $40;
+	I2C_UNK4: i2cDevices = $90;
+
+
+function i2cWriteRegister(device, reg, data: cuint8): cuint8; cdecl; external;
+function i2cReadRegister(device, reg: cuint8): cuint8; cdecl; external;
+
+{$endif NDS_INTERFACE}
+
+{$ifdef NDS_IMPLEMENTATION}
+procedure i2cWaitBusy(); inline;
+begin
+  while (REG_I2CCNT^ and $80) <> 0 do;
+end;
+{$endif NDS_IMPLEMENTATION}

+ 0 - 2
packages/libndsfpc/src/nds/arm7/input.inc

@@ -1,5 +1,3 @@
 {$ifdef NDS_INTERFACE}
-
 procedure inputGetAndSend(); cdecl; external;
-
 {$endif NDS_INTERFACE}

+ 94 - 0
packages/libndsfpc/src/nds/arm7/sdmmc.inc

@@ -0,0 +1,94 @@
+{$ifdef NDS_INTERFACE}
+const
+  SDMMC_BASE = $04004800;
+  DISPSTAT_CHK_VBLANK = (1 shl 0);
+
+  REG_SDSTATUS0	  = $1c;
+  REG_SDSTATUS1	  = $1e;
+  REG_SDRESET     = $e0;
+  REG_SDCLKCTL    = $24; 
+  REG_SDOPT       = $28;
+  REG_SDCMD       = $00;
+  REG_SDCMDARG    = $04;
+  REG_SDCMDARG0   = $04;
+  REG_SDCMDARG1  	= $06;
+  REG_SDSTOP      = $08;
+  REG_SDRESP      = $0c;
+  
+  REG_SDRESP0     = $0c;
+  REG_SDRESP1     = $0e;
+  REG_SDRESP2     = $10;
+  REG_SDRESP3     = $12;
+  REG_SDRESP4     = $14;
+  REG_SDRESP5     = $16;
+  REG_SDRESP6     = $18;
+  REG_SDRESP7     = $1a;
+  
+  REG_SDBLKLEN    = $26;
+  REG_SDBLKCOUNT  = $0a;
+  REG_SDFIFO      = $30;
+  
+  TMIO_STAT_CMDRESPEND    = $00000001;
+  TMIO_STAT_DATAEND       = $00000004;
+  TMIO_STAT_CARD_REMOVE   = $00000008;
+  TMIO_STAT_CARD_INSERT   = $00000010;
+  TMIO_STAT_SIGSTATE      = $00000020;
+  TMIO_STAT_WRPROTECT     = $00000080;
+  TMIO_STAT_CARD_REMOVE_A = $00000100;
+  TMIO_STAT_CARD_INSERT_A = $00000200;
+  TMIO_STAT_SIGSTATE_A    = $00000400;
+  TMIO_STAT_CMD_IDX_ERR   = $00010000;
+  TMIO_STAT_CRCFAIL       = $00020000;
+  TMIO_STAT_STOPBIT_ERR   = $00040000;
+  TMIO_STAT_DATATIMEOUT   = $00080000;
+  TMIO_STAT_RXOVERFLOW    = $00100000;
+  TMIO_STAT_TXUNDERRUN    = $00200000;
+  TMIO_STAT_CMDTIMEOUT    = $00400000;
+  TMIO_STAT_RXRDY         = $01000000;
+  TMIO_STAT_TXRQ          = $02000000;
+  TMIO_STAT_ILL_FUNC      = $20000000;
+  TMIO_STAT_CMD_BUSY      = $40000000;
+  TMIO_STAT_ILL_ACCESS    = $80000000;
+
+procedure sdmmc_controller_init(); cdecl; external;
+procedure sdmmc_initirq(); cdecl; external;
+function sdmmc_cardinserted(): cint; cdecl; external;
+
+function sdmmc_sdcard_init(): cint; cdecl; external;
+procedure sdmmc_sdcard_readsector(sector_no: cuint32; _out: pointer); cdecl; external;
+procedure sdmmc_sdcard_readsectors(sector_no: cuint32; int numsectors: cint; _out: pointer); cdecl; external;
+procedure sdmmc_sdcard_writesector(sector_no: cuint32; _in: pointer); cdecl; external;
+procedure sdmmc_sdcard_writesectors(sector_no: cuint32; int numsectors: cint; _in: pointer); cdecl; external;
+
+var
+  sdmmc_curdevice: cint; cvar; external;
+  sdmmc_cid: pcuint32; cvar; external;
+
+function sdmmc_read16(reg: cuint16): cuint16; inline;
+procedure sdmmc_write16(reg, val: cuint16); inline;
+procedure sdmmc_mask16(reg, clear, _set: cuint16); inline;
+
+{$endif NDS_INTERFACE}
+
+{$ifdef NDS_IMPLEMENTATION}
+function sdmmc_read16(reg: cuint16): cuint16; inline;
+begin
+  sdmmc_read16 := pcuint16(SDMMC_BASE + reg)^;
+end;
+
+procedure sdmmc_write16(reg, val: cuint16); inline;
+begin
+	pcuint16(SDMMC_BASE + reg)^ := val;
+end;
+
+procedure sdmmc_mask16(reg, clear, _set: cuint16); inline;
+var
+  val: cuint16;
+begin
+	val := sdmmc_read16(reg);
+	val := val and not clear;
+	val := val or _set;
+	sdmmc_write16(reg, val);
+end;
+{$endif NDS_IMPLEMENTATION}
+

+ 1 - 41
packages/libndsfpc/src/nds/arm7/serial.inc

@@ -1,45 +1,5 @@
-(*
-  $Id: serial.inc 25 2007-12-10 21:06:46Z p4p3r0 $
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2005
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  	
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  	
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  	
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-    
-    
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2006  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
 {$ifndef ARM7}
-{$error Serial header is for ARM7 only}
+  {$error Serial header is for ARM7 only}
 {$endif ARM7}
 
 {$ifdef NDS_INTERFACE}

+ 1 - 41
packages/libndsfpc/src/nds/arm7/touch.inc

@@ -1,45 +1,5 @@
-(*
-  $Id: touch.inc 25 2007-12-10 21:06:46Z p4p3r0 $
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2005
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  	
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  	
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  	
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-    
-    
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2006  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
 {$ifndef ARM7}
-{$error Touch screen is only available on the ARM7}
+  {$error Touch screen is only available on the ARM7}
 {$endif ARM7}
 
 {$ifdef NDS_INTERFACE}

+ 0 - 40
packages/libndsfpc/src/nds/arm9/background.inc

@@ -1,43 +1,3 @@
-(*
-  $Id: background.inc 25 2007-12-10 21:06:46Z p4p3r0 $
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2005
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  	
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  	
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  	
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-    
-    
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2006  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
 {$ifdef NDS_INTERFACE}
 type
   bg_scroll = record

+ 0 - 41
packages/libndsfpc/src/nds/arm9/boxtest.inc

@@ -1,44 +1,3 @@
-(*
-  $Id: boxtest.inc 25 2007-12-10 21:06:46Z p4p3r0 $
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2005
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  	
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  	
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  	
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-    
-    
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2006  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
-
 {$ifdef NDS_INTERFACE}
 function BoxTest(x, y, z, width, height, depth: v16): cint; cdecl; external;
 

+ 0 - 45
packages/libndsfpc/src/nds/arm9/cache.inc

@@ -1,53 +1,8 @@
-(*
-  $Id: cache.inc 25 2007-12-10 21:06:46Z p4p3r0 $
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2005
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  	
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  	
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  	
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-    
-    
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2006  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
 {$ifdef NDS_INTERFACE}
 procedure IC_InvalidateAll(); cdecl; external;
-
 procedure IC_InvalidateRange(const base: pointer; size: cuint32); cdecl; external;
-
 procedure DC_FlushAll(); cdecl; external;
-
 procedure DC_FlushRange(const base: pointer; size: cuint32); cdecl; external;
-
 procedure DC_InvalidateAll(); cdecl; external;
-
 procedure DC_InvalidateRange(const base: pointer; size: cuint32); cdecl; external;
 {$endif NDS_INTERFACE}

+ 1 - 41
packages/libndsfpc/src/nds/arm9/console.inc

@@ -1,43 +1,3 @@
-(*
-  $Id: console.inc 25 2007-12-10 21:06:46Z p4p3r0 $
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2005
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  	
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  	
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  	
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-    
-    
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2006  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
 {$ifdef NDS_INTERFACE}
 //const
 //  CONSOLE_USE_COLOR255 = 16;
@@ -117,7 +77,7 @@ const
 procedure consoleSetFont(console: PPrintConsole; font: PConsoleFont); cdecl; external;
 procedure consoleSetWindow(console: PPrintConsole; x, y, width, height: cint); cdecl; external;
 function consoleGetDefault(): PPrintConsole; cdecl; external;
-procedure consoleSelect(console: PPrintConsole); cdecl; external;
+function consoleSelect(console: PPrintConsole): PPrintConsole; cdecl; external;
 function consoleInit(console: PPrintConsole; layer: cint; atype: BgType; size: BgSize; mapBase, 
   tileBase: cint; mainDisplay: cbool; loadGraphics: cbool): pPrintConsole; cdecl; external;
 function consoleDemoInit(): PPrintConsole; cdecl; external;

+ 0 - 40
packages/libndsfpc/src/nds/arm9/decompress.inc

@@ -1,43 +1,3 @@
-(*
-  $Id$
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2005
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  	
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  	
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  	
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-    
-    
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2006  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
 {$ifdef NDS_INTERFACE}
 
 //type

+ 0 - 40
packages/libndsfpc/src/nds/arm9/dynamicArray.inc

@@ -1,43 +1,3 @@
-(*
-  $Id: dynamicArray.inc 13585 2009-08-23 13:57:45Z Legolas $
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2005
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  	
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  	
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  	
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-    
-    
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2006  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
 {$ifdef NDS_INTERFACE}
 type
   DynamicArray = record 

+ 0 - 40
packages/libndsfpc/src/nds/arm9/exceptions.inc

@@ -1,43 +1,3 @@
-(*
-  $Id: exceptions.inc 25 2007-12-10 21:06:46Z p4p3r0 $
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2005
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  	
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  	
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  	
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-    
-    
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2006  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
 {$ifdef NDS_INTERFACE}
 const
   EXCEPTION_VECTOR : ^VoidFn = pointer($2FFFD9C);

+ 17 - 0
packages/libndsfpc/src/nds/arm9/guitarGrip.inc

@@ -0,0 +1,17 @@
+{$ifdef NDS_INTERFACE}
+
+
+const
+  GUITARGRIP_GREEN   = (1 shl 6);
+  GUITARGRIP_RED     = (1 shl 5);
+  GUITARGRIP_YELLOW  = (1 shl 4);
+  GUITARGRIP_BLUE    = (1 shl 3);
+
+function guitarGripIsInserted(): cbool; cdecl; external;
+procedure guitarGripScanKeys(); cdecl; external;
+
+function guitarGripKeysHeld(): cuint8; cdecl; external;
+function guitarGripKeysDown(): cuint8; cdecl; external;
+function guitarGripKeysUp(): cuint8; cdecl; external;
+
+{$endif NDS_INTERFACE}

+ 0 - 40
packages/libndsfpc/src/nds/arm9/image.inc

@@ -1,43 +1,3 @@
-(*
-  $Id: image.inc 25 2007-12-10 21:06:46Z p4p3r0 $
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2005
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  	
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  	
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  	
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-    
-    
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2006  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
 {$ifdef NDS_INTERFACE}
 type
 //holds a rgb triplet

+ 0 - 40
packages/libndsfpc/src/nds/arm9/input.inc

@@ -1,43 +1,3 @@
-(*
-  $Id: input.inc 25 2007-12-10 21:06:46Z p4p3r0 $
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2005
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  	
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  	
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  	
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-    
-    
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2006  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
 {$ifdef NDS_INTERFACE}
   
 procedure scanKeys(); cdecl; external;

+ 0 - 27
packages/libndsfpc/src/nds/arm9/linkedlist.inc

@@ -1,30 +1,3 @@
-(*---------------------------------------------------------------------------------
-
-	A simple linked list data structure
-
-  Copyright (C) 2008
-			Jason Rogers (dovoto)
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any
-  damages arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any
-  purpose, including commercial applications, and to alter it and
-  redistribute it freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you
-     must not claim that you wrote the original software. If you use
-     this software in a product, an acknowledgment in the product
-     documentation would be appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and
-     must not be misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source
-     distribution.
-
-
----------------------------------------------------------------------------------*)
-
 {$ifdef NDS_INTERFACE}
 
 type

+ 0 - 40
packages/libndsfpc/src/nds/arm9/math.inc

@@ -1,43 +1,3 @@
-(*
-  $Id: math.inc 25 2007-12-10 21:06:46Z p4p3r0 $
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2005
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  	
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  	
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  	
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-    
-    
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2006  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
 {$ifdef NDS_INTERFACE}
 //  Math coprocessor register definitions
 const

+ 0 - 38
packages/libndsfpc/src/nds/arm9/ndsmotion.inc

@@ -1,41 +1,3 @@
-(*
-  $Id: ndsmotion.inc 25 2007-12-10 21:06:46Z p4p3r0 $
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2007
-  		Michael Noland (joat)
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-        
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2007  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
 {$ifdef NDS_INTERFACE}
 type
   MotionCalibration = record

+ 6 - 0
packages/libndsfpc/src/nds/arm9/paddle.inc

@@ -0,0 +1,6 @@
+{$ifdef NDS_INTERFACE}
+function paddleIsInserted(): cbool; cdecl; external;
+function paddleRead(): cuint16; cdecl; external;
+procedure paddleReset(); cdecl; external;
+
+{$endif NDS_INTERFACE}

+ 0 - 40
packages/libndsfpc/src/nds/arm9/pcx.inc

@@ -1,43 +1,3 @@
-(*
-  $Id: pcx.inc 25 2007-12-10 21:06:46Z p4p3r0 $
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2005
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  	
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  	
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  	
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-    
-    
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2006  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
 {$ifdef NDS_INTERFACE}
 type
   // short int = cint16???

+ 24 - 0
packages/libndsfpc/src/nds/arm9/piano.inc

@@ -0,0 +1,24 @@
+{$ifdef NDS_INTERFACE}
+const
+  PIANO_PAK: pcuint16 = pointer($09FFFFFE);
+  PIANO_C   = (1 shl 0);
+  PIANO_CS  = (1 shl 1);
+  PIANO_D   = (1 shl 2);
+  PIANO_DS  = (1 shl 3);
+  PIANO_E   = (1 shl 4);
+  PIANO_F   = (1 shl 5);
+  PIANO_FS  = (1 shl 6);
+  PIANO_G   = (1 shl 7);
+  PIANO_GS  = (1 shl 8);
+  PIANO_A   = (1 shl 9);
+  PIANO_AS  = (1 shl 10);
+  PIANO_B   = (1 shl 13);
+  PIANO_C2  = (1 shl 14);
+
+function pianoIsInserted(): cbool; cdecl; external;
+procedure pianoScanKeys(); cdecl; external;
+
+function pianoKeysHeld(): cuint16; cdecl; external;
+function pianoKeysDown(): cuint16; cdecl; external;
+function pianoKeysUp(): cuint16; cdecl; external;
+{$endif NDS_INTERFACE}

+ 0 - 38
packages/libndsfpc/src/nds/arm9/postest.inc

@@ -1,41 +1,3 @@
-(*
-  $Id: postest.inc 25 2007-12-10 21:06:46Z p4p3r0 $ 
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2007
-  		Michael Noland (joat)
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-        
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2007  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
 {$ifdef NDS_IMPLEMENTATION}
 function PosTestBusy(): cbool; inline;
 begin

+ 0 - 40
packages/libndsfpc/src/nds/arm9/rumble.inc

@@ -1,43 +1,3 @@
-(*
-  $Id: rumble.inc 25 2007-12-10 21:06:46Z p4p3r0 $
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2005
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  	
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  	
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  	
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-    
-    
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2006  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
 {$ifdef NDS_INTERFACE}
 const
   RUMBLE_PAK: pcuint16 = pointer($08000000);

+ 0 - 41
packages/libndsfpc/src/nds/arm9/sassert.inc

@@ -1,44 +1,3 @@
-(*
-  $Id$
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2005
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  	
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  	
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  	
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-    
-    
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2006  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
-
 {$ifdef NDS_INTERFACE}
 procedure __sassert(const fileName: pchar; lineNumber: cint; const conditionString: pchar; const amessage: pchar); cdecl; external;
 procedure sassert(e: boolean; msg: string); inline;

+ 0 - 40
packages/libndsfpc/src/nds/arm9/sound.inc

@@ -1,43 +1,3 @@
-(*
-  $Id: sound.inc 25 2007-12-10 21:06:46Z p4p3r0 $
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2005
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  	
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  	
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  	
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-    
-    
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2006  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
 {$ifdef NDS_INTERFACE}
 
 type

+ 0 - 42
packages/libndsfpc/src/nds/arm9/sprite.inc

@@ -1,45 +1,3 @@
-(*
-  $Id: sprite.inc 25 2007-12-10 21:06:46Z p4p3r0 $
-  ------------------------------------------------------------------------------
-  	sprite.h -- definitions for DS sprites
-  
-  	Copyright (C) 2007
-  		Liran Nuna	(LiraNuna)
-  		Dave Murphy (WinterMute)
-  
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  
-  	1.	The origin of this software must not be misrepresented; you
-  	must not claim that you wrote the original software. If you use
-  	this software in a product, an acknowledgment in the product
-  	documentation would be appreciated but is not required.
-  
-  	2.	Altered source versions must be plainly marked as such, and
-  	must not be misrepresented as being the original software.
-  
-  	3.	This notice may not be removed or altered from any source
-  	distribution.
-  ------------------------------------------------------------------------------
-    
-    
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2006  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
 {$ifndef ARM9}
   {$error Sprites are only available on the ARM9}
 {$endif ARM9}

+ 0 - 40
packages/libndsfpc/src/nds/arm9/trig_lut.inc

@@ -1,43 +1,3 @@
-(*
-  $Id: trig_lut.inc 25 2007-12-10 21:06:46Z p4p3r0 $
-  ------------------------------------------------------------------------------
-  	Copyright (C) 2005
-  		Jason Rogers (dovoto)
-  		Dave Murphy (WinterMute)
-  	
-  	This software is provided 'as-is', without any express or implied
-  	warranty.  In no event will the authors be held liable for any
-  	damages arising from the use of this software.
-  	
-  	Permission is granted to anyone to use this software for any
-  	purpose, including commercial applications, and to alter it and
-  	redistribute it freely, subject to the following restrictions:
-  	
-  	1.	The origin of this software must not be misrepresented; you
-  		must not claim that you wrote the original software. If you use
-  		this software in a product, an acknowledgment in the product
-  		documentation would be appreciated but is not required.
-  	
-  	2.	Altered source versions must be plainly marked as such, and
-  		must not be misrepresented as being the original software.
-  	
-  	3.	This notice may not be removed or altered from any source
-  		distribution.
-  ------------------------------------------------------------------------------
-    
-    
-  Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
-  (http://www.freepascal.org)
-   
-  Copyright (C) 2006  Francesco Lombardi
-  Check http://sourceforge.net/projects/libndsfpc for updates
-   
-  ------------------------------------------------------------------------------
-
-  $Log$
-
-*)
-
 {$ifdef NDS_INTERFACE}
 const
   DEGREES_IN_CIRCLE = (1 shl 15);

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott