forked from SpiritQuaddicted/reQuiem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.mingw
120 lines (91 loc) · 2.61 KB
/
makefile.mingw
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#
# JoeQuake Makefile for Win32
#
# by Slawomir Mazurek <[email protected]>
#
CC = gcc
################
default_target: glx
all: glx
################################
# Directories for object files #
################################
GLX_DIR = release_glx
################
# Binary files #
################
GLX_TARGET = $(GLX_DIR)/reQuiem.exe
################
C_BUILD = $(CC) -c -o $@ $(_CFLAGS) $<
S_BUILD = $(CC) -c -o $@ $(_CFLAGS) -x assembler-with-cpp $<
BUILD = $(CC) -o $@ $(_OBJS) $(_LDFLAGS)
MKDIR = md $@
RM_FILES = del $(GLX_DIR)\*.o
RM_DIRS = rd $(GLX_DIR)
################
$(GLX_DIR):
$(MKDIR)
CFLAGS += -Did386 -O3 -D_WIN32 -march=pentium -fcommon -fomit-frame-pointer -DNDEBUG
LDFLAGS := -lm
#######
# GLX #
#######
GLX_C_FILES := \
cd_common cd_win chase cl_demo \
cl_input cl_main cl_parse cl_parse_qw \
cl_tent cmd common common_file \
conproc console crc cvar dzip \
\
gl_alias gl_brush gl_draw gl_drawalias \
gl_drawsprite gl_mesh gl_refrag gl_rlight \
gl_rmain gl_rmisc gl_part gl_rsurf \
gl_part_qmb \
gl_screen gl_sky gl_sprite gl_warp \
gl_fog gl_md2 gl_md3 gl_texture \
\
host host_cmd host_saveload image \
keys mathlib menu music \
in_win model movie movie_avi \
nehahra net_win net_wins net_dgrm net_loop \
net_main net_vcr net_wipx pr_cmds \
pr_edict pr_exec sbar \
\
snd_dma snd_win snd_mem snd_mix \
sv_main sv_move sv_phys sv_user \
sys_win version vid_common_gl vid_wgl \
view wad world zone \
\
hexen2 cl_effect_H2 cl_parse_H2 \
menu_H2 progs_H2 gl_part_H2 sbar_H2
GLX_S_FILES := \
math snd_mixa sys_x86
GLX_C_OBJS := $(addprefix $(GLX_DIR)/, $(addsuffix .o, $(GLX_C_FILES)))
GLX_S_OBJS := $(addprefix $(GLX_DIR)/, $(addsuffix .o, $(GLX_S_FILES)))
GLX_CFLAGS := $(CFLAGS) -DGLQUAKE -DWIN32 -D_WINDOWS -D_MBCS
GLX_LDFLAGS := -l kernel32 -l user32 -l gdi32 -l dxguid -l opengl32 -l wsock32 -l winmm
# -l png -l z
glx: _DIR := $(GLX_DIR)
glx: _OBJS := $(GLX_C_OBJS) $(GLX_S_OBJS) $(GLX_DIR)/resource.o
glx: _LDFLAGS := $(GLX_LDFLAGS)
glx: _CFLAGS := $(GLX_CFLAGS)
glx: $(GLX_TARGET)
$(GLX_TARGET): $(GLX_DIR) $(GLX_C_OBJS) $(GLX_S_OBJS) $(GLX_DIR)/resource.o
$(BUILD)
$(GLX_C_OBJS): $(GLX_DIR)/%.o: %.c quakedef.h
$(C_BUILD)
$(GLX_S_OBJS): $(GLX_DIR)/%.o: %.s
$(S_BUILD)
$(GLX_DIR)/resource.o: quake.rc quake.ico icon2.ico
windres quake.rc $(GLX_DIR)/resource.o
glxclean: _FILES += $(GLX_C_OBJS) $(GLX_S_OBJS) $(GLX_DIR)/resource.o
glxclean: _DIRS := $(GLX_DIR)
glxclean:
$(RM_FILES)
$(RM_DIRS)
glxclobber: _FILES := $(GLX_TARGET)
glxclobber: glxclean
#################
clean: glxclean
clobber: _DIRS := $(GLX_DIR)
clobber:
$(RM_DIRS)