{"id":41899832,"url":"https://github.com/agonplatform/agondev","last_synced_at":"2026-02-02T06:17:25.904Z","repository":{"id":274157824,"uuid":"921890231","full_name":"AgonPlatform/agondev","owner":"AgonPlatform","description":"C/C++ Toolchain for the Agon platform","archived":false,"fork":false,"pushed_at":"2025-12-05T03:13:24.000Z","size":2199,"stargazers_count":17,"open_issues_count":6,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-05T20:16:40.869Z","etag":null,"topics":["agonlight","agonlight2","c-language","compiler","ez80","programming"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AgonPlatform.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-24T20:12:22.000Z","updated_at":"2025-12-04T15:46:18.000Z","dependencies_parsed_at":"2025-10-26T13:21:07.844Z","dependency_job_id":null,"html_url":"https://github.com/AgonPlatform/agondev","commit_stats":null,"previous_names":["envenomator/agondev","agonconsole8/agondev","agonplatform/agondev"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/AgonPlatform/agondev","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgonPlatform%2Fagondev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgonPlatform%2Fagondev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgonPlatform%2Fagondev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgonPlatform%2Fagondev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AgonPlatform","download_url":"https://codeload.github.com/AgonPlatform/agondev/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgonPlatform%2Fagondev/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28754807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T13:59:49.818Z","status":"ssl_error","status_checked_at":"2026-01-25T13:59:33.728Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agonlight","agonlight2","c-language","compiler","ez80","programming"],"created_at":"2026-01-25T15:00:41.957Z","updated_at":"2026-01-25T15:00:51.040Z","avatar_url":"https://github.com/AgonPlatform.png","language":"C","readme":"# AGON dev C/C++ toolchain\n## Status\nEarly access Alpha: things will break.\n\nThe toolchain is currently compiled for Linux (x86_64 / arm64) and MacOS (arm64) only. Windows is supported using WSL.\n\n## Purpose\nTo assemble a C/C++ toolchain, based on modern open-source software that can be ported to many platforms\n## Installation guides\n- [Ubuntu Linux installation guide](docs/install-linux.md)\n- [MacOS installation guide](docs/install-mac.md)\n- [Windows (WSL) installation guide](docs/install-windows-wsl.md)\n\n## Project structure\nA minimum project consists of a Makefile and at least a single source file in the 'src' subdirectory:\n``` \nproject/\n│\n├── Makefile\n└── src/\n    └── main.c\n```\n---\n\nThe toolchain expects the following project structure:\n\n``` \nproject/\n│\n├── Makefile\n├── include/\n│   │   Optional directory with project include files, e.g.\n│   └── module.h\n├── src/\n│   │   project source files, e.g.\n│   ├── main.c\n│   └── module.asm\n├── lib/\n│   │   Optional directory with static libraries the\n│   │   project requires, e.g.\n│   ├── libtest.a\n│   └── libsecret.a\n├── obj/\n│   │   objects created by the compiler / assembler\n│   │   this directory will be created automatically\n│   ├── main.o\n│   └── module.o\n└── bin/\n    │   the compiled program is placed here\n    │   this directory will be created automatically\n    └── program.bin\n```\n\n## Compiling programs\nChange directory to the root of your project, compile and link your program with the following command:\n\n``` \nmake\n```\n\nThe same command is required to compile any changes to the source file(s).\n\nClean up the entire build and compile everything from scratch with the following command:\n``` \nmake clean; make\n```\n\n- The 'Makefile' in the root directory of each project provides the required logic to build the project.\n- All source files need to be placed under a project's \u003cb\u003e\u003cproject_dir\u003e/src\u003c/b\u003e directory.\n\n- .c / .cpp / .s / .asm / .src sources will be compiled / assembled directly to an ELF-formatted object file in \u003cb\u003e\u003cproject_dir\u003e/obj\u003c/b\u003e\n\n- The linker will link all objects together with the provided libaries (libc / agon / fp / crt) and create a binary in \u003cb\u003e\u003cproject_dir\u003e/bin\u003c/b\u003e\n\nCheck out the provided example programs, which have a slightly different top-level Makefile with options that are similar to what AgDev provides.\n\n## Uploading programs (version 0.18+)\n\nRequires the installation of the hexload client on the Agon - please see [agon-hexload](https://github.com/AgonPlatform/agon-hexload) for details.\n\nWith a physical Agon system connected to your Linux PC over USB/Serial, start the hexload receiver on the Agon first (AGON COMMAND)\n```\nhexload vdp\n```\nThis will load the binary to memory. If you would like to also write the binary to the SD card, you can use (AGON COMMAND)\n```\nhexload vdp program.bin\n```\nAnd upload your program from the build folder using\n```\nmake upload\n```\nThere is no need to separately install a sending script; this is part of the AgonDev toolchain.\nUnless the SERIALPORT parameter is specified in the project Makefile, the USB/Serial port is autodetected from the sending system. An error is given if multiple serial ports are detected.\n\n## Starting the Fab Agon Emulator (version 0.20+)\n\nRequires the installation of the [Fab Agon Emulator](https://github.com/tomm/fab-agon-emulator).\nSet either globally set the environment variable FAE_HOME for all projects, or set the project-specific makefile option FAE_HOME to the Fab Emulator's installation root directory.\n\nLikewise, the option FAE_DEST is used to copy the built program binary to the Emulator's SDcard space. \nBy default, the program binary is copied to the root folder of the virtual SDcard. If for example the program needs to run from the /bin directory on the Agon, set FAE_DEST to /bin\n\nTo build a project, automatically copy the resulting program binary to the given emulator's virtual SD card and start the emulator, use one of these make targets:\n```\nmake em\nmake emu\nmake emulator\n```\n\n## Minimal project Makefile\nOpen your favorite editor, enter the following text and save it as 'Makefile' in your project's root directory:\n\n``` \nNAME=program\ninclude $(shell agondev-config --makefile)\n``` \n\nAfter successful compilation of your program, this example Makefile creates a 'program.bin' file in the \u003cb\u003e\u003cproject_dir\u003e/bin\u003c/b\u003e directory.\n\n## Makefile options\nThe following options can be set in the user's project Makefile:\n\n| Option                | Description                                                                                                                                                                                                 |\n|-----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **NAME**              | Sets the name of the project.                                                                                                                                                                               |\n| **RAM_START**         | Sets the load/start address of the compiled program. Defaults to `0x040000`.                                                                                                                               |\n| **RAM_SIZE**          | Sets the amount of memory available to the program. Defaults to `0x070000`. The init routine sets the stack pointer to `RAM_START + RAM_SIZE`.                                                             |\n| **LDHAS_ARG_PROCESSING** | Enables command-line argument processing. Default is `0`. Set to `1` to enable additional code for processing redirection and quoting.                                                                    |\n| **LDHAS_EXIT_HANDLER**   | Default is `0`. Set to `1` to print an error message based on the program’s exit code before returning to MOS.                                                                                            |\n| **LIBS**              | Sets flags to link with user-supplied static libraries in the `\u003cproject_dir\u003e/lib` directory. Example: `LIBS=-lsecret`. Multiple libraries allowed, e.g., `LIBS=\"-lsecret -ltest\"`.                           |\n| **SERIALPORT**        | Sets the USB/Serial port for uploading to the Agon via the hexload protocol. Can be set to `auto` (default if not specified).                                                                                |\n| **BAUDRATE**          | Sets the baud rate of the USB/Serial port. Default is `115200`.                                                                                                                                             |\n| **FAE_HOME**          | To make use of the 'make emu / make emulator' target, set this to the install directory of the Fab Agon Emulator |\n| **FAE_DEST**          | Sets the target destination inside the FAE SDcard space, defaults to the root directory                          |\n| **FAE_ARGS**          | Optional arguments to the Fab Agon Emulator, such as '-d'.                                                       |\n\n## Creating static libraries\nCreate a separate project for each library, with all the required source files that go into it, and set the NAME option in the Makefile to the required \u003cb\u003elibrary basename\u003c/b\u003e\n\nCreate a library with the following command:\n``` \nmake lib\n``` \n\nIf for example the library basename is 'example', the library will be compiled to \u003cb\u003e\u003cproject_dir\u003e/bin/libexample.a\u003c/b\u003e\n\nThe compiled library must be manually copied to another project's lib directory for inclusion there. Don't forget to set the LIBS Makefile option in the latter project, e.g. LIBS=-lexample\n\n## Build toolchain from source\n1) clone this repo\n2) Run the make_tools.sh shell script. You need the essentials for compiling and making stuff, e.g. using apt-get install build-essential, but also ninja. This is a hefty build that takes a long time and a lot of memory. About 30min on my AMD 4650, taking up 14-15GB of memory. When it finishes, all binary tools are in the ./release/bin folder\n3) Perform a 'make clean;make all' to build the Agon libraries\n\n## Toolchain components\n- Clang 15.0 C/C++ compiler, emitting ez80 code, forked from (https://github.com/CE-Programming/llvm-project) and patched to output GNU-AS compatible assembly syntax\n- GNU AS assembler, compiled to accept ez80 syntax and output ez80-none-elf objects. Please check the [official manual](https://sourceware.org/binutils/docs-2.25/as/index.html) for syntax and assembler directives\n- GNU LD linker, compiled to link ez80-none-elf objects\n- A significant portion of code from the [AgDev](https://github.com/pcawte/AgDev) toolchain, which is an extension of the [CEDev](https://ce-programming.github.io/toolchain/index.html) toolchain to target the Agon platform\n\n## Known limits\n- My LLVM fork (https://github.com/envenomator/llvm-project) it set up to never output the special 'JQ' meta mnemonic, that a back-end assembler can translate to either 'JR' or 'JP' depending on the distance. Any potential 'JQ' emits are always translated to 'JP', as the GNU Assembler doesn't support 'JQ'. I haven't seen any 'JQ' being emitted in any of my test; it may be that it's behaviour has changed somewhere in the past, however I'd like to make sure it never poses a problem with a GNU Assembler back-end. I do see that the LLVM compiler emits both 'JR' and 'JP' mnemonics where appropriate.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagonplatform%2Fagondev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagonplatform%2Fagondev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagonplatform%2Fagondev/lists"}