aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzedarider <ymherklotz@gmail.com>2016-12-21 14:37:31 +0000
committerzedarider <ymherklotz@gmail.com>2016-12-21 14:37:31 +0000
commitdbc58fb44cc119161b31aa8c58b41828ce226bfa (patch)
treea8ba3b2410c6e2d88c9cc96a5a4ca2a18bba6e53
parentdfb9410625c27a8ae5177024c67ddeaa4dc087ac (diff)
downloadA-star-algorithm-dbc58fb44cc119161b31aa8c58b41828ce226bfa.tar.gz
A-star-algorithm-dbc58fb44cc119161b31aa8c58b41828ce226bfa.zip
fixed makefile
-rw-r--r--Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 6125a62..50c8bcf 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,8 @@ CC := g++ # this is the main compiler
# CC := clange --analyze # and comment out the linker last line
SRCDIR := src
BUILDDIR := build
-TARGET := bin/main
+TARGETDIR := bin
+TARGET := main
SRCEXT := cpp
SOURCES := $(shell find $(SRCDIR) -type f -name "*.$(SRCEXT)")
@@ -13,8 +14,9 @@ LIB := -lsfml-graphics -lsfml-system -lsfml-window
INC := -Iinclude
$(TARGET): $(OBJECTS)
+ @mkdir -p $(TARGETDIR)
@echo " Linking..."
- @echo " $(CC) $^ -o $(TARGET) $(LIBDIR) $(LIB)"; $(CC) $^ -o $(TARGET) $(LIBDIR) $(LIB)
+ @echo " $(CC) $^ -o $(TARGET) $(LIBDIR) $(LIB)"; $(CC) $^ -o $(TARGETDIR)/$(TARGET) $(LIBDIR) $(LIB)
$(BUILDDIR)/%.o: $(SRCDIR)/%.$(SRCEXT)
@mkdir -p $(BUILDDIR)
@@ -26,10 +28,12 @@ clean:
# Tests
tester:
+ @mkdir -p test
@echo " $(CC) $(CFLAGS) test/tester.cpp $(INC) $(LIB) -o bin/tester"; $(CC) $(CFLAGS) test/tester.cpp $(INC) $(LIB) -o bin/tester
# Spikes
ticket:
+ @mkdir -p spikes
@echo " $(CC) $(CFLAGS) spikes/ticket.cpp $(INC) $(LIB) -o bin/ticket"; $(CC) $(CFLAGS) spikes/ticket.cpp $(INC) $(LIB) -o bin/ticket
.PHONY: clean