-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile.windows
37 lines (31 loc) · 1.07 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
CC = i686-w64-mingw32-gcc
DEBUG = 1
SRC = $(wildcard src/*.c src/lib/*.c src/lib/rsa/*.c src/ui/*.c src/custom/*.c)
OBJ = $(SRC:.c=.o) ./win/icon.res ./win/meta.res
CFLAGS = -std=gnu99 -fwrapv -I ./cglm/include -I ./glew-2.1.0/include
CFLAGS += -DRENDER_SW
CFLAGS += -I ./SDL2-2.0.20/i686-w64-mingw32/include/SDL2 #-fPIE
CFLAGS += -D SDL2
# Target Windows XP
CFLAGS += -D_WIN32_WINNT=0x0501
LDFLAGS = -lm -L ./SDL2-2.0.20/i686-w64-mingw32/lib -lmingw32
LDFLAGS += -L ./glew-2.1.0/lib/Release/Win32/ -lopengl32 -lglu32 -lglew32
LDFLAGS += -lSDL2main -lSDL2 -lwsock32 -lws2_32
ifdef DEBUG
CFLAGS += -Wall -Wextra -pedantic -g
else
CFLAGS += -s -Ofast
LDFLAGS += -s -mwindows
endif
all: mudclient.exe
./win/icon.res: ./win/icon.rc
i686-w64-mingw32-windres ./win/icon.rc -O coff -o ./win/icon.res
./win/meta.res: ./win/meta.rc
i686-w64-mingw32-windres ./win/meta.rc -O coff -o ./win/meta.res
mudclient.exe: $(OBJ)
$(CC) -o $@ $^ $(LDFLAGS)
clean:
rm -f src/*.o src/lib/*.o src/lib/rsa/*.o src/ui/*.o
rm -f src/gl/*.o src/gl/textures/*.o src/custom/*.o
rm -f mudclient.exe
rm -f win/*.res