blob: 5504d6d304fbabdca984ce18f0937f67d81b7a72 (
plain) (
blame)
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
|
# VPC MASTER MAKEFILE
SHELL:=/bin/bash
# to control parallelism, set the MAKE_JOBS environment variable
ifeq ($(strip $(MAKE_JOBS)),)
ifeq ($(shell uname),Darwin)
CPUS:=$(shell /usr/sbin/sysctl -n hw.ncpu)
endif
ifeq ($(shell uname),Linux)
CPUS:=$(shell grep processor /proc/cpuinfo | wc -l)
endif
MAKE_JOBS:=$(CPUS)
endif
ifeq ($(strip $(MAKE_JOBS)),)
MAKE_JOBS:=8
endif
# All projects (default target)
all:
@$(MAKE) -f $(lastword $(MAKEFILE_LIST)) -j$(MAKE_JOBS) all-targets
all-targets : client_hl2mp server_hl2mp tier1 mathlib vgui_controls fixsrvso
# Individual projects + dependencies
client_hl2mp : tier1 mathlib vgui_controls
@echo "Building: client_hl2mp"
@+cd game/client && $(MAKE) -f client_linux32_hl2mp.mak $(CLEANPARAM)
server_hl2mp : tier1 mathlib
@echo "Building: server_hl2mp"
@+cd game/server && $(MAKE) -f server_linux32_hl2mp.mak $(CLEANPARAM)
tier1 :
@echo "Building: tier1"
@+cd tier1 && $(MAKE) -f tier1_linux32.mak $(CLEANPARAM)
mathlib :
@echo "Building: mathlib"
@+cd mathlib && $(MAKE) -f mathlib_linux32.mak $(CLEANPARAM)
vgui_controls :
@echo "Building: vgui_controls"
@+cd vgui2/vgui_controls && $(MAKE) -f vgui_controls_linux32.mak $(CLEANPARAM)
fixsrvso : server_hl2mp
@echo "Copying server.so to server_srv.so"
@+cd ../game/mod_hl2mp/bin && cp server.so server_srv.so
@+cd ../game/mod_hl2mp/bin && cp server.so.dbg server_srv.so.dbg
# this is a bit over-inclusive, but the alternative (actually adding each referenced c/cpp/h file to
# the tags file) seems like more work than it's worth. feel free to fix that up if it bugs you.
TAGS:
@rm -f TAGS
@find game/client -name '*.cpp' -print0 | xargs -0 etags --declarations --ignore-indentation --append
@find game/client -name '*.h' -print0 | xargs -0 etags --language=c++ --declarations --ignore-indentation --append
@find game/client -name '*.c' -print0 | xargs -0 etags --declarations --ignore-indentation --append
@find game/server -name '*.cpp' -print0 | xargs -0 etags --declarations --ignore-indentation --append
@find game/server -name '*.h' -print0 | xargs -0 etags --language=c++ --declarations --ignore-indentation --append
@find game/server -name '*.c' -print0 | xargs -0 etags --declarations --ignore-indentation --append
@find tier1 -name '*.cpp' -print0 | xargs -0 etags --declarations --ignore-indentation --append
@find tier1 -name '*.h' -print0 | xargs -0 etags --language=c++ --declarations --ignore-indentation --append
@find tier1 -name '*.c' -print0 | xargs -0 etags --declarations --ignore-indentation --append
@find mathlib -name '*.cpp' -print0 | xargs -0 etags --declarations --ignore-indentation --append
@find mathlib -name '*.h' -print0 | xargs -0 etags --language=c++ --declarations --ignore-indentation --append
@find mathlib -name '*.c' -print0 | xargs -0 etags --declarations --ignore-indentation --append
@find vgui2/vgui_controls -name '*.cpp' -print0 | xargs -0 etags --declarations --ignore-indentation --append
@find vgui2/vgui_controls -name '*.h' -print0 | xargs -0 etags --language=c++ --declarations --ignore-indentation --append
@find vgui2/vgui_controls -name '*.c' -print0 | xargs -0 etags --declarations --ignore-indentation --append
# Mark all the projects as phony or else make will see the directories by the same name and think certain targets
.PHONY: TAGS showtargets regen showregen clean cleantargets cleanandremove relink client_hl2mp server_hl2mp tier1 mathlib vgui_controls
# The standard clean command to clean it all out.
clean:
@$(MAKE) -f $(lastword $(MAKEFILE_LIST)) -j$(MAKE_JOBS) all-targets CLEANPARAM=clean
# clean targets, so we re-link next time.
cleantargets:
@$(MAKE) -f $(lastword $(MAKEFILE_LIST)) -j$(MAKE_JOBS) all-targets CLEANPARAM=cleantargets
# p4 edit and remove targets, so we get an entirely clean build.
cleanandremove:
@$(MAKE) -f $(lastword $(MAKEFILE_LIST)) -j$(MAKE_JOBS) all-targets CLEANPARAM=cleanandremove
#relink
relink: cleantargets
@$(MAKE) -f $(lastword $(MAKEFILE_LIST)) -j$(MAKE_JOBS) all-targets
# Here's a command to list out all the targets
showtargets:
@echo '-------------------' && \
echo '----- TARGETS -----' && \
echo '-------------------' && \
echo 'clean' && \
echo 'client_hl2mp' && \
echo 'server_hl2mp' && \
echo 'tier1' && \
echo 'mathlib' && \
echo 'vgui_controls'
|