aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorInqiyad Sabr <sabr@ariamath.xyz>2025-11-02 10:07:40 +0600
committerInqiyad Sabr <sabr@ariamath.xyz>2025-11-02 10:07:40 +0600
commit11b86ff1a85efe5d1170ea8c90ebca5ac313e24f (patch)
tree12356d8e8677d77b166b8e00d614f491d632597b /Makefile
Add files
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile33
1 files changed, 33 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..4f2f0c0
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,33 @@
+.POSIX:
+
+RM := /bin/rm
+DESTDIR := /usr/local/bin
+
+CFLAGS := -std=c99 -Wfloat-equal -Og
+CFLAGS += -Wall -Werror -Wextra -Wpedantic
+CFLAGS += -m64 -no-pie -pipe
+CFLAGS += -ffunction-sections -fdata-sections
+CFLAGS += -D_XOPEN_SOURCE=500L -flto
+CFLAGS += -march=native -mtune=generic
+
+LDFLAGS := -static -Wl,--build-id=none
+LDFLAGS += -ffunction-sections -fdata-sections
+#LDFLAGS += -Wl,--strip-all
+LDFLAGS += -Wl,--flto
+
+.SUFFIXES: .c .o
+
+g2x: $(FILES) *.o
+ $(CC) $(LDFLAGS) *.o -o g2x
+
+.c.o:
+ $(CC) $(CFLAGS) -c *.c
+
+clean:
+ $(RM) ./*.o
+
+install:
+ install -s -m 0755 g2x $(DESTDIR)
+ install -m 0755 c2x $(DESTDIR)
+
+.PHONY: make clean install