aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rwxr-xr-xMakefile32
1 files changed, 32 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100755
index 0000000..7cb1bcf
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,32 @@
+NAME=molehole
+
+SRCDIR=src
+OBJDIR=obj
+BUILDDIR=build
+
+SOURCES=$(shell find $(SRCDIR) -type f -name '*.c')
+OBJSOURCES=$(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(SOURCES)))
+
+CC=clang
+CFLAGS=-Wall -Wextra -pedantic -O0 -g
+LDFLAGS=-lncurses -lssl -lc
+INCLUDEFLAGS=-Iinclude
+
+VPATH=$(dir $(SOURCES))
+
+$(BUILDDIR)/$(NAME): $(OBJSOURCES) | $(BUILDDIR)
+ $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
+
+$(OBJDIR)/%.o: %.c | $(OBJDIR)
+ $(CC) -c -o $@ $< $(CFLAGS) $(INCLUDEFLAGS)
+
+$(BUILDDIR):
+ mkdir -p $(BUILDDIR)
+$(OBJDIR):
+ mkdir -p $(OBJDIR)
+
+
+.PHONY: clean
+clean:
+ rm -rfv $(OBJDIR)
+ rm -rfv $(BUILDDIR)