{"id":2587,"date":"2014-07-17T17:53:12","date_gmt":"2014-07-17T15:53:12","guid":{"rendered":"http:\/\/www.final-memory.org\/?p=2587"},"modified":"2014-07-17T17:53:12","modified_gmt":"2014-07-17T15:53:12","slug":"crosscompiling-fur-atari-st-mit-gcc-und-cmake","status":"publish","type":"post","link":"https:\/\/www.final-memory.org\/?p=2587","title":{"rendered":"Crosscompiling f\u00fcr Atari ST mit gcc und CMake"},"content":{"rendered":"<p>Mit dem richtigen CMake File kann man auch f\u00fcr den Atari ST komfortabel mit PC Tools entwickeln.<\/p>\n<p>Ben\u00f6tigt werden<\/p>\n<ol>\n<li>Crosscompiler und -toolchain mit gcc und zugeh\u00f6rigen Tools f\u00fcr Atari ST (z.B. hier: <a href=\"http:\/\/vincent.riviere.free.fr\/soft\/m68k-atari-mint\/\" target=\"_blank\">http:\/\/vincent.riviere.free.fr\/soft\/m68k-atari-mint\/<\/a>)<\/li>\n<li>CMake (<a href=\"http:\/\/cmake.org\/\">http:\/\/cmake.org\/<\/a>)<\/li>\n<li>IDE f\u00fcr das Host System (ich verwende CMake mit Ausgabe von Makefiles und einem Projekt f\u00fcr die Code::Blocks IDE unter Linux)<\/li>\n<\/ol>\n<p>Eine einfache CMakeLists.txt sieht dann wie folgt aus:<\/p>\n<pre>#\r\n# Experimental File to build a basic file with custom startup code and without MiNTLib\r\n# Version 17.7.2014\r\n#\r\ncmake_minimum_required(VERSION 2.8)\r\n# disable strange gcc assumptions\r\nset(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS \"\")\r\nset(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS \"\")\r\n# select Atari ST cross compiler\r\nset(CMAKE_C_COMPILER m68k-atari-mint-gcc)\r\nset(CMAKE_ASM_COMPILER m68k-atari-mint-as)\r\nset(CMAKE_C_FLAGS \"-m68000 -O3 -fomit-frame-pointer -Wall -mshort -nostdlib -std=c99\")\r\nset(CMAKE_EXE_LINKER_FLAGS \u00a0\"${CMAKE_C_FLAGS} ${PROJECT_SOURCE_DIR}\/startup.S\" )\r\nadd_executable(stlow1.tos\r\n\u00a0main.c\r\n\u00a0)<\/pre>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">#<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\"># Experimental File to build a basic file with custom startup code and without MiNTLib<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\"># Version 17.7.2014<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">#<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">cmake_minimum_required(VERSION 2.8)<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\"># disable strange gcc assumptions<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS &#8220;&#8221;)<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS &#8220;&#8221;)<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\"># select Atari ST cross compiler<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">set(CMAKE_C_COMPILER m68k-atari-mint-gcc)<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">set(CMAKE_ASM_COMPILER m68k-atari-mint-as)<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">set(CMAKE_C_FLAGS &#8220;-m68000 -O3 -fomit-frame-pointer -Wall -mshort -nostdlib -std=c99&#8221;)<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">set(CMAKE_EXE_LINKER_FLAGS \u00a0&#8220;${CMAKE_C_FLAGS} ${PROJECT_SOURCE_DIR}\/startup.S&#8221; )<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">add_executable(stlow1.tos<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">main.c<\/div>\n<p>Dabei ergeben sich folgende Eigenschaften:<\/p>\n<ul>\n<li>Code f\u00fcr Atari ST mit 68000er ohne FPU<\/li>\n<li> int ist short, d.h. 16.bit (aber statt int ist eh stdint.h zu verwenden)<\/li>\n<li> MinTLib wird nicht verwendet (d.h. keine Standard C Libraryfunktionen, aber die TOS Bindings sind da und voll funktionsf\u00e4hig, ausserdem wird das Binary sch\u00f6n klein)<\/li>\n<li>eigener Startupcode (hier von Markus Fr\u00f6schle geklaut und um den Initcode von Leonard\/Oxygene erg\u00e4nzt)<\/li>\n<\/ul>\n<p>Letztere sind f\u00fcr mich als Spiele und Demoentwickler interessant, da ich nicht immer 70K unixoide Library \u00a0dazulinken m\u00f6chte.<br \/>\nDie Compilerflags kann man nat\u00fcrlich ggfs f\u00fcr den \u00a0Atari Falcon 030 oder die Firebee passend modifizieren.<\/p>\n<p>Fehlt nur noch ein passendes Projekt, der erzeugte Code mit reinem C ist \u00fcbrigens nah dran an handgeschriebenem Assembler. Nur echte ST Codingcracks werden besseren Assemblercode schreiben k\u00f6nnen als das, was hier ein relativ aktueller gcc erzeugt.<\/p>\n<p>Vielen Dank an Vincent Riviere f\u00fcr die Toolchain und Markus Fr\u00f6schle f\u00fcr praktisches Knowhow, ohne die Mintlib kleine effiziente Executables f\u00fcr den ST zu erzeugen.<\/p>\n<div id=\"facebook_like\"><iframe src=\"http:\/\/www.facebook.com\/plugins\/like.php?href=https%3A%2F%2Fwww.final-memory.org%2F%3Fp%3D2587&amp;layout=standard&amp;show_faces=true&amp;width=500&amp;action=like&amp;font=segoe+ui&amp;colorscheme=light&amp;height=80\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:500px; height:80px;\" allowTransparency=\"true\"><\/iframe><\/div>","protected":false},"excerpt":{"rendered":"<p>Mit dem richtigen CMake File kann man auch f\u00fcr den Atari ST komfortabel mit PC Tools entwickeln. Ben\u00f6tigt werden Crosscompiler und -toolchain mit gcc und zugeh\u00f6rigen Tools f\u00fcr Atari ST (z.B. hier: http:\/\/vincent.riviere.free.fr\/soft\/m68k-atari-mint\/) CMake (http:\/\/cmake.org\/) IDE f\u00fcr das Host System (ich verwende CMake mit Ausgabe von Makefiles und einem Projekt f\u00fcr die Code::Blocks IDE unter &hellip; <a href=\"https:\/\/www.final-memory.org\/?p=2587\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Crosscompiling f\u00fcr Atari ST mit gcc und CMake&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,83,33],"tags":[],"class_list":["post-2587","post","type-post","status-publish","format-standard","hentry","category-atari-st","category-cmake","category-spieleprogrammierung"],"_links":{"self":[{"href":"https:\/\/www.final-memory.org\/index.php?rest_route=\/wp\/v2\/posts\/2587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.final-memory.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.final-memory.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.final-memory.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.final-memory.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2587"}],"version-history":[{"count":2,"href":"https:\/\/www.final-memory.org\/index.php?rest_route=\/wp\/v2\/posts\/2587\/revisions"}],"predecessor-version":[{"id":2589,"href":"https:\/\/www.final-memory.org\/index.php?rest_route=\/wp\/v2\/posts\/2587\/revisions\/2589"}],"wp:attachment":[{"href":"https:\/\/www.final-memory.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.final-memory.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.final-memory.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}