From 3a3292ff4dea6769edaa997add163c21233787ae Mon Sep 17 00:00:00 2001 From: Ruthenic Date: Sun, 10 Apr 2022 14:04:54 -0400 Subject: [PATCH] init --- .gitignore | 1 + Makefile | 30 ++++++++++++++++++++++++++++++ compile_flags.txt | 2 ++ src/main.c | 6 ++++++ 4 files changed, 39 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 compile_flags.txt create mode 100644 src/main.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e660fd9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +bin/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3213aee --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ +VERSION = "\"0.3.2\\n© Ruthenic, 2021-2022\"" + +CC ?= gcc +target ?= $(shell ${CC} -dumpmachine) +CC_FLAGS ?= +CC_FLAGS := ${CC_FLAGS} -Ilib +DESTDIR ?= / + +.PHONY: all debug clean build-release install +all: + @$(shell mkdir -p bin) +all: main + +main: + @${CC} -o bin/main src/main.c ${CC_FLAGS} + +debug: CC_FLAGS:=-g -O0 -v ${CC_FLAGS} +debug: all + +clean: + @rm -rf bin + +release: CC_FLAGS:=-O3 ${CC_FLAGS} +release: all +release: + @strip bin/* + tar -czf release.tar.gz bin/* + +install: + @install -m 777 bin/main ${DESTDIR}/usr/local/bin diff --git a/compile_flags.txt b/compile_flags.txt new file mode 100644 index 0000000..7784424 --- /dev/null +++ b/compile_flags.txt @@ -0,0 +1,2 @@ +-Ilib +-DDRAKECU_VERSION="placeholder" diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..329858e --- /dev/null +++ b/src/main.c @@ -0,0 +1,6 @@ +#include + +int main(int argc, char* argv[]) { + printf("Hello, world!\n"); + return 0; +}