aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorzedarider <ymherklotz@gmail.com>2016-11-05 12:49:32 +0000
committerzedarider <ymherklotz@gmail.com>2016-11-05 12:49:32 +0000
commit4716585d5acb45b00960eebb4f8ae4580e580da0 (patch)
treece5caa0fed7216ba83f8a8ac979807b332b6f3ce /Makefile
parent146e32f222be037993fd4d1ab6148eda6c895d08 (diff)
downloadChessAI-4716585d5acb45b00960eebb4f8ae4580e580da0.tar.gz
ChessAI-4716585d5acb45b00960eebb4f8ae4580e580da0.zip
adding initial files
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile34
1 files changed, 34 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..3c0f9e7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,34 @@
+CC := g++ # this is the main compiler
+# CC := clange --analyze # and comment out the linker last line
+SRCDIR := src
+BUILDDIR := build
+TARGET := bin/chess_ai
+
+SRCEXT := cpp
+SOURCES := $(shell find $(SRCDIR) -type f -name "*.$(SRCEXT)")
+OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
+CFLAGS := -g -Wall -Wextra
+LIB :=
+INC := -I include
+
+$(TARGET): $(OBJECTS)
+ @echo " Linking..."
+ @echo " $(CC) $^ -o $(TARGET) $(LIB)"; $(CC) $^ -o $(TARGET) $(LIB)
+
+$(BUILDDIR)/%.o: $(SRCDIR)/%.$(SRCEXT)
+ @mkdir -p $(BUILDDIR)
+ @echo " $(CC) $(CFLAGS) $(INC) -c -o $@ $<"; $(CC) $(CFLAGS) $(INC) -c -o $@ $<
+
+clean:
+ @echo " Cleaning..."
+ @echo " $(RM) -r $(BUILDDIR) $(TARGET)"; $(RM) -r $(BUILDDIR) $(TARGET)
+
+# Tests
+tester:
+ @echo " $(CC) $(CFLAGS) test/tester.cpp $(INC) $(LIB) -o bin/tester"; $(CC) $(CFLAGS) test/tester.cpp $(INC) $(LIB) -o bin/tester
+
+# Spikes
+ticket:
+ @echo " $(CC) $(CFLAGS) spikes/ticket.cpp $(INC) $(LIB) -o bin/ticket"; $(CC) $(CFLAGS) spikes/ticket.cpp $(INC) $(LIB) -o bin/ticket
+
+.PHONY: clean