-
Notifications
You must be signed in to change notification settings - Fork 311
/
Makefile.windows
35 lines (27 loc) · 949 Bytes
/
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
SRCDIR := src
OBJDIR := obj
ICODIR := ico
SRC := $(wildcard $(SRCDIR)/*.cpp)
OBJ := $(patsubst $(SRCDIR)/%.cpp, $(OBJDIR)/%.o, $(SRC))
ICO := $(ICODIR)/ico.res
CXXFLAGS := -std=c++17 -s -O2 -mwindows
LDFLAGS := -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -lopengl32 -lfreetype -lwinmm -lgdi32 -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic
INCFLAGS := -I<SFML-folder>/include -Iinclude
LIBFLAGS := -L<SFML-folder>/lib
DEFINES := -DSFML_STATIC
.PHONY: test create clean
all: create bin/bongo.exe
bin/bongo.exe: $(OBJ) $(ICO)
$(CXX) -o $@ $^ $(DEFINES) $(INCFLAGS) $(LIBFLAGS) $(CXXFLAGS) $(LDFLAGS)
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
$(CXX) -c -o $@ $^ $(DEFINES) $(INCFLAGS) $(LIBFLAGS) $(CXXFLAGS) $(LDFLAGS)
$(ICODIR)/ico.res: $(ICODIR)/ico.rc
windres -O coff -o $@ $^
create:
mkdir $(OBJDIR) && exit 0
mkdir bin && exit 0
test:
bin/bongo.exe
clean:
del $(OBJ) && exit 0
del ico/ico.res && exit 0