-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (38 loc) · 1.19 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# comment these to toggle them as one sees fit.
# WARNINGS will spam hundreds of warnings, mostly safe, if turned on
# DEBUG is best turned on if you plan to debug in gdb -- please do!
# PROFILE is for use with gprof or a similar program -- don't bother generally
#WARNINGS = -Wall -Wextra -Wno-switch -Wno-sign-compare -Wno-missing-braces -Wno-unused-parameter -Wno-char-subscripts
#DEBUG = -g
#PROFILE = -pg
OTHERS = -Os
ODIR = objwin
DDIR = .deps
TARGET = cataclysm.exe
CXX = g++
LINKER = i486-mingw32-ld
LINKERFLAGS = -Wl,--subsystem,windows
CFLAGS = $(WARNINGS) $(DEBUG) $(PROFILE) $(OTHERS)
LDFLAGS = -static -lSDL.dll -lSDL_mixer.dll -mwindows
#LDFLAGS = -static -lSDL.dll -lSDL_mixer.dll -lSDL_ttf.dll -lfreetype.dll
#ifeq ($(OS), Msys)
#LDFLAGS = -static -lpdcurses
#else
#LDFLAGS = -lncurses
#endif
SOURCES = $(wildcard *.cpp)
_OBJS = $(SOURCES:.cpp=.o)
OBJS = $(patsubst %,$(ODIR)/%,$(_OBJS))
all: $(TARGET)
@
$(TARGET): $(ODIR) $(DDIR) $(OBJS)
$(CXX) $(LINKERFLAGS) -o $(TARGET) $(CFLAGS) $(OBJS) $(LDFLAGS) -DMINGW
$(ODIR):
mkdir $(ODIR)
$(DDIR):
@mkdir $(DDIR)
$(ODIR)/%.o: %.cpp
$(CXX) $(CFLAGS) -c $< -o $@
clean:
rm -f $(TARGET) $(ODIR)/*.o
-include $(SOURCES:%.cpp=$(DEPDIR)/%.P)