-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJamrules
181 lines (144 loc) · 3.67 KB
/
Jamrules
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# No user-serviceable parts below this line. And none above it either ;)
JAMSETTINGS = Jamsettings ;
include $(JAMSETTINGS:D=$(TOP)) ;
VERSION = 3.2.0 ;
MKDIR = mkdir -p ;
USECACHE = 1 ;
if $(OPTIM) = "-O" {
OPTIM = "-O3" ;
}
OPTIM ?= ;
RANLIB = ;
USE_X86_ASM = ;
if ( $(JAMUNAME[1]) = "i686" || $(JAMUNAME[1]) = "i586" ) {
USE_X86_ASM = 1 ;
}
if $(ICC) {
C++ = icc ;
C++FLAGS += -wd1476 -wd654 -wd913 -wd873 -wd1125 ;
BUILD = build/icc ;
LINKFLAGS += -lcxa -lunwind ;
}
else if $(CLANG) {
C++ = clang ;
LINK = clang ;
C++FLAGS += -Wno-invalid-source-encoding -Wno-string-plus-int ;
BUILD = build/clang ;
LINKFLAGS += -lstdc++ ;
}
else {
C++ = g++ ;
C++FLAGS += -W -Wall ;
BUILD = build/gcc ;
if $(OPTIM) {
BUILD = build/gcc$(OPTIM) ;
}
if $(COV) {
C++FLAGS += -fprofile-arcs -ftest-coverage ;
BUILD = build/gcov ;
}
if $(CCACHE) {
C++ = ccache g++ ;
}
}
LINK = $(C++) ;
rule SubInclude
{
if ! $($(<[1]))
{
Exit SubInclude $(<[1]) without prior SubDir $(<[1]) ;
}
local _tokens = $(SUBDIR_TOKENS) ;
SubDir $(<) ;
local a b ;
for a in $(IncludedDirectories) {
if $(a) = $(SUBDIR) {
b = true ;
}
}
if ! $(b) {
IncludedDirectories += $(SUBDIR) ;
include $(JAMFILE:D=$(SUBDIR)) ;
}
SubDir TOP $(_tokens) ;
}
rule Build
{
LOCATE_TARGET = [ FDirName $(TOP) $(BUILD) $(SUBDIR_TOKENS) ] ;
Objects $(>) ;
set-$(<) += [ FGristFiles $(>:S=$(SUFOBJ)) ] ;
sets += $(<) ;
}
rule UseLibrary
{
LINKLIBS on [ FGristFiles $(<:S=$(SUFOBJ)) ] += -l$(>) ;
}
rule Executable
{
local target a ;
Depends exe : $(<) ;
Depends $(<) : $(set-$(>)) ;
MakeLocate $(<) : [ FDirName $(TOP) bin ] ;
Clean clean : $(<) ;
Link $(<) : $(set-$(>)) ;
for a in $(set-$(>)) {
on $(a) LINKLIBS on $(<) += $(LINKLIBS) ;
}
}
rule Program
{
Executable $(<) : $(>) ;
InstallBin $(INSTALLROOT)$(BINDIR) : $(<) ;
}
rule Server
{
Executable $(<) : $(>) ;
InstallBin $(INSTALLROOT)$(SBINDIR) : $(<) ;
}
actions EngraveConfig {
sed -e 's!$BINDIR!'$(BINDIR)'!' \
-e 's!$SBINDIR!'$(SBINDIR)'!' \
-e 's!$MANDIR!'$(MANDIR)'!' \
-e 's!$LIBDIR!'$(LIBDIR)'!' \
-e 's!$INITDIR!'$(INITDIR)'!' \
-e 's!$PIDFILEDIR!'$(PIDFILEDIR)'!' \
-e 's!$JAILDIR!'$(JAILDIR)'!' \
-e 's!$MESSAGEDIR!'$(MESSAGEDIR)'!' \
-e 's!$CONFIGDIR!'$(CONFIGDIR)'!' \
-e 's!$LOGFILEMODE!'$(LOGFILEMODE)'!' \
-e 's!$LOGFILE!'$(LOGFILE)'!' \
-e 's!$DBNAME!'$(DBNAME)'!' \
-e 's!$DBSCHEMA!'$(DBSCHEMA)'!' \
-e 's!$DBOWNER!'$(DBOWNER)'!' \
-e 's!$DBADDRESS!'$(DBADDRESS)'!' \
-e 's!$AOXUSER!'$(AOXUSER)'!' \
-e 's!$AOXGROUP!'$(AOXGROUP)'!' \
-e 's!$VERSION!'$(VERSION)'!' \
-e 's!$PREFIX!'$(PREFIX)'!' \
< $(>) > $(<)
}
rule Doc {
UDOCBIN = udoc ;
Depends $(<) : $(UDOCBIN) $(set-$(>)) ;
NOTFILE $(<) ;
Doc2 $(<) : $(set-$(>):S=.cpp) ;
documented-sets += $(>) ;
Depends doc : $(<) ;
Clean clean : $(output) ;
RemoveDirectories clean ;
}
actions together RemoveDirectories {
rm -rf $(TOP)/doc/man/man3 $(TOP)/$(BUILD)
mkdir -p $(TOP)/doc/html
find $(TOP)/doc/html -name udoc.css -prune -o -type f -exec rm {} \;
}
actions together Doc2 bind UDOCBIN {
mkdir -p doc/man/man3 doc/html build/doc
$(UDOCBIN) -o 'The Archiveopteryx Developers' -m doc/man/man3 -w doc/html $(>)
}
# If you need to do horrid or perverse things that shouldn't be
# version-controlled, you can create a file called Jamhacks and do
# them there.
JAMHACKS = Jamhacks ;
NOCARE $(JAMHACKS:D=$(TOP)) ;
include $(JAMHACKS:D=$(TOP)) ;