xref: /haiku/build/jam/OverriddenJamRules (revision a1163de83ea633463a79de234b8742ee106531b2)
1# Overridden to allow spaces in file names.
2actions Chmod1
3{
4	$(CHMOD) "$(MODE)" "$(1)"
5}
6
7# Overridden to allow spaces in file names.
8actions piecemeal together existing Clean
9{
10	$(RM) "$(>)"
11}
12
13#-------------------------------------------------------------------------------
14# Link rule/action are overwritten as they don't handle linking files who's name
15# contain spaces very well. Also adds resources and version to executable.
16#-------------------------------------------------------------------------------
17rule Link
18{
19	# Note: RESFILES must be set before invocation.
20
21	if [ on $(1) return $(PLATFORM) ] = host {
22		LINK on $(1) = $(HOST_LINK) ;
23	 	LINKFLAGS on $(1) = $(HOST_LINKFLAGS) [ on $(1) return $(LINKFLAGS) ] ;
24	} else {
25		LINK on $(1) = $(TARGET_LINK) ;
26	 	LINKFLAGS on $(1) = $(TARGET_LINKFLAGS)
27			[ on $(1) return $(LINKFLAGS) ] ;
28	}
29
30 	NEEDLIBS on $(1) = [ on $(1) return $(NEEDLIBS) ] ;
31 	LINKLIBS on $(1) = [ on $(1) return $(LINKLIBS) ] ;
32
33	MODE on $(<) = $(EXEMODE) ;
34	on $(1) XRes $(1) : $(RESFILES) ;
35	if ! [ on $(1) return $(DONT_USE_BEOS_RULES) ] {
36		SetType $(1) ;
37		MimeSet $(1) ;
38		SetVersion $(1) ;
39
40		# If the generic attribute emulation is enabled, make sure the tool to
41		# remove the attributes is built first.
42		if $(HOST_RM_ATTRS_TARGET) {
43			Depends $(1) : $(HOST_RM_ATTRS_TARGET) ;
44		}
45	}
46	Chmod $(<) ;
47}
48
49# When using "real" attributes (i.e. BeOS attributes or xattr/extattr) on the
50# host platform, unlinking the main target by gcc will also automatically get
51# rid of the attributes. When using the generic attribute emulation, which
52# uses separate files, we need to remove the target explicitely first, so that
53# the attributes won't be "leaked".
54if $(HOST_PLATFORM_BEOS_COMPATIBLE) || $(HAIKU_HOST_USE_XATTR) = 1 {
55	actions Link bind NEEDLIBS LINK_BEGIN_GLUE LINK_END_GLUE VERSION_SCRIPT
56	{
57		$(LINK) $(LINKFLAGS) -o "$(1)" $(UNDEFS) "$(LINK_BEGIN_GLUE)" "$(2)" \
58			"$(NEEDLIBS)" $(LINKLIBS) "$(LINK_END_GLUE)" \
59			-Wl,--version-script,$(VERSION_SCRIPT)
60	}
61} else {
62	actions Link bind NEEDLIBS LINK_BEGIN_GLUE LINK_END_GLUE VERSION_SCRIPT
63	{
64		$(RM) "$(1)"
65		$(LINK) $(LINKFLAGS) -o "$(1)" $(UNDEFS) "$(LINK_BEGIN_GLUE)" "$(2)" \
66			"$(NEEDLIBS)" $(LINKLIBS) "$(LINK_END_GLUE)" \
67			-Wl,--version-script,$(VERSION_SCRIPT)
68	}
69}
70
71rule Object
72{
73	# find out which headers and defines to use
74	local headers ;
75	local sysHeaders ;
76	local defines ;
77
78	on $(1) { # use on $(1) variable values
79		if ! $(PLATFORM) in $(SUPPORTED_PLATFORMS) {
80			return ;
81		}
82
83		# Save HDRS for -I$(HDRS) on compile.
84		# We shouldn't need -I$(SEARCH_SOURCE) as cc can find headers
85		# in the .c file's directory, but generated .c files (from
86		# yacc, lex, etc) are located in $(LOCATE_TARGET), possibly
87		# different from $(SEARCH_SOURCE).
88
89		headers = $(HAIKU_CONFIG_HEADERS) $(SEARCH_SOURCE) $(SUBDIRHDRS)
90			$(HDRS) ;
91		sysHeaders = $(SUBDIRSYSHDRS) $(SYSHDRS) ;
92		defines = $(DEFINES) ;
93
94		if $(PLATFORM) = host {
95			sysHeaders += $(HOST_HDRS) ;
96			defines += $(HOST_DEFINES) ;
97
98			if $(USES_BE_API) {
99				sysHeaders += $(HOST_BE_API_HEADERS) ;
100			}
101
102		} else {
103			sysHeaders += $(TARGET_HDRS) ;
104			defines += $(TARGET_DEFINES) ;
105		}
106	}
107
108	# locate object and search for source
109
110	LocalClean clean : $(<) ;
111
112	MakeLocateDebug $(<) ;
113	SEARCH on $(>) = $(SEARCH_SOURCE) ;
114
115	HDRS on $(<) = $(headers) ;
116	SYSHDRS on $(<) = $(sysHeaders) ;
117
118	# handle #includes for source: Jam scans for headers with
119	# the regexp pattern $(HDRSCAN) and then invokes $(HDRRULE)
120	# with the scanned file as the target and the found headers
121	# as the sources.  HDRSEARCH is the value of SEARCH used for
122	# the found header files.  Finally, if jam must deal with
123	# header files of the same name in different directories,
124	# they can be distinguished with HDRGRIST.
125
126	# $(SEARCH_SOURCE:E) is where cc first looks for #include
127	# "foo.h" files.  If the source file is in a distant directory,
128	# look there.  Else, look in "" (the current directory).
129
130	HDRRULE on $(>) = HdrRule ;
131	HDRSCAN on $(>) = $(HDRPATTERN) ;
132	HDRSEARCH on $(>) = $(headers) $(sysHeaders) $(STDHDRS) ;
133	HDRGRIST on $(>) = $(HDRGRIST) ;
134
135	# propagate target specific-defines
136
137	DEFINES on $(1) = $(defines) ;
138
139	# if source is not .c, generate .c with specific rule
140
141	switch $(>:S)
142	{
143	    case .asm : As $(<) : $(>) ;
144	    case .nasm : AssembleNasm $(<) : $(>) ;
145	    case .c :	Cc $(<) : $(>) ;
146	    case .C :	C++ $(<) : $(>) ;
147	    case .cc :	C++ $(<) : $(>) ;
148	    case .cpp : C++ $(<) : $(>) ;
149	    case .f :	Fortran $(<) : $(>) ;
150	    case .l :	if [ on $(2) return $(GENERATE_C++) ] {
151	    				InheritPlatform $(<:S=.cpp) : $(1) ;
152						C++ $(<) : $(<:S=.cpp) ;
153						Lex $(<:S=.cpp) : $(>) ;
154					} else {
155	    				InheritPlatform $(<:S=.c) : $(1) ;
156						Cc $(<) : $(<:S=.c) ;
157						Lex $(<:S=.c) : $(>) ;
158					}
159		case *.o :	return ;
160	    case .s :	As $(<) : $(>) ;
161	    case .S :	As $(<) : $(>) ;
162	    case .y :	if [ on $(2) return $(GENERATE_C++) ] {
163	    				InheritPlatform $(1:S=.cpp) $(1:S=.hpp) : $(1) ;
164						C++ $(1) : $(1:S=.cpp) ;
165						Yacc $(1:S=.cpp) $(1:S=.hpp) : $(2) ;
166					} else {
167	    				InheritPlatform $(1:S=.c) $(1:S=.h) : $(1) ;
168						Cc $(1) : $(1:S=.c) ;
169						Yacc $(1:S=.c) $(1:S=.h) : $(2) ;
170					}
171	    case * :	UserObject $(<) : $(>) ;
172	}
173}
174
175rule As
176{
177	local flags ;
178	local includesSeparator ;
179	local localIncludesOption ;
180	local systemIncludesOption ;
181	if [ on $(1) return $(PLATFORM) ] = host {
182		flags = [ on $(1) return $(HOST_ASFLAGS) $(ASFLAGS) ] ;
183
184		CC on $(1) = $(HOST_CC) ;
185
186		includesSeparator = $(HOST_INCLUDES_SEPARATOR) ;
187		localIncludesOption = $(HOST_LOCAL_INCLUDES_OPTION) ;
188		systemIncludesOption = $(HOST_SYSTEM_INCLUDES_OPTION) ;
189
190	} else {
191		flags = [ on $(1) return $(TARGET_ASFLAGS) $(ASFLAGS) ] ;
192
193		CC on $(1) = $(TARGET_CC) ;
194
195		includesSeparator = $(TARGET_INCLUDES_SEPARATOR) ;
196		localIncludesOption = $(TARGET_LOCAL_INCLUDES_OPTION) ;
197		systemIncludesOption = $(TARGET_SYSTEM_INCLUDES_OPTION) ;
198	}
199
200	Depends $(<) : $(>) ;
201	ASFLAGS on $(<) += $(flags) $(SUBDIRASFLAGS) ;
202	ASHDRS on $(<) = [ on $(<) FIncludes $(HDRS) : $(localIncludesOption) ]
203		$(includesSeparator)
204		[ on $(<) FSysIncludes $(SYSHDRS) : $(systemIncludesOption) ] ;
205	ASDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ;
206}
207
208# TODO: The KERNEL_CCFLAGS were used here before. Check whether we need any
209# flags we don't have now.
210actions As
211{
212	$(CC) -c "$(2)" -O2 $(ASFLAGS) -D_ASSEMBLER $(ASDEFS) $(ASHDRS) -o "$(1)" ;
213}
214
215rule Lex
216{
217	Depends $(1) : $(2) ;
218	MakeLocateArch $(1) ;
219	LocalClean clean : $(1) ;
220}
221
222actions Lex
223{
224	$(LEX) $(LEXFLAGS) -o$(1) $(2)
225}
226
227rule Yacc
228{
229	local source = $(1[1]) ;
230	local header = $(1[2]) ;
231	local yaccSource = $(2) ;
232
233	MakeLocateArch $(source) $(header) ;
234
235	Depends $(source) $(header) : $(yaccSource) ;
236	Yacc1 $(source) $(header) : $(yaccSource) ;
237	LocalClean clean : $(source) $(header) ;
238
239	# make sure someone includes $(header) else it will be
240	# a deadly independent target
241
242	Includes $(source) : $(header) ;
243}
244
245actions Yacc1
246{
247	bison $(YACCFLAGS) -o $(1[1]) $(2)
248	[ -f $(1[1]).h ] && mv $(1[1]).h $(1[2]) || true
249}
250
251rule Cc
252{
253	Depends $(<) : $(>) ;
254
255	on $(1) {
256		local flags ;
257		local includesSeparator ;
258		local localIncludesOption ;
259		local systemIncludesOption ;
260
261		# optimization flags
262		if $(DEBUG) = 0 {
263			flags += $(OPTIM) ;
264		} else {
265			flags += -O0 ;
266		}
267
268		if $(PLATFORM) = host {
269			# warning flags
270			if $(WARNINGS) != 0 {
271				flags += $(HOST_WARNING_CCFLAGS) ;
272			}
273
274			# debug and other flags
275			flags += $(HOST_CCFLAGS) $(HOST_DEBUG_$(DEBUG)_CCFLAGS)
276				$(SUBDIRCCFLAGS) $(CCFLAGS) ;
277
278			if $(USES_BE_API) {
279				flags += $(HOST_BE_API_CCFLAGS) ;
280			}
281
282			CC on $(1) = $(HOST_CC) ;
283
284			includesSeparator = $(HOST_INCLUDES_SEPARATOR) ;
285			localIncludesOption = $(HOST_LOCAL_INCLUDES_OPTION) ;
286			systemIncludesOption = $(HOST_SYSTEM_INCLUDES_OPTION) ;
287
288		} else {
289			# warning flags
290			if $(WARNINGS) != 0 {
291				flags += $(TARGET_WARNING_CCFLAGS) ;
292			}
293
294			# debug and other flags
295			flags += $(TARGET_CCFLAGS) $(TARGET_DEBUG_$(DEBUG)_CCFLAGS)
296				$(SUBDIRCCFLAGS) $(CCFLAGS) ;
297
298			CC on $(1) = $(TARGET_CC) ;
299
300			includesSeparator = $(TARGET_INCLUDES_SEPARATOR) ;
301			localIncludesOption = $(TARGET_LOCAL_INCLUDES_OPTION) ;
302			systemIncludesOption = $(TARGET_SYSTEM_INCLUDES_OPTION) ;
303		}
304
305		CCFLAGS on $(<) = $(flags) ;
306		CCHDRS on $(<) = [ FIncludes $(HDRS) : $(localIncludesOption) ]
307			$(includesSeparator)
308			[ FSysIncludes $(SYSHDRS) : $(systemIncludesOption) ] ;
309		CCDEFS on $(<) = [ FDefines $(DEFINES) ] ;
310	}
311}
312
313actions Cc
314{
315	$(CC) $(CCFLAGS) -c "$(2)" $(CCDEFS) $(CCHDRS) -o "$(1)" ;
316}
317
318rule C++
319{
320	Depends $(<) : $(>) ;
321
322	on $(1) {
323		local flags ;
324		local includesSeparator ;
325		local localIncludesOption ;
326		local systemIncludesOption ;
327
328		# optimization flags
329		if $(DEBUG) = 0 {
330			flags += $(OPTIM) ;
331		} else {
332			flags += -O0 ;
333		}
334
335		if $(PLATFORM) = host {
336			# warning flags
337			if $(WARNINGS) != 0 {
338				flags += $(HOST_WARNING_C++FLAGS) ;
339			}
340
341			# debug and other flags
342			flags += $(HOST_C++FLAGS) $(HOST_DEBUG_$(DEBUG)_C++FLAGS)
343				$(SUBDIRC++FLAGS) $(C++FLAGS) ;
344
345			if $(USES_BE_API) {
346				flags += $(HOST_BE_API_C++FLAGS) ;
347			}
348
349			C++ on $(1) = $(HOST_C++) ;
350
351			includesSeparator = $(HOST_INCLUDES_SEPARATOR) ;
352			localIncludesOption = $(HOST_LOCAL_INCLUDES_OPTION) ;
353			systemIncludesOption = $(HOST_SYSTEM_INCLUDES_OPTION) ;
354
355		} else {
356			# warning flags
357			if $(WARNINGS) != 0 {
358				flags += $(TARGET_WARNING_C++FLAGS) ;
359			}
360
361			# debug and other flags
362			flags += $(TARGET_C++FLAGS) $(TARGET_DEBUG_$(DEBUG)_C++FLAGS)
363				$(SUBDIRC++FLAGS) $(C++FLAGS) ;
364
365			C++ on $(1) = $(TARGET_C++) ;
366
367			includesSeparator = $(TARGET_INCLUDES_SEPARATOR) ;
368			localIncludesOption = $(TARGET_LOCAL_INCLUDES_OPTION) ;
369			systemIncludesOption = $(TARGET_SYSTEM_INCLUDES_OPTION) ;
370		}
371
372		C++FLAGS on $(<) = $(flags) ;
373		CCHDRS on $(<) = [ FIncludes $(HDRS) : $(localIncludesOption) ]
374			$(includesSeparator)
375			[ FSysIncludes $(SYSHDRS) : $(systemIncludesOption) ] ;
376		CCDEFS on $(<) = [ FDefines $(DEFINES) ] ;
377	}
378}
379
380actions C++
381{
382	$(C++) -c "$(2)" $(C++FLAGS) $(CCDEFS) $(CCHDRS) -o "$(1)" ;
383}
384
385actions together Archive
386{
387	# Force recreation of the archive to avoid build errors caused by
388	# stale dependencies after renaming or deleting object files.
389	$(RM) $(<)
390	$(AR) $(<) $(>)
391}
392
393rule Library
394{
395	local lib = $(1) ;
396	local sources = [ FGristFiles $(2) ] ;
397	local objects = $(sources:S=$(SUFOBJ)) ;
398
399	InheritPlatform $(objects) : $(lib) ;
400	LibraryFromObjects $(lib) : $(objects) ;
401	Objects $(sources) ;
402}
403
404rule LibraryFromObjects
405{
406	local _i _l _s ;
407
408	# Add grist to file names
409	# bonefish: No, don't. The Library rule does that anyway, and when we
410	# have an object from another dir, we certainly don't want that.
411
412	_s = $(>) ;
413	_l = $(<:S=$(SUFLIB)) ;
414
415	on $(_l) {
416		# set the tools according to the platform
417		if $(PLATFORM) = host {
418			AR on $(_l) = $(HOST_AR) $(HOST_ARFLAGS) ;
419			RANLIB on $(_l) = $(HOST_RANLIB) ;
420		} else {
421			AR on $(_l) = $(TARGET_AR) $(TARGET_ARFLAGS) ;
422			RANLIB on $(_l) = $(TARGET_RANLIB) ;
423		}
424
425		# library depends on its member objects
426
427		if $(KEEPOBJS)
428		{
429			LocalDepends obj : $(_s) ;
430		}
431
432		LocalDepends lib : $(_l) ;
433
434		# Set LOCATE for the library and its contents.  The bound
435		# value shows up as $(NEEDLIBS) on the Link actions.
436		# For compatibility, we only do this if the library doesn't
437		# already have a path.
438
439		if ! $(_l:D)
440		{
441			# locate the library only, if it hasn't been located yet
442			local dir = $(LOCATE[1]) ;
443			if ! $(dir) {
444				MakeLocateDebug $(_l) ;
445				dir = [ on $(_l) return $(LOCATE[1]) ] ;
446					# Note: The "on ..." is necessary, since our environment
447					# isn't changed by MakeLocateDebug.
448			}
449			MakeLocate $(_l)($(_s:BS)) : $(dir) ;
450		}
451
452		if $(NOARSCAN)
453		{
454			# If we can't scan the library to timestamp its contents,
455			# we have to just make the library depend directly on the
456			# on-disk object files.
457
458			Depends $(_l) : $(_s) ;
459		}
460		else
461		{
462			# If we can scan the library, we make the library depend
463			# on its members and each member depend on the on-disk
464			# object file.
465
466			Depends $(_l) : $(_l)($(_s:BS)) ;
467
468			for _i in $(_s)
469			{
470			Depends $(_l)($(_i:BS)) : $(_i) ;
471			}
472		}
473
474		LocalClean clean : $(_l) ;
475
476		# bonefish: Not needed on the supported platforms. Maybe later...
477		# if $(CRELIB) { CreLib $(_l) : $(_s[1]) ; }
478
479		Archive $(_l) : $(_s) ;
480
481		if $(RANLIB) { Ranlib $(_l) ; }
482
483		# If we can't scan the library, we have to leave the .o's around.
484
485		if ! ( $(KEEPOBJS) || $(NOARSCAN) || $(NOARUPDATE) ) {
486			RmTemps $(_l) : $(_s) ;
487		}
488	}
489}
490
491rule Main
492{
493	local target = $(1) ;
494	local sources = [ FGristFiles $(2) ] ;
495	local objects = $(sources:S=$(SUFOBJ)) ;
496
497	InheritPlatform $(objects) : $(target) ;
498	MainFromObjects $(target) : $(objects) ;
499	Objects $(sources) ;
500}
501
502rule MainFromObjects
503{
504	local _s _t ;
505
506	# Add grist to file names
507	# Add suffix to exe
508
509	_s = [ FGristFiles $(>) ] ;
510	_t = [ FAppendSuffix $(<) : $(SUFEXE) ] ;
511
512	# so 'jam foo' works when it's really foo.exe
513
514	if $(_t) != $(<)
515	{
516	    Depends $(<) : $(_t) ;
517	    NotFile $(<) ;
518	}
519
520	# make compiled sources a dependency of target
521
522	LocalDepends exe : $(_t) ;
523	Depends $(_t) : $(_s) ;
524	MakeLocateDebug $(_t) ;
525
526	LocalClean clean : $(_t) ;
527
528	Link $(_t) : $(_s) ;
529}
530
531# Override Jam 2.5rc3 MakeLocate and MkDir to deal more intelligently
532# with grist set on the supplied directory name.
533rule MakeLocate
534{
535	local dir = $(2[1]) ;
536
537	if $(dir)
538	{
539		if ! $(dir:G) {
540			dir = $(dir:G=dir) ;
541		}
542	    LOCATE on $(1) += $(dir:G=) ;	# don't relocate once located
543	    Depends $(1) : $(dir) ;
544	    MkDir $(dir) ;
545	}
546}
547
548rule MkDir
549{
550	local dir = $(<) ;
551	if ! $(dir:G) {
552		dir = $(dir:G=dir) ;
553	}
554
555	# make this and all super directories
556	while true {
557		# If dir exists, don't update it
558		# Do this even for $(DOT).
559		NoUpdate $(dir) ;
560
561		# Bail out when reaching the CWD (".") or a directory we've already
562		# made.
563		if $(dir:G=) = $(DOT) || $($(dir:G=)-mkdir) {
564			return ;
565		}
566
567		local s ;
568
569		# Cheesy gate to prevent multiple invocations on same dir
570		# MkDir1 has the actions
571		# Arrange for jam dirs
572
573		$(dir:G=)-mkdir = true ;
574		MkDir1 $(dir) ;
575		LocalDepends dirs : $(dir) ;
576
577		# Recursively make parent directories.
578		# $(dir:P) = $(dir)'s parent, & we recurse until root
579
580		s = $(dir:P) ;	# parent keeps grist
581
582		if $(s:G=) && $(s) != $(dir) {
583			Depends $(dir) : $(s) ;
584			dir = $(s) ;
585		} else if $(s) {
586			NotFile $(s) ;
587			break ;
588		}
589	}
590}
591
592rule ObjectCcFlags
593{
594	# supports inheriting the global variable value
595
596	local file ;
597	for file in [ FGristFiles $(1:S=$(SUFOBJ)) ] {
598		CCFLAGS on $(file) = [ on $(file) return $(CCFLAGS) ] $(2) ;
599	}
600}
601
602rule ObjectC++Flags
603{
604	# supports inheriting the global variable value
605
606	local file ;
607	for file in [ FGristFiles $(1:S=$(SUFOBJ)) ] {
608		C++FLAGS on $(file) = [ on $(file) return $(C++FLAGS) ] $(2) ;
609	}
610}
611
612rule ObjectDefines
613{
614	# supports inheriting the global variable value and multiple files
615
616	if $(2) {
617		local file ;
618		for file in [ FGristFiles $(1:S=$(SUFOBJ)) ] {
619			DEFINES on $(file) = [ on $(file) return $(DEFINES) ] $(2) ;
620			CCDEFS on $(file) = [ on $(file) FDefines $(DEFINES) ] ;
621		}
622	}
623}
624
625rule ObjectHdrs
626{
627	# ObjectHdrs <sources or objects> : <headers> : <gristed objects>
628	# Note: Parameter 3 <gristed objects> is an extension.
629
630	local objects = [ FGristFiles $(1:S=$(SUFOBJ)) ] $(3) ;
631	local headers = $(2) ;
632
633	local file ;
634	for file in $(objects) {
635		on $(file) {
636			local localHeaders = $(HDRS) $(headers) ;
637			SYSHDRS on $(file) = $(localHeaders) ;
638
639			# reformat ASHDRS and CCHDRS
640			local fileHeaders ;
641
642			if $(PLATFORM) = host {
643				fileHeaders =
644					[ FIncludes $(localHeaders) : $(HOST_LOCAL_INCLUDES_OPTION) ]
645					$(HOST_INCLUDES_SEPARATOR)
646					[ FSysIncludes $(SYSHDRS)
647						: $(HOST_SYSTEM_INCLUDES_OPTION) ] ;
648			} else {
649				fileHeaders =
650					[ FIncludes $(localHeaders) : $(TARGET_LOCAL_INCLUDES_OPTION) ]
651					$(TARGET_INCLUDES_SEPARATOR)
652					[ FSysIncludes $(SYSHDRS)
653						: $(TARGET_SYSTEM_INCLUDES_OPTION) ] ;
654			}
655
656			ASHDRS on $(file) = $(fileHeaders) ;
657			CCHDRS on $(file) = $(fileHeaders) ;
658		}
659	}
660}
661
662# Overridden to avoid calling SubDir for a directory twice (in SubInclude
663# and from the Jamfile in the directory).
664rule SubInclude
665{
666	# SubInclude TOP d1 ... ;
667	#
668	# Include a subdirectory's Jamfile.
669
670	if ! $($(<[1]))
671	{
672	    Exit SubInclude $(<[1]) without prior SubDir $(<[1]) ;
673	}
674
675	# Set up the config variables for the subdirectory.
676	local config = [ ConfigObject $(1) ] ;
677
678	__configured = ;
679	if ! [ on $(config) return $(__configured) ] {
680		# No custom configuration defined for the subdir. We use the variable
681		# values inherited by the closest ancestor.
682		config = $(HAIKU_INHERITED_SUBDIR_CONFIG) ;
683	}
684
685	# store SUBDIR_TOKENS
686	local oldSubDirTokens = $(SUBDIR_TOKENS) ;
687
688	on $(config) {
689		include [ FDirName $($(1[1])) $(1[2-) $(JAMFILE) ] ;
690	}
691
692	# restore SUBDIR_TOKENS
693	SUBDIR_TOKENS = $(oldSubDirTokens) ;
694}
695