| | 186 | |
| | 187 | ## SwigExternalRuntime target : language [ : swigflags [: frozendirs [: tag ]]] |
| | 188 | rule SwigExternalRuntime |
| | 189 | { |
| | 190 | local target = $(1) ; |
| | 191 | local language = $(2) ; |
| | 192 | local swigflags = $(3) ; |
| | 193 | local frozentargetdir = $(4[1]) ; |
| | 194 | local frozenotherdir = $(4[2-]) ; |
| | 195 | local tag = $(5) ; |
| | 196 | |
| | 197 | if ! $(frozenotherdir) { frozenotherdir = $(frozentargetdir) ; } |
| | 198 | if ! $(tag) { tag = $(language) ; } |
| | 199 | |
| | 200 | MakeLocate $(target) : $(LOCATE_TARGET) ; |
| | 201 | |
| | 202 | SWIG.FLAGS on $(target) += |
| | 203 | $(SWIG.FLAGS) -$(language) $(swigflags) -external-runtime [ ConcatDirs $(LOCATE_TARGET) $(target) ] ; |
| | 204 | |
| | 205 | RunSwig $(target) ; |
| | 206 | Depends $(tag)swig : $(target) ; |
| | 207 | NotFile $(tag)swig ; |
| | 208 | Always $(tag)swig ; |
| | 209 | Help $(tag)swig : "Generate Swig files for $(tag)" ; |
| | 210 | |
| | 211 | Clean $(tag)swigclean : $(target) $(othertargets) ; |
| | 212 | Depends clean : $(tag)swigclean ; |
| | 213 | |
| | 214 | if $(frozentargetdir) |
| | 215 | { |
| | 216 | local frozen_target = $(target:G=$(tag)freeze) ; |
| | 217 | MakeLocate $(frozen_target) : $(frozentargetdir) ; |
| | 218 | Depends $(frozen_target) : $(target) ; |
| | 219 | Copy $(frozen_target) : $(target) ; |
| | 220 | Depends $(tag)freeze : $(frozen_target) ; |
| | 221 | |
| | 222 | if $(othertargets) |
| | 223 | { |
| | 224 | local frozen_other = $(othertargets:G=$(tag)freeze) ; |
| | 225 | MakeLocate $(frozen_other) : $(frozenotherdir) ; |
| | 226 | Depends $(frozen_other) : $(othertargets) ; |
| | 227 | Copy $(frozen_other) : $(othertargets) ; |
| | 228 | Depends $(tag)freeze : $(frozen_other) ; |
| | 229 | } |
| | 230 | |
| | 231 | NotFile $(tag)freeze ; |
| | 232 | Help $(tag)freeze : "Copy generated Swig files to source directory" ; |
| | 233 | } |
| | 234 | } |