diff options
| author | 2025-02-22 18:10:15 +0330 | |
|---|---|---|
| committer | 2025-02-22 18:10:15 +0330 | |
| commit | 41f68c38e85a91b3bb5522b89f989fe2ca64f0a6 (patch) | |
| tree | 8f9384337fd87469bda79103c690add802475c43 /Makefile | |
woohoo
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e785055 --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ +FLAGS = -Wno-incompatible-library-redeclaration -nostartfiles +SIZE_FLAGS = -flto -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -s -fno-unwind-tables -fomit-frame-pointer -fno-asynchronous-unwind-tables -fno-ident -fvisibility=hidden -march=native -Wl,--build-id=none + +all: m4 c test + +m4: + m4 main.m4 > moonshine.m4.h + +c: + clang main.c -o out.bin $(FLAGS) -O3 + +test: + ./out.bin + +release: + clang main.c -o out.bin.release $(FLAGS) $(SIZE_FLAGS) + +debug: m4 + clang main.c -o out.bin $(FLAGS) -g + lldb ./out.bin -o run + +install: + # make sure you have your CPATH configured to recognize `~/include/`! + cp moonshine.h ~/include/moonshine.h + cp moonshine.m4.h ~/include/moonshine.m4.h + +full: m4 c test install |
