-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
37 lines (28 loc) · 857 Bytes
/
makefile
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
# VARIABLES
NAME=tigerGame
INCDIR=include/libtcod
SRCDIR=src
OBJDIR=src
SRCS=$(wildcard src/*.cpp)
OBJS=$(SRCS:.cpp=.o)
CXXFLAGS=-Wall -g -I$(INCDIR) -std=c++14
# check if on linux or windows and set the linker flags accordingly
ifeq ($(shell sh -c 'uname -s'),Linux)
# LIBS=-L. -ltcod_debug -ltcodgui_debug -Wl,-rpath=.
LIBS=-L. -ltcod -ltcodgui -Wl,-rpath=.
#else
# LIBS=-Llib -ltcod-mingw-debug -static-libgcc -static-libstdc++
endif
LDFLAGS=$(LIBS)
tigerGame: $(OBJS)
$(CXX) -o $@ $^ $(CXXFLAGS) $(LDFLAGS)
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
$(CXX) $< -c -o $@ $(CXXFLAGS)
#GUARANTEED WORKING COMPILE LINE
basic:
g++ src/*.cpp -o tigerGame -Iinclude/libtcod -L. -ltcod -ltcodgui -Wl,-rpath=. -Wall
deprecated: $(OBJS)
$(CXX) -E -dD $@ $^ -Wall -I$(INCDIR) $(LDFLAGS)
.PHONY: clean
clean: #clean up working dir
rm -rf $(OBJDIR)/*.o $(NAME)