commit fc9d3c1845d5a1c17391493fa8763383d3743d1f Author: neauoire Date: Fri Jan 29 11:17:59 2021 -0800 init diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..37e59e5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Devine Lu Linvega + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..ddcc048 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# Uxn + +A stack-based VM, written in ANSI C. + +## Build + +``` +cc uxn.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -o uxn +``` diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..3ca187c --- /dev/null +++ b/build.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# format code +clang-format -i uxn.c + +# remove old +rm -f ./uxn + +# debug(slow) +cc -std=c89 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og -fsanitize=address -fsanitize=undefined uxn.c -o uxn + +# build(fast) +# cc uxn.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -o uxn + +# Size +echo "Size: $(du -sk ./uxn)" + +# Install +if [ -d "$HOME/bin" ] && [ -e ./uxn ] +then + cp ./uxn $HOME/bin + echo "Installed: $HOME/bin" +fi + +# run +./uxn diff --git a/uxn.c b/uxn.c new file mode 100644 index 0000000..16ca6d5 --- /dev/null +++ b/uxn.c @@ -0,0 +1,19 @@ +#include + +/* +Copyright (c) 2021 Devine Lu Linvega + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE. +*/ + +int +main(int argc, char *argv[]) +{ + printf("hello\n"); + return 0; +}