From dbc58fb44cc119161b31aa8c58b41828ce226bfa Mon Sep 17 00:00:00 2001 From: zedarider Date: Wed, 21 Dec 2016 14:37:31 +0000 Subject: fixed makefile --- Makefile | 8 ++++++-- 1 file 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 -- cgit