summaryrefslogtreecommitdiffstats
path: root/fiz/naloga/gl/Makefile
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2022-05-07 00:37:25 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2022-05-07 00:37:25 +0200
commita779dae5d38516943081d410d65ace286402dd4a (patch)
treed45e574d43d7c29213f3f8913b30b797625c705a /fiz/naloga/gl/Makefile
parentHELMHOLTZOVA TULJAVA (diff)
downloadsola-gimb-3-a779dae5d38516943081d410d65ace286402dd4a.tar
sola-gimb-3-a779dae5d38516943081d410d65ace286402dd4a.tar.gz
sola-gimb-3-a779dae5d38516943081d410d65ace286402dd4a.tar.bz2
sola-gimb-3-a779dae5d38516943081d410d65ace286402dd4a.tar.lz
sola-gimb-3-a779dae5d38516943081d410d65ace286402dd4a.tar.xz
sola-gimb-3-a779dae5d38516943081d410d65ace286402dd4a.tar.zst
sola-gimb-3-a779dae5d38516943081d410d65ace286402dd4a.zip
Diffstat (limited to 'fiz/naloga/gl/Makefile')
-rw-r--r--fiz/naloga/gl/Makefile40
1 files changed, 40 insertions, 0 deletions
diff --git a/fiz/naloga/gl/Makefile b/fiz/naloga/gl/Makefile
new file mode 100644
index 0000000..7d04b8b
--- /dev/null
+++ b/fiz/naloga/gl/Makefile
@@ -0,0 +1,40 @@
+DESTDIR=/
+CC = cc
+cflags = -O0 -Wall -I. -fpic -Wformat-security -Wextra -pedantic -g3 $(shell pkg-config --cflags libstrophe)
+ldflags = $(shell pkg-config --libs glew) -lglfw
+PROJ = helmholtz
+# cflags and ldflags are used so that users specifying CFLAGS and LDFLAGS do not override my flags
+# += is not used, because gcc usually accepts last option, for example -O0 -O2 will use -O2
+.NOTPARALLEL:
+$(PROJ): vertex_shader.o fragment_shader.o $(PROJ).c
+ # $(CC) -c -DIX_LIB $(cflags) $(CFLAGS) $(PROJ).c
+ # $(CC) -shared -olib$(PROJ).so $(PROJ).o
+ # $(CC) -L. $(cflags) $(CFLAGS) $(PROJ).c -l$(PROJ) $(ldflags) -o$(PROJ)
+ $(CC) $(cflags) $(CFLAGS) $(PROJ).c $(ldflags) -o$(PROJ) *_shader.o
+
+%_shader.o: %.glsl
+ ld -r -b binary -o $@ $<
+
+install:
+ mkdir -p $(DESTDIR)/usr/bin # $(DESTDIR)/etc $(DESTDIR)/usr/include $(DESTDIR)/usr/lib
+ cp $(PROJ) $(DESTDIR)/usr/bin/
+ # cp $(PROJ).conf $(DESTDIR)/etc/$(PROJ)
+ # cp lib$(PROJ).so $(DESTDIR)/usr/lib/
+ # cp $(PROJ).h $(DESTDIR)/usr/include/
+
+distclean: clean
+
+clean:
+ rm -f $(PROJ) # $(PROJ).o lib$(PROJ).so
+
+uninstall:
+ rm -f $(DESTDIR)/usr/bin/$(PROJ) # $(DESTDIR)/etc/$(PROJ) $(DESTDIR)/usr/include/$(PROJ).h $(DESTDIR)/usr/lib/lib$(PROJ).so
+
+valgrind:
+ valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind-out.txt $(COMMAND)
+
+test:
+ ld -r -b binary -o vertex_shader.o vertex.glsl
+ gcc -Wall -Wextra -pedantic -Wformat -Wformat-security -g3 -O0 -otest test.c vertex_shader.o
+
+.PHONY: valgrind clean distclean install uninstall default test