aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMatt Strapp <matt@mattstrapp.net>2022-04-25 19:09:12 -0500
committerMatt Strapp <matt@mattstrapp.net>2022-04-25 19:21:02 -0500
commit51247ec41133e04e0b0ee04cbf2e290ff26be03d (patch)
treebfca271e8365c624cc90695343530179a39e899c /Makefile
parente (diff)
downloadcsci4211-51247ec41133e04e0b0ee04cbf2e290ff26be03d.tar
csci4211-51247ec41133e04e0b0ee04cbf2e290ff26be03d.tar.gz
csci4211-51247ec41133e04e0b0ee04cbf2e290ff26be03d.tar.bz2
csci4211-51247ec41133e04e0b0ee04cbf2e290ff26be03d.tar.lz
csci4211-51247ec41133e04e0b0ee04cbf2e290ff26be03d.tar.xz
csci4211-51247ec41133e04e0b0ee04cbf2e290ff26be03d.tar.zst
csci4211-51247ec41133e04e0b0ee04cbf2e290ff26be03d.zip
I give upHEADmaster
Signed-off-by: Matt Strapp <matt@mattstrapp.net>
Diffstat (limited to '')
-rw-r--r--Makefile30
1 files changed, 21 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 9cb5221..d6ca4c9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,22 @@
+# Author Name: Matt Strapp
+# Date: 25 April 2022
+# x500: strap012
.DELETE_ON_ERROR:
-CXX = g++
+CXX := g++
SRCDIR := src
-INCLDIR = include
-BUILDDIR = build
-CFLAGS := -Wall -Wextra -g
+INCLDIR := include
+BUILDDIR := build
+
+VERSION ?= prod
+ifeq ($(VERSION),debug)
+ FLAGS := -Wall -Wextra -Wpedantic -pedantic -g
+else
+ FLAGS := -w -O3
+endif
+
+CFLAGS := $(FLAGS) -I$(INCLDIR)
+
all: client server
@@ -15,18 +27,18 @@ server: $(BUILDDIR)/server.o
$(CXX) $(CFLAGS) $(BUILDDIR)/server.o $(BUILDDIR)/util.o $(BUILDDIR)/comms.o -o server
$(BUILDDIR)/client.o: $(SRCDIR)/client.cpp $(INCLDIR)/client.hpp $(BUILDDIR)/comms.o $(BUILDDIR)/util.o
- $(CXX) $(CFLAGS) -I$(INCLDIR) $(SRCDIR)/client.cpp -c -o $(BUILDDIR)/client.o
+ $(CXX) $(CFLAGS) -c $(SRCDIR)/client.cpp -o $(BUILDDIR)/client.o
$(BUILDDIR)/server.o: $(SRCDIR)/server.cpp $(INCLDIR)/server.hpp $(BUILDDIR)/comms.o $(BUILDDIR)/util.o
- $(CXX) $(CFLAGS) -I$(INCLDIR) $(SRCDIR)/server.cpp -c -o $(BUILDDIR)/server.o
+ $(CXX) $(CFLAGS) -c $(SRCDIR)/server.cpp -o $(BUILDDIR)/server.o
$(BUILDDIR)/comms.o: $(SRCDIR)/comms.cpp $(INCLDIR)/comms.hpp $(BUILDDIR)/util.o
- $(CXX) $(CFLAGS) -I$(INCLDIR) $(SRCDIR)/comms.cpp -c -o $(BUILDDIR)/comms.o
+ $(CXX) $(CFLAGS) -c $(SRCDIR)/comms.cpp -o $(BUILDDIR)/comms.o
$(BUILDDIR)/util.o: $(SRCDIR)/util.cpp $(INCLDIR)/util.hpp
- $(CXX) $(CFLAGS) -I$(INCLDIR) -c $(SRCDIR)/util.cpp -o $(BUILDDIR)/util.o
+ $(CXX) $(CFLAGS) -c $(SRCDIR)/util.cpp -o $(BUILDDIR)/util.o
clean:
- -rm client server $(BUILDDIR)/*.o 2> /dev/null || true
+ -rm -r client server $(BUILDDIR)/*.o files/ userDB fileDB 2> /dev/null || true
.PHONY: all clean