summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2022-04-26 22:09:22 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2022-04-26 22:09:22 +0200
commit12a5dfd0761a2a5eb91c8334c0f938631e4b3810 (patch)
tree1faef85cf4e26ea73a5a5a92527eab49dd0926e5 /Makefile
downloadircxmpp-12a5dfd0761a2a5eb91c8334c0f938631e4b3810.tar
ircxmpp-12a5dfd0761a2a5eb91c8334c0f938631e4b3810.tar.gz
ircxmpp-12a5dfd0761a2a5eb91c8334c0f938631e4b3810.tar.bz2
ircxmpp-12a5dfd0761a2a5eb91c8334c0f938631e4b3810.tar.lz
ircxmpp-12a5dfd0761a2a5eb91c8334c0f938631e4b3810.tar.xz
ircxmpp-12a5dfd0761a2a5eb91c8334c0f938631e4b3810.tar.zst
ircxmpp-12a5dfd0761a2a5eb91c8334c0f938631e4b3810.zip
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 26 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..13dfd0d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,26 @@
+DESTDIR=/
+CC = cc
+cflags = -O0 -Wall -I. -Wextra -pedantic -g $(shell pkg-config --cflags libstrophe)
+SRCFILE = main.c
+ldflags = $(shell pkg-config --libs libstrophe) -lircclient
+BINFILE = ircxmpp
+# 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) $(cflags) $(CFLAGS) $(SRCFILE) $(ldflags) $(LDFLAGS) -o$(BINFILE)
+
+install:
+ mkdir -p $(DESTDIR)/usr/bin/
+ cp $(BINFILE) $(DESTDIR)/usr/bin/
+
+distclean:
+ rm $(BINFILE) tmp -rf
+
+clean:
+ rm $(BINFILE) tmp -rf
+
+valgrind:
+ valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind-out.txt $(COMMAND)
+
+.PHONY: valgrind clean distclean install default