Skip to content

Commit 9731769

Browse files
committed
Restored Makefile.w32, only removed GLSLANG workaround
1 parent 878fe83 commit 9731769

1 file changed

Lines changed: 111 additions & 0 deletions

File tree

Quake/Makefile.w32

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# GNU Makefile for compiling vkQuake.exe for Windows x86 using MinGW-w64.
2+
# Usage: "make -f Makefile.w32"
3+
# To cross-compile on Linux hosts, see the 'build_cross_win32.sh' script.
4+
# "make VK_SDK_PATH=/path/to/vksdk" to specify the Vulkan SDK root
5+
# "make DEBUG=1" to build a debug client.
6+
# "make SDL_CONFIG=/path/to/sdl2-config" to override the locally included SDL2 version.
7+
8+
### Enable SSE2 optimizations
9+
USE_SSE2 = 1
10+
11+
### Enable/disable codecs for streaming music support
12+
USE_CODEC_WAVE = 1
13+
USE_CODEC_FLAC = 1
14+
USE_CODEC_MP3 = 1
15+
USE_CODEC_VORBIS = 1
16+
USE_CODEC_OPUS = 1
17+
# either xmp or mikmod (or modplug)
18+
USE_CODEC_MIKMOD = 0
19+
USE_CODEC_XMP = 1
20+
USE_CODEC_MODPLUG = 0
21+
USE_CODEC_UMX = 1
22+
23+
# which library to use for mp3 decoding: mad or mpg123
24+
MP3LIB = mpg123
25+
# which library to use for ogg decoding: vorbis or tremor
26+
VORBISLIB = vorbis
27+
28+
# ---------------------------
29+
# build variables
30+
# ---------------------------
31+
CPUFLAGS =
32+
ifeq ($(USE_SSE2),1)
33+
CPUFLAGS += -msse2
34+
endif
35+
LDFLAGS = -m32 -mwindows -static-libgcc
36+
DFLAGS ?=
37+
CFLAGS ?= -m32 -D_WIN32_WINNT=0x0501
38+
39+
# ---------------------------
40+
# objects
41+
# ---------------------------
42+
SYSOBJ_NET := net_win.o net_wins.o net_wipx.o
43+
SYSOBJ_SYS := pl_win.o sys_sdl.o sys_sdl_win.o
44+
DEFAULT_TARGET := vkQuake.exe
45+
BINTOC_EXE = ../Shaders/bintoc.exe
46+
47+
# ---------------------------
48+
# common
49+
# ---------------------------
50+
include common.make
51+
52+
# ---------------------------
53+
# libraries
54+
# ---------------------------
55+
# default to our local SDL2 for build
56+
SDL_CONFIG ?=../Windows/SDL2/bin/sdl2-config --prefix=../Windows/SDL2
57+
SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
58+
SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
59+
60+
ifeq ($(USE_CODEC_OPUS),1)
61+
CODECLIBS += -lopusfile -lopus -logg
62+
endif
63+
64+
NET_LIBS := -lws2_32
65+
66+
CFLAGS += -I../Windows/codecs/include
67+
CODEC_LINK = -L../Windows/codecs/x86
68+
69+
VK_SDK_PATH ?= ../Windows/misc
70+
VULKAN_INC = -I$(VK_SDK_PATH)/include
71+
VULKAN_LINK= -L../Windows/misc/x86 # -L$(VK_SDK_PATH)/lib32
72+
VULKAN_LIBS= -lvulkan-1
73+
CFLAGS += $(VULKAN_INC)
74+
75+
COMMON_LIBS:= -lwinmm
76+
77+
LIBS := $(COMMON_LIBS) $(NET_LIBS) $(CODEC_LINK) $(CODECLIBS) $(VULKAN_LINK) $(VULKAN_LIBS)
78+
79+
SYSOBJ_RES = vkQuake.res
80+
81+
LIBWINPTHREAD = $(MSYSTEM_PREFIX)/bin/libwinpthread-1.dll
82+
83+
# ---------------------------
84+
# targets / rules
85+
# ---------------------------
86+
all: $(DEFAULT_TARGET) dll
87+
88+
%.res: ../Windows/%.rc
89+
$(WINDRES) -I../Windows --output-format=coff --target=pe-i386 -o $@ $<
90+
91+
vkQuake.exe: $(SHADER_OBJS) $(OBJS) $(SYSOBJ_RES)
92+
$(LINKER) $(SHADER_OBJS) $(OBJS) $(SYSOBJ_RES) $(LDFLAGS) $(LIBS) $(SDL_LIBS) -o $@
93+
$(call DO_STRIP,$@)
94+
95+
dll:
96+
if [ -f $(LIBWINPTHREAD) ]; then \
97+
cp $(LIBWINPTHREAD) . ; \
98+
fi
99+
cp ../Windows/codecs/x86/*.dll .
100+
cp ../Windows/SDL2/lib/*.dll .
101+
102+
release: vkQuake.exe
103+
debug:
104+
$(error Use "make DEBUG=1")
105+
106+
clean:
107+
$(RM) *.o *.d *.res *.dll $(DEFAULT_TARGET) \
108+
$(BINTOC_EXE) \
109+
../Shaders/Compiled/$(GLSLANG_OUT_FOLDER)/*.c \
110+
../Shaders/Compiled/$(GLSLANG_OUT_FOLDER)/*.spv \
111+
../Shaders/Compiled/$(GLSLANG_OUT_FOLDER)/*.d

0 commit comments

Comments
 (0)