summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile49
1 files changed, 49 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..92cc0c2
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,49 @@
+CC = gcc
+CFLAGS = -Wall
+SOURCES = $(addprefix src/, whatfiles.c attach.c utilities.c hashmap.c strings.c)
+
+all: bin/whatfiles
+
+bin/whatfiles: $(SOURCES)
+ $(CC) $(CFLAGS) -o $@ $(SOURCES)
+
+# utils
+
+install:
+ cp ./bin/whatfiles /usr/local/bin/whatfiles
+
+clean:
+ -rm whatfiles15*
+ rm -rf bin/*
+
+check: bin/whatfiles bin/hashmap
+ valgrind --leak-check=full bin/whatfiles cal
+ valgrind --leak-check=full bin/hashmap
+
+# ignore these, just tests used during development
+
+scraps: bin/forktest bin/grandchild bin/threads bin/hashmap bin/random
+
+bin/forktest: scraps/forktest.c
+ $(CC) $(CFLAGS) -o $@ $^
+
+bin/grandchild: scraps/grandchild.c
+ $(CC) $(CFLAGS) -o $@ $^
+
+bin/threads: scraps/threads.c
+ $(CC) $(CFLAGS) -pthread -o $@ $^
+
+bin/hashmap: scraps/hashdriver.c src/hashmap.c src/strings.c
+ $(CC) $(CFLAGS) -o $@ $^
+
+bin/random: scraps/random.c
+ $(CC) $(CFLAGS) -o $@ $^
+
+
+chain: bin/whatfiles bin/forktest bin/grandchild
+ bin/whatfiles bin/forktest
+
+redo: bin/whatfiles bin/threads
+ -rm whatfiles15*
+ bin/whatfiles bin/threads a s d f
+ cat whatfiles*