summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile34
1 files changed, 34 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..47549f6
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,34 @@
+CC = g++
+CFLAGS = -Wall -g
+
+TARGET = civ
+
+SRCDIR = src
+
+LIBS = -lsfml-audio -lsfml-graphics -lsfml-system -lsfml-window -lsfml-network
+
+OBJDIR = build
+BASENM = $(notdir $(basename $(wildcard src/*.cpp)))
+OBJS = $(addsuffix .o, $(addprefix $(OBJDIR)/, $(BASENM)) )
+
+GRAPHICS_BASENM = $(notdir $(basename $(wildcard src/graphics/*.cpp)))
+GRAPHICS_OBJS = $(addsuffix .o, $(addprefix $(OBJDIR)/graphics/, $(GRAPHICS_BASENM)) )
+
+all: $(TARGET)
+
+$(TARGET): $(OBJS) $(GRAPHICS_OBJS)
+ echo $(GRAPHICS_OBJS)
+ $(CC) $(OBJS) $(GRAPHICS_OBJS) -o $(TARGET) $(LIBS)
+
+$(OBJS): $(OBJDIR)/%.o: $(SRCDIR)/%.cpp
+ mkdir -p $(OBJDIR)
+ $(CC) $(CFLAGS) -o $@ -c $<
+
+$(GRAPHICS_OBJS): $(OBJDIR)/graphics/%.o: $(SRCDIR)/graphics/%.cpp
+ mkdir -p $(OBJDIR)/graphics/
+ $(CC) $(CFLAGS) -o $@ -c $<
+
+clean:
+ rm -r $(OBJDIR) $(TARGET)
+
+.PHONY: all clean