aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorkatherine <ageha@airen-no-jikken.icu>2025-05-22 22:50:01 +1000
committerkatherine <ageha@airen-no-jikken.icu>2025-05-22 22:50:01 +1000
commitf44696d037481e196f8049f392477771f1bf09c2 (patch)
tree0b2f7b85188d6000e0aa1ca64abe04a759504afb /Makefile
downloadaty-f44696d037481e196f8049f392477771f1bf09c2.tar.gz
init
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile38
1 files changed, 38 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..22aed93
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,38 @@
+.POSIX:
+.SUFFIXES:
+
+CC = cc
+CFLAGS = -Wall -D_XOPEN_SOURCE=700 -O2
+CFLAGSDEBUG = -std=c99 -Wall -D_XOPEN_SOURCE=700 -pedantic -ggdb3 -O0 -DDEBUG
+PREFIX = /usr/local
+
+all: aty
+
+debug: dbg_aty
+
+install: all
+ mkdir -p $(DESTDIR)$(PREFIX)/bin
+ cp -f aty $(DESTDIR)$(PREFIX)/bin
+
+aty: build/release build/release/main.o
+ $(CC) $(LDFLAGS) -o aty build/release/main.o
+
+dbg_aty: build/debug build/debug/main.o
+ $(CC) $(LDFLAGS) -o dbg_aty build/debug/main.o
+
+build/release:
+ mkdir -p build/release
+
+build/debug:
+ mkdir -p build/debug
+
+build/release/main.o: src/main.c
+ $(CC) -c $(CFLAGS) -o build/release/main.o src/main.c
+
+build/debug/main.o: src/main.c
+ $(CC) -c $(CFLAGS) -o build/debug/main.o src/main.c
+
+clean:
+ rm -f aty
+ rm -f dbg_aty
+ rm -rf build