summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2022-05-12 22:18:41 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2022-05-12 22:18:41 +0200
commitac159d0b47f048beb72edabbd05c893894e95721 (patch)
tree2bee3c1e3ee58978af03433c58aaa10a606a123f /Makefile
downloadprijave-ac159d0b47f048beb72edabbd05c893894e95721.tar
prijave-ac159d0b47f048beb72edabbd05c893894e95721.tar.gz
prijave-ac159d0b47f048beb72edabbd05c893894e95721.tar.bz2
prijave-ac159d0b47f048beb72edabbd05c893894e95721.tar.lz
prijave-ac159d0b47f048beb72edabbd05c893894e95721.tar.xz
prijave-ac159d0b47f048beb72edabbd05c893894e95721.tar.zst
prijave-ac159d0b47f048beb72edabbd05c893894e95721.zip
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..a49d1dc
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,27 @@
+DESTDIR=/
+CC = cc
+cflags = -O0 -Wall -I. -fpic -Wformat-security -Wextra -pedantic -g3
+ldflags = $(shell pkg-config --libs sqlite3) -lmicrohttpd # -lintl
+PROJ = prijave
+# 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:
+default:
+ $(CC) -L. $(cflags) $(CFLAGS) $(PROJ).c $(ldflags) $(LDFLAGS) -o$(PROJ)
+install:
+ mkdir -p $(DESTDIR)/usr/bin $(DESTDIR)/etc
+ cp $(PROJ) $(DESTDIR)/usr/bin/
+ -[ ! -f $(DESTDIR)/etc/$(PROJ) ] && cp $(PROJ).conf $(DESTDIR)/etc/$(PROJ)
+
+distclean: clean
+
+clean:
+ rm -f $(PROJ)
+
+uninstall:
+ rm -f $(DESTDIR)/usr/bin/$(PROJ)
+
+valgrind:
+ valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind-out.txt $(COMMAND)
+
+.PHONY: valgrind clean distclean install uninstall default