forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.Windows
60 lines (43 loc) · 1.24 KB
/
Makefile.Windows
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
56
57
58
59
# 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 = -O3
ODIR = objwin
DDIR = .deps
TARGET = cataclysm.exe
CXX = g++
WNDRES = windres
LINKER = i486-mingw32-ld
LINKERFLAGS = -Wl,-stack,12000000,-subsystem,windows
CFLAGS = $(WARNINGS) $(DEBUG) $(PROFILE) $(OTHERS)
LDFLAGS = -static -lgdi32
RFLAGS = -J rc -O coff
#ifeq ($(OS), Msys)
#LDFLAGS = -static -lpdcurses
#else
#LDFLAGS = -lncurses
#endif
SOURCES = $(wildcard *.cpp)
_OBJS = $(SOURCES:.cpp=.o)
RSRC = $(wildcard *.rc)
_OBJS += $(RSRC:.rc=.res)
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 $@
$(ODIR)/%.res: %.rc
$(WNDRES) $(RFLAGS) $< -o $@
clean:
rm -f $(TARGET) $(ODIR)/*.o
-include $(SOURCES:%.cpp=$(DEPDIR)/%.P)