blob: 51ab37252489d1013eed2f27a11188a013310af0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
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)) )
STATES_BASENM = $(notdir $(basename $(wildcard src/states/*.cpp)))
STATES_OBJS = $(addsuffix .o, $(addprefix $(OBJDIR)/states/, $(STATES_BASENM)) )
all: $(TARGET)
$(TARGET): $(OBJS) $(GRAPHICS_OBJS) $(STATES_OBJS)
echo $(GRAPHICS_OBJS)
$(CC) $(OBJS) $(GRAPHICS_OBJS) $(STATES_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 $<
$(STATES_OBJS): $(OBJDIR)/states/%.o: $(SRCDIR)/states/%.cpp
mkdir -p $(OBJDIR)/states/
$(CC) $(CFLAGS) -o $@ -c $<
clean:
rm -r $(OBJDIR) $(TARGET)
.PHONY: all clean
|