about summary refs log tree commit diff stats
path: root/makefile
diff options
context:
space:
mode:
authorRen Kararou <[email protected]>2024-12-26 01:50:22 -0600
committerRen Kararou <[email protected]>2024-12-26 01:50:22 -0600
commit746cd14f273a96c0348f4e64f9b347ce49a93f45 (patch)
tree813aee86d27bd8ec0b4416ea6cd5f22603666a89 /makefile
parent6b0cf95d75935308e142232fe646d56d0f9d418c (diff)
downloadnbtpd-746cd14f273a96c0348f4e64f9b347ce49a93f45.tar.gz
nbtpd-746cd14f273a96c0348f4e64f9b347ce49a93f45.tar.bz2
nbtpd-746cd14f273a96c0348f4e64f9b347ce49a93f45.zip
add ci; update packet structs; add makefile
Diffstat (limited to 'makefile')
-rw-r--r--makefile19
1 files changed, 19 insertions, 0 deletions
diff --git a/makefile b/makefile
index e69de29..f5a993a 100644
--- a/makefile
+++ b/makefile
@@ -0,0 +1,19 @@
+CC:=clang
+CFLAGS:=-O3 -funroll-loops
+LDFLAGS:=-flto
+
+INCLUDES=-Iinc/
+
+OBJECTS=bin/obj/main.o bin/obj/packet.o bin/obj/netascii.o
+
+bin/nbtpd: $(OBJECTS)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o bin/nbtpd $^
+
+bin/obj/%.o: src/%.c
+	@if [ ! -d "./bin/obj" ]; then mkdir -p ./bin/obj; fi
+	$(CC) -c $(INCLUDES) $(CFLAGS) -o $@ $^
+
+.PHONY: clean
+clean:
+	rm -rf ./bin
+