https://github.com/kw-udon/ucc
Udon C Compiler: C compiler for our original CPU
https://github.com/kw-udon/ucc
c compiler ocaml
Last synced: 6 months ago
JSON representation
Udon C Compiler: C compiler for our original CPU
- Host: GitHub
- URL: https://github.com/kw-udon/ucc
- Owner: keiichiw
- Created: 2014-11-24T13:42:42.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-11-18T15:39:28.000Z (almost 9 years ago)
- Last Synced: 2025-04-21T02:53:40.437Z (6 months ago)
- Topics: c, compiler, ocaml
- Language: C
- Homepage:
- Size: 510 KB
- Stars: 82
- Watchers: 8
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- AwesomeCompiler - ucc
README
# UCC - Udon C Compiler [](https://travis-ci.org/kw-udon/ucc)
C compiler for [GAIA](https://github.com/wasabiz/GAIA3) CPU written in OCaml.
Requirement
==============
* OCaml >= 4.0.1
* ocamlbuild >= 4.0.1
* Clang (for preprocessing and syntax check)Build
==============
``make``To run the tests, use the following command.
``make test``
Example
==========
You can compile C file by the following command.``./bin/ucc ./test/printf.c``
Then, `a.out` will be created. It runs on the simulator.
``./bin/sim -simple a.out``
You can check generated assembly by `-S` option.
``./bin/ucc -S ./test/printf.c``
If you want to see other options, please use `-h` option.
In addition, UCC can compile [xv6 ported to GAIA](https://github.com/wasabiz/xv6), a simple Unix-like OS.
Please use this [Makefile](https://gist.github.com/kw-udon/0fcedda2d29c81a2d1be) to try it.Article
=========
* http://kw-udon.hatenablog.com/entry/2015/03/19/171921 (written in Japanese)