This repository has been archived by the owner on Jan 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
134 lines (104 loc) · 1.97 KB
/
Makefile
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
127
128
129
130
131
132
133
134
####
#
# Rogi Engine Makefile
#
# rogi <[email protected]>
#
##
# Configurações do compilador fornecidas pelo usuário
#
CC = gcc
CFLAGS = -g -Wall -D__DEBUG__
LDFLAGS =
##
##
# Configurações finais do compilador
#
BUILD_CC = $(CC)
BUILD_CFLAGS = -Dinline='' -ggdb -std=c99 -pedantic -fPIC -I$(CURDIR) $(CFLAGS)
BUILD_LDFLAGS = $(LDFLAGS)
##
##
# Configurações de pacotes externos
#
##
##
# INCLUDE
#
##
##
# LINK
#
LINK_PTHREAD = -lpthread
LINK_MATH = -lm
LINK_X = -L/usr/X11R7/lib64 -lX11
LINK_GL = -L/usr/lib64 -lGL -lGLU
LINK_CURSES = -lcurses
LINK_READLINE = $(LINK_CURSES) -lreadline $(LINK_CURSES)
##
##
# Lista de alvos
#
BSP_OBJS= \
bsp/bsp.o \
bsp/bsp_model.o
CLIENT_OBJS= \
client/cli_main.o \
client/cli_entity.o
COMMON_OBJS= \
common/vector.o
GAME_OBJS= \
game/g_main.o \
game/g_entity.o \
game/g_map.o
GRAPHICS_OBJS= \
graphics/image.o \
graphics/model.o
LINUX_OBJS= \
linux/system.o \
linux/time.o \
linux/xwindows.o
RENDERER_OBJS= \
renderer/renderer.o \
renderer/r_model.o \
renderer/r_bsp.o \
renderer/r_g_entity.o
ROGIMODEL_OBJS= \
rogimodel/rogimodel.o
SINGLE_OBJS= \
single/sgl_main.o
SYS_OBJS= \
sys/sys_event.o \
sys/sys_console.o \
sys/sys_env.o \
sys/sys_common.o
TRACE_OBJS= \
trace/tr_bsp.o \
trace/tr_model.o \
trace/trace.o
PROG_OBJS= \
bspc.o \
sgl.o
PROGS= \
bspc \
sgl
OBJS= $(BSP_OBJS) $(TRACE_OBJS) $(COMMON_OBJS) $(GAME_OBJS) $(GRAPHICS_OBJS) $(LINUX_OBJS) $(RENDERER_OBJS) $(ROGIMODEL_OBJS) $(SINGLE_OBJS) $(SYS_OBJS)
BSPC_OBJS= $(BSP_OBJS) $(TRACE_OBJS) $(COMMON_OBJS) $(GRAPHICS_OBJS) $(ROGIMODEL_OBJS)
ALL_OBJS= $(OBJS) $(PROG_OBJS)
##
##
# Alvos
#
# Pseudo-alvos
.PHONY: all clean
# Compila todos os programas e livrarias
all: sgl bspc
clean:
rm -f $(ALL_OBJS) $(PROGS)
$(ALL_OBJS):
$(BUILD_CC) $(BUILD_CFLAGS) -c -o $@ $(@:.o=.c)
sgl: sgl.o $(OBJS)
$(BUILD_CC) $(BUILD_CFLAGS) -o sgl $^ $(LINK_MATH) $(LINK_X) $(LINK_GL)
bspc: bspc.o $(BSPC_OBJS)
$(BUILD_CC) $(BUILD_CFLAGS) -o bspc $^ $(LINK_MATH) $(LINK_X) $(LINK_GL)
# EOF