-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmakefile.linux
126 lines (97 loc) · 2.67 KB
/
makefile.linux
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
121
122
123
124
125
126
#
# JoeQuake Makefile for Linux
#
# by Slawomir Mazurek <[email protected]>
#
# JDH: customized for reQuiem; removed asm code from Linux build
CC = gcc
################
default_target: glx
all: glx
################################
# Directories for object files #
################################
GLX_DIR = release_glx
################
# Binary files #
################
GLX_TARGET = $(GLX_DIR)/reQuiem.glx
################
C_BUILD = $(CC) -c -o $@ $(_CFLAGS) $<
#S_BUILD = $(CC) -c -o $@ $(_CFLAGS) -DELF -x assembler-with-cpp $<
BUILD = $(CC) -o $@ $(_OBJS) $(_LDFLAGS)
MKDIR = mkdir -p $@
RM_FILES = rm -f $(_FILES)
RM_DIRS = rm -fr $(_DIRS)
################
$(GLX_DIR):
$(MKDIR)
CPU_OPT = -march=pentium
CFLAGS += $(CPU_OPT)
CFLAGS += -O3 -Wall -DNDEBUG -fomit-frame-pointer
CFLAGS += -m32
LDFLAGS := -lm -ldl -m32
#######
# GLX #
#######
GLX_C_FILES := \
cd_common cd_linux chase cl_demo \
cl_input cl_main cl_parse cl_parse_qw \
cl_tent cmd common common_file \
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 model \
movie movie_avi music \
nehahra net_bsd net_dgrm net_loop \
net_main net_udp net_vcr pr_cmds \
pr_edict pr_exec sbar \
\
snd_dma snd_linux snd_mem snd_mix \
sv_main sv_move sv_phys sv_user \
sys_linux version vid_common_gl vid_glx \
view wad world zone \
\
hexen2 cl_effect_H2 cl_parse_H2 gl_part_H2 \
menu_H2 progs_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 -I/usr/include -I/usr/X11R6/include
GLX_LDFLAGS := $(LDFLAGS) -lGL -L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm
# -lpng
# -ljpeg
glx: _DIR := $(GLX_DIR)
#glx: _OBJS := $(GLX_C_OBJS) $(GLX_S_OBJS)
glx: _OBJS := $(GLX_C_OBJS)
glx: _LDFLAGS := $(GLX_LDFLAGS)
glx: _CFLAGS := $(GLX_CFLAGS)
glx: $(GLX_TARGET)
#$(GLX_TARGET): $(GLX_DIR) $(GLX_C_OBJS) $(GLX_S_OBJS)
$(GLX_TARGET): $(GLX_DIR) $(GLX_C_OBJS)
$(BUILD)
$(GLX_C_OBJS): $(GLX_DIR)/%.o: %.c quakedef.h
$(C_BUILD)
#$(GLX_S_OBJS): $(GLX_DIR)/%.o: %.s
# $(S_BUILD)
#glxclean: _FILES += $(GLX_C_OBJS) $(GLX_S_OBJS)
glxclean: _FILES += $(GLX_C_OBJS)
glxclean: _DIRS := $(GLX_DIR)
glxclean:
$(RM_FILES)
$(RM_DIRS)
glxclobber: _FILES := $(GLX_TARGET)
glxclobber: glxclean
#################
clean: glxclean
clobber: _DIRS := $(GLX_DIR)
clobber:
$(RM_DIRS)