summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorOlivia Mackintosh <livvy@base.nu>2020-04-21 18:33:32 +0100
committerOlivia Mackintosh <livvy@base.nu>2020-04-21 18:33:32 +0100
commitddd234ea1ff2924e587372aa12c4d5cda99a0ce0 (patch)
treef5c6f28a18b726d04fcbb351341df4fb05714385 /Makefile
downloadtiny-ddd234ea1ff2924e587372aa12c4d5cda99a0ce0.tar.gz
Initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 25 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..6c2b310
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,25 @@
+.PHONY: clean
+DEBUG=false
+CFLAGS := -fno-plt -O1 -std=gnu11 -nostartfiles -Wall -Wextra
+CFLAGS += -fno-stack-protector -fno-stack-check -fno-unwind-tables -fno-asynchronous-unwind-tables -fomit-frame-pointer
+CFLAGS += -no-pie -fno-pic -fno-PIE -fno-PIC -march=core2 -ffunction-sections -fdata-sections
+
+OBJS = track.o device.o tiny.o
+LIBS = `pkg-config --cflags gtk+-3.0` -lGL -lgtk-3 -lgdk-3 -lgobject-2.0
+
+all: tiny.elf tiny
+
+clean:
+ rm -f src/shader.h tiny.elf tiny $(OBJS)
+
+src/shader.h: src/shader.frag Makefile
+ mono ./bin/shader_minifier.exe --preserve-externals src/shader.frag -o ./src/shader.h
+
+%.o: src/%.c
+ gcc -c $< $(LIBS) $(CFLAGS)
+
+tiny.elf: src/shader.h $(OBJS)
+ gcc -o $@ $< $(LIBS) $(CFLAGS) $(OBJS)
+
+tiny: tiny.elf
+ strip -o $@ $< && upx --best $@