summaryrefslogtreecommitdiffstats
path: root/prog/6/makefile
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2023-08-06 15:56:08 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2023-08-06 15:56:08 +0200
commit4b65846d2e369636e1c947c98c31507d4c08af10 (patch)
treeba8d82c0c1ca0e54943b86ca68f665cfd66a078f /prog/6/makefile
parentraw6 (diff)
downloadr-4b65846d2e369636e1c947c98c31507d4c08af10.tar
r-4b65846d2e369636e1c947c98c31507d4c08af10.tar.gz
r-4b65846d2e369636e1c947c98c31507d4c08af10.tar.bz2
r-4b65846d2e369636e1c947c98c31507d4c08af10.tar.lz
r-4b65846d2e369636e1c947c98c31507d4c08af10.tar.xz
r-4b65846d2e369636e1c947c98c31507d4c08af10.tar.zst
r-4b65846d2e369636e1c947c98c31507d4c08af10.zip
Diffstat (limited to '')
-rw-r--r--prog/6/makefile37
1 files changed, 37 insertions, 0 deletions
diff --git a/prog/6/makefile b/prog/6/makefile
new file mode 100644
index 0000000..8a847a2
--- /dev/null
+++ b/prog/6/makefile
@@ -0,0 +1,37 @@
+DESTDIR=/
+CC=cc
+MYCFLAGS=-O0 -Wall -Wextra -Wformat -pedantic -g
+MYLDFLAGS=-lresolv
+
+default: 6d 6c
+
+6d: daemon.c
+ $(CC) $(MYCFLAGS) $(CFLAGS) $< -o$@ $(MYLDFLAGS) $(LDFLAGS)
+
+6c: client.c
+ $(CC) $(MYCFLAGS) $(CFLAGS) $< -o$@ $(MYLDFLAGS) $(LDFLAGS)
+
+install: 6d 6c
+ mkdir -p $(DESTDIR)/usr/bin/
+ cp 6d $(DESTDIR)/usr/bin/
+ cp 6c $(DESTDIR)/usr/bin/
+
+uninstall:
+ rm -fr $(DESTDIR)/usr/bin/6d
+ rm -fr $(DESTDIR)/usr/bin/6c
+
+distclean: clean
+
+clean:
+ rm -fr 6d 6c
+
+valgrind:
+ valgrind --error-exitcode=59 --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind-out.txt $(CMD)
+
+# tests if code compiles under gcc, clang and tcc
+cc:
+ make -e CC=tcc
+ make -e CC=gcc
+ make -e CC=clang
+
+.PHONY: default, install, distclean, clean, valgrind, cc, uninstall