#   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 #   B u i l d i n g 
 #   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 s r c   : =   $ ( o b j ) 
 
 P H O N Y   : =   _ _ b u i l d 
 _ _ b u i l d : 
 
 #   I n i t   a l l   r e l e v a n t   v a r i a b l e s   u s e d   i n   k b u i l d   f i l e s   s o 
 #   1 )   t h e y   h a v e   c o r r e c t   t y p e 
 #   2 )   t h e y   d o   n o t   i n h e r i t   a n y   v a l u e   f r o m   t h e   e n v i r o n m e n t 
 o b j - y   : = 
 o b j - m   : = 
 l i b - y   : = 
 l i b - m   : = 
 a l w a y s   : = 
 t a r g e t s   : = 
 s u b d i r - y   : = 
 s u b d i r - m   : = 
 E X T R A _ A F L A G S       : = 
 E X T R A _ C F L A G S       : = 
 E X T R A _ C P P F L A G S   : = 
 E X T R A _ L D F L A G S     : = 
 a s f l a g s - y     : = 
 c c f l a g s - y     : = 
 c p p f l a g s - y   : = 
 l d f l a g s - y     : = 
 
 s u b d i r - a s f l a g s - y   : = 
 s u b d i r - c c f l a g s - y   : = 
 
 #   R e a d   a u t o . c o n f   i f   i t   e x i s t s ,   o t h e r w i s e   i g n o r e 
 - i n c l u d e   i n c l u d e / c o n f i g / a u t o . c o n f 
 
 # # # # 
 #   k b u i l d :   G e n e r i c   d e f i n i t i o n s 
 
 #   C o n v e n i e n t   v a r i a b l e s 
 c o m m a       : =   , 
 s q u o t e     : =   ' 
 e m p t y       : = 
 s p a c e       : =   $ ( e m p t y )   $ ( e m p t y ) 
 
 # # # 
 #   N a m e   o f   t a r g e t   w i t h   a   ' . '   a s   f i l e n a m e   p r e f i x .   f o o / b a r . o   = >   f o o / . b a r . o 
 d o t - t a r g e t   =   $ ( d i r   $ @ ) . $ ( n o t d i r   $ @ ) 
 
 # # # 
 #   T h e   t e m p o r a r y   f i l e   t o   s a v e   g c c   - M D   g e n e r a t e d   d e p e n d e n c i e s   m u s t   n o t 
 #   c o n t a i n   a   c o m m a 
 d e p f i l e   =   $ ( s u b s t   $ ( c o m m a ) , _ , $ ( d o t - t a r g e t ) . d ) 
 
 # # # 
 #   f i l e n a m e   o f   t a r g e t   w i t h   d i r e c t o r y   a n d   e x t e n s i o n   s t r i p p e d 
 b a s e t a r g e t   =   $ ( b a s e n a m e   $ ( n o t d i r   $ @ ) ) 
 
 # # # 
 #   f i l e n a m e   o f   f i r s t   p r e r e q u i s i t e   w i t h   d i r e c t o r y   a n d   e x t e n s i o n   s t r i p p e d 
 b a s e p r e r e q   =   $ ( b a s e n a m e   $ ( n o t d i r   $ < ) ) 
 
 # # # 
 #   E s c a p e   s i n g l e   q u o t e   f o r   u s e   i n   e c h o   s t a t e m e n t s 
 e s c s q   =   $ ( s u b s t   $ ( s q u o t e ) , ' \ $ ( s q u o t e ) ' , $ 1 ) 
 
 # # # 
 #   E a s y   m e t h o d   f o r   d o i n g   a   s t a t u s   m e s s a g e 
               k e c h o   : =   : 
   q u i e t _ k e c h o   : =   e c h o 
 s i l e n t _ k e c h o   : =   : 
 k e c h o   : =   $ ( $ ( q u i e t ) k e c h o ) 
 
 # # # 
 #   f i l e c h k   i s   u s e d   t o   c h e c k   i f   t h e   c o n t e n t   o f   a   g e n e r a t e d   f i l e   i s   u p d a t e d . 
 #   S a m p l e   u s a g e : 
 #   d e f i n e   f i l e c h k _ s a m p l e 
 # 	 e c h o   $ K E R N E L R E L E A S E 
 #   e n d e f 
 #   v e r s i o n . h   :   M a k e f i l e 
 # 	 $ ( c a l l   f i l e c h k , s a m p l e ) 
 #   T h e   r u l e   d e f i n e d   s h a l l   w r i t e   t o   s t d o u t   t h e   c o n t e n t   o f   t h e   n e w   f i l e . 
 #   T h e   e x i s t i n g   f i l e   w i l l   b e   c o m p a r e d   w i t h   t h e   n e w   o n e . 
 #   -   I f   n o   f i l e   e x i s t   i t   i s   c r e a t e d 
 #   -   I f   t h e   c o n t e n t   d i f f e r   t h e   n e w   f i l e   i s   u s e d 
 #   -   I f   t h e y   a r e   e q u a l   n o   c h a n g e ,   a n d   n o   t i m e s t a m p   u p d a t e 
 #   -   s t d i n   i s   p i p e d   i n   f r o m   t h e   f i r s t   p r e r e q u i s i t e   ( $ < )   s o   o n e   h a s 
 #       t o   s p e c i f y   a   v a l i d   f i l e   a s   f i r s t   p r e r e q u i s i t e   ( o f t e n   t h e   k b u i l d   f i l e ) 
 d e f i n e   f i l e c h k 
 	 $ ( Q ) s e t   - e ; 	 	 	 	 \ 
 	 $ ( k e c h o )   '     C H K           $ @ ' ; 	 	 \ 
 	 m k d i r   - p   $ ( d i r   $ @ ) ; 	 	 	 \ 
 	 $ ( f i l e c h k _ $ ( 1 ) )   <   $ <   >   $ @ . t m p ; 	 	 \ 
 	 i f   [   - r   $ @   ]   & &   c m p   - s   $ @   $ @ . t m p ;   t h e n 	 \ 
 	 	 r m   - f   $ @ . t m p ; 	 	 	 \ 
 	 e l s e 	 	 	 	 	 \ 
 	 	 $ ( k e c h o )   '     U P D           $ @ ' ; 	 \ 
 	 	 m v   - f   $ @ . t m p   $ @ ; 	 	 \ 
 	 f i 
 e n d e f 
 
 # # # # # # 
 #   g c c   s u p p o r t   f u n c t i o n s 
 #   S e e   d o c u m e n t a t i o n   i n   D o c u m e n t a t i o n / k b u i l d / m a k e f i l e s . t x t 
 
 #   c c - c r o s s - p r e f i x 
 #   U s a g e :   C R O S S _ C O M P I L E   : =   $ ( c a l l   c c - c r o s s - p r e f i x ,   m 6 8 k - l i n u x - g n u -   m 6 8 k - l i n u x - ) 
 #   R e t u r n   f i r s t   p r e f i x   w h e r e   a   p r e f i x $ ( C C )   i s   f o u n d   i n   P A T H . 
 #   I f   n o   $ ( C C )   f o u n d   i n   P A T H   w i t h   l i s t e d   p r e f i x e s   r e t u r n   n o t h i n g 
 c c - c r o s s - p r e f i x   =     \ 
 	 $ ( w o r d   1 ,   $ ( f o r e a c h   c , $ ( 1 ) ,                                                                       \ 
 	 	 $ ( s h e l l   s e t   - e ;                                                                               \ 
 	 	 i f   ( w h i c h   $ ( s t r i p   $ ( c ) ) $ ( C C ) )   >   / d e v / n u l l   2 > & 1   ;   t h e n   \ 
 	 	 	 e c h o   $ ( c ) ;                                                                         \ 
 	 	 f i ) ) ) 
 
 #   o u t p u t   d i r e c t o r y   f o r   t e s t s   b e l o w 
 T M P O U T   : =   $ ( i f   $ ( K B U I L D _ E X T M O D ) , $ ( f i r s t w o r d   $ ( K B U I L D _ E X T M O D ) ) / ) 
 
 #   t r y - r u n 
 #   U s a g e :   o p t i o n   =   $ ( c a l l   t r y - r u n ,   $ ( C C ) . . . - o   " $ $ T M P " , o p t i o n - o k , o t h e r w i s e ) 
 #   E x i t   c o d e   c h o o s e s   o p t i o n .   " $ $ T M P "   i s   c a n   b e   u s e d   a s   t e m p o r a r y   f i l e   a n d 
 #   i s   a u t o m a t i c a l l y   c l e a n e d   u p . 
 t r y - r u n   =   $ ( s h e l l   s e t   - e ; 	 	 \ 
 	 T M P = " $ ( T M P O U T ) . $ $ $ $ . t m p " ; 	 \ 
 	 T M P O = " $ ( T M P O U T ) . $ $ $ $ . o " ; 	 \ 
 	 i f   ( $ ( 1 ) )   > / d e v / n u l l   2 > & 1 ; 	 \ 
 	 t h e n   e c h o   " $ ( 2 ) " ; 	 	 \ 
 	 e l s e   e c h o   " $ ( 3 ) " ; 	 	 \ 
 	 f i ; 	 	 	 	 \ 
 	 r m   - f   " $ $ T M P "   " $ $ T M P O " ) 
 
 #   a s - o p t i o n 
 #   U s a g e :   c f l a g s - y   + =   $ ( c a l l   a s - o p t i o n , - W a $ ( c o m m a ) - i s a = f o o , ) 
 
 a s - o p t i o n   =   $ ( c a l l   t r y - r u n , \ 
 	 $ ( C C )   $ ( K B U I L D _ C F L A G S )   $ ( 1 )   - c   - x a s s e m b l e r   / d e v / n u l l   - o   " $ $ T M P " , $ ( 1 ) , $ ( 2 ) ) 
 
 #   a s - i n s t r 
 #   U s a g e :   c f l a g s - y   + =   $ ( c a l l   a s - i n s t r , i n s t r , o p t i o n 1 , o p t i o n 2 ) 
 
 a s - i n s t r   =   $ ( c a l l   t r y - r u n , \ 
 	 p r i n t f   " % b \ n "   " $ ( 1 ) "   |   $ ( C C )   $ ( K B U I L D _ A F L A G S )   - c   - x a s s e m b l e r   - o   " $ $ T M P "   - , $ ( 2 ) , $ ( 3 ) ) 
 
 #   c c - o p t i o n 
 #   U s a g e :   c f l a g s - y   + =   $ ( c a l l   c c - o p t i o n , - m a r c h = w i n c h i p - c 6 , - m a r c h = i 5 8 6 ) 
 
 c c - o p t i o n   =   $ ( c a l l   t r y - r u n , \ 
 	 $ ( C C )   $ ( K B U I L D _ C P P F L A G S )   $ ( K B U I L D _ C F L A G S )   $ ( 1 )   - c   - x c   / d e v / n u l l   - o   " $ $ T M P " , $ ( 1 ) , $ ( 2 ) ) 
 
 #   c c - o p t i o n - y n 
 #   U s a g e :   f l a g   : =   $ ( c a l l   c c - o p t i o n - y n , - m a r c h = w i n c h i p - c 6 ) 
 c c - o p t i o n - y n   =   $ ( c a l l   t r y - r u n , \ 
 	 $ ( C C )   $ ( K B U I L D _ C P P F L A G S )   $ ( K B U I L D _ C F L A G S )   $ ( 1 )   - c   - x c   / d e v / n u l l   - o   " $ $ T M P " , y , n ) 
 
 #   c c - o p t i o n - a l i g n 
 #   P r e f i x   a l i g n   w i t h   e i t h e r   - f a l i g n   o r   - m a l i g n 
 c c - o p t i o n - a l i g n   =   $ ( s u b s t   - f u n c t i o n s = 0 , , \ 
 	 $ ( c a l l   c c - o p t i o n , - f a l i g n - f u n c t i o n s = 0 , - m a l i g n - f u n c t i o n s = 0 ) ) 
 
 #   c c - d i s a b l e - w a r n i n g 
 #   U s a g e :   c f l a g s - y   + =   $ ( c a l l   c c - d i s a b l e - w a r n i n g , u n u s e d - b u t - s e t - v a r i a b l e ) 
 c c - d i s a b l e - w a r n i n g   =   $ ( c a l l   t r y - r u n , \ 
 	 $ ( C C )   $ ( K B U I L D _ C P P F L A G S )   $ ( K B U I L D _ C F L A G S )   - W $ ( s t r i p   $ ( 1 ) )   - c   - x c   / d e v / n u l l   - o   " $ $ T M P " , - W n o - $ ( s t r i p   $ ( 1 ) ) ) 
 
 #   c c - v e r s i o n 
 #   U s a g e   g c c - v e r   : =   $ ( c a l l   c c - v e r s i o n ) 
 c c - v e r s i o n   =   $ ( s h e l l   $ ( C O N F I G _ S H E L L )   $ ( s r c t r e e ) / s c r i p t s / g c c - v e r s i o n . s h   $ ( C C ) ) 
 
 #   c c - f u l l v e r s i o n 
 #   U s a g e   g c c - v e r   : =   $ ( c a l l   c c - f u l l v e r s i o n ) 
 c c - f u l l v e r s i o n   =   $ ( s h e l l   $ ( C O N F I G _ S H E L L )   \ 
 	 $ ( s r c t r e e ) / s c r i p t s / g c c - v e r s i o n . s h   - p   $ ( C C ) ) 
 
 #   c c - i f v e r s i o n 
 #   U s a g e :     E X T R A _ C F L A G S   + =   $ ( c a l l   c c - i f v e r s i o n ,   - l t ,   0 4 0 2 ,   - O 1 ) 
 c c - i f v e r s i o n   =   $ ( s h e l l   [   $ ( c a l l   c c - v e r s i o n ,   $ ( C C ) )   $ ( 1 )   $ ( 2 )   ]   & &   e c h o   $ ( 3 ) ) 
 
 #   c c - l d o p t i o n 
 #   U s a g e :   l d f l a g s   + =   $ ( c a l l   c c - l d o p t i o n ,   - W l $ ( c o m m a ) - - h a s h - s t y l e = b o t h ) 
 c c - l d o p t i o n   =   $ ( c a l l   t r y - r u n , \ 
 	 $ ( C C )   $ ( 1 )   - n o s t d l i b   - x c   / d e v / n u l l   - o   " $ $ T M P " , $ ( 1 ) , $ ( 2 ) ) 
 
 #   l d - o p t i o n 
 #   U s a g e :   L D F L A G S   + =   $ ( c a l l   l d - o p t i o n ,   - X ) 
 l d - o p t i o n   =   $ ( c a l l   t r y - r u n , \ 
 	 $ ( C C )   / d e v / n u l l   - c   - o   " $ $ T M P O "   ;   $ ( L D )   $ ( 1 )   " $ $ T M P O "   - o   " $ $ T M P " , $ ( 1 ) , $ ( 2 ) ) 
 
 #   a r - o p t i o n 
 #   U s a g e :   K B U I L D _ A R F L A G S   : =   $ ( c a l l   a r - o p t i o n , D ) 
 #   I m p o r t a n t :   n o   s p a c e s   a r o u n d   o p t i o n s 
 a r - o p t i o n   =   $ ( c a l l   t r y - r u n ,   $ ( A R )   r c $ ( 1 )   " $ $ T M P " , $ ( 1 ) , $ ( 2 ) ) 
 
 # # # # # # 
 
 # # # 
 #   S h o r t h a n d   f o r   $ ( Q ) $ ( M A K E )   - f   s c r i p t s / M a k e f i l e . b u i l d   o b j = 
 #   U s a g e : 
 #   $ ( Q ) $ ( M A K E )   $ ( b u i l d ) = d i r 
 b u i l d   : =   - f   $ ( i f   $ ( K B U I L D _ S R C ) , $ ( s r c t r e e ) / ) s c r i p t s / M a k e f i l e . b u i l d   o b j 
 
 # # # 
 #   S h o r t h a n d   f o r   $ ( Q ) $ ( M A K E )   - f   s c r i p t s / M a k e f i l e . m o d b u i l t i n   o b j = 
 #   U s a g e : 
 #   $ ( Q ) $ ( M A K E )   $ ( m o d b u i l t i n ) = d i r 
 m o d b u i l t i n   : =   - f   $ ( i f   $ ( K B U I L D _ S R C ) , $ ( s r c t r e e ) / ) s c r i p t s / M a k e f i l e . m o d b u i l t i n   o b j 
 
 #   P r e f i x   - I   w i t h   $ ( s r c t r e e )   i f   i t   i s   n o t   a n   a b s o l u t e   p a t h . 
 #   s k i p   i f   - I   h a s   n o   p a r a m e t e r 
 a d d t r e e   =   $ ( i f   $ ( p a t s u b s t   - I % , % , $ ( 1 ) ) ,   \ 
 $ ( i f   $ ( f i l t e r - o u t   - I / % , $ ( 1 ) ) , $ ( p a t s u b s t   - I % , - I $ ( s r c t r e e ) / % , $ ( 1 ) ) )   $ ( 1 ) ) 
 
 #   F i n d   a l l   - I   o p t i o n s   a n d   c a l l   a d d t r e e 
 f l a g s   =   $ ( f o r e a c h   o , $ ( $ ( 1 ) ) , $ ( i f   $ ( f i l t e r   - I % , $ ( o ) ) , $ ( c a l l   a d d t r e e , $ ( o ) ) , $ ( o ) ) ) 
 
 #   e c h o   c o m m a n d . 
 #   S h o r t   v e r s i o n   i s   u s e d ,   i f   $ ( q u i e t )   e q u a l s   ` q u i e t _ ' ,   o t h e r w i s e   f u l l   o n e . 
 e c h o - c m d   =   $ ( i f   $ ( $ ( q u i e t ) c m d _ $ ( 1 ) ) , \ 
 	 e c h o   '     $ ( c a l l   e s c s q , $ ( $ ( q u i e t ) c m d _ $ ( 1 ) ) ) $ ( e c h o - w h y ) ' ; ) 
 
 #   p r i n t i n g   c o m m a n d s 
 c m d   =   @ $ ( e c h o - c m d )   $ ( c m d _ $ ( 1 ) ) 
 
 #   A d d   $ ( o b j ) /   f o r   p a t h s   t h a t   a r e   n o t   a b s o l u t e 
 o b j e c t i f y   =   $ ( f o r e a c h   o , $ ( 1 ) , $ ( i f   $ ( f i l t e r   / % , $ ( o ) ) , $ ( o ) , $ ( o b j ) / $ ( o ) ) ) 
 
 # # # 
 #   i f _ c h a n g e d             -   e x e c u t e   c o m m a n d   i f   a n y   p r e r e q u i s i t e   i s   n e w e r   t h a n 
 #                                       t a r g e t ,   o r   c o m m a n d   l i n e   h a s   c h a n g e d 
 #   i f _ c h a n g e d _ d e p     -   a s   i f _ c h a n g e d ,   b u t   u s e s   f i x d e p   t o   r e v e a l   d e p e n d e n c i e s 
 #                                       i n c l u d i n g   u s e d   c o n f i g   s y m b o l s 
 #   i f _ c h a n g e d _ r u l e   -   a s   i f _ c h a n g e d   b u t   e x e c u t e   r u l e   i n s t e a d 
 #   S e e   D o c u m e n t a t i o n / k b u i l d / m a k e f i l e s . t x t   f o r   m o r e   i n f o 
 
 i f n e q   ( $ ( K B U I L D _ N O C M D D E P ) , 1 ) 
 #   C h e c k   i f   b o t h   a r g u m e n t s   h a s   s a m e   a r g u m e n t s .   R e s u l t   i s   e m p t y   s t r i n g   i f   e q u a l . 
 #   U s e r   m a y   o v e r r i d e   t h i s   c h e c k   u s i n g   m a k e   K B U I L D _ N O C M D D E P = 1 
 a r g - c h e c k   =   $ ( s t r i p   $ ( f i l t e r - o u t   $ ( c m d _ $ ( 1 ) ) ,   $ ( c m d _ $ @ ) )   \ 
                                         $ ( f i l t e r - o u t   $ ( c m d _ $ @ ) ,       $ ( c m d _ $ ( 1 ) ) )   ) 
 e l s e 
 a r g - c h e c k   =   $ ( i f   $ ( s t r i p   $ ( c m d _ $ @ ) ) , , 1 ) 
 e n d i f 
 
 #   > ' <   s u b s t i t u t i o n   i s   f o r   e c h o   t o   w o r k , 
 #   > $ <   s u b s t i t u t i o n   t o   p r e s e r v e   $   w h e n   r e l o a d i n g   . c m d   f i l e 
 #   n o t e :   w h e n   u s i n g   i n l i n e   p e r l   s c r i p t s   [ p e r l   - e   ' . . . $ $ t = 1 ; . . . ' ] 
 #   i n   $ ( c m d _ x x x )   d o u b l e   $ $   y o u r   p e r l   v a r s 
 m a k e - c m d   =   $ ( s u b s t   \ # , \ \ \ # , $ ( s u b s t   $ $ , $ $ $ $ , $ ( c a l l   e s c s q , $ ( c m d _ $ ( 1 ) ) ) ) ) 
 
 #   F i n d   a n y   p r e r e q u i s i t e s   t h a t   i s   n e w e r   t h a n   t a r g e t   o r   t h a t   d o e s   n o t   e x i s t . 
 #   P H O N Y   t a r g e t s   s k i p p e d   i n   b o t h   c a s e s . 
 a n y - p r e r e q   =   $ ( f i l t e r - o u t   $ ( P H O N Y ) , $ ? )   $ ( f i l t e r - o u t   $ ( P H O N Y )   $ ( w i l d c a r d   $ ^ ) , $ ^ ) 
 
 #   E x e c u t e   c o m m a n d   i f   c o m m a n d   h a s   c h a n g e d   o r   p r e r e q u i s i t e ( s )   a r e   u p d a t e d . 
 # 
 i f _ c h a n g e d   =   $ ( i f   $ ( s t r i p   $ ( a n y - p r e r e q )   $ ( a r g - c h e c k ) ) ,                                               \ 
 	 @ s e t   - e ;                                                                                                                           \ 
 	 $ ( e c h o - c m d )   $ ( c m d _ $ ( 1 ) ) ;                                                                                           \ 
 	 e c h o   ' c m d _ $ @   : =   $ ( m a k e - c m d ) '   >   $ ( d o t - t a r g e t ) . c m d ) 
 
 #   E x e c u t e   t h e   c o m m a n d   a n d   a l s o   p o s t p r o c e s s   g e n e r a t e d   . d   d e p e n d e n c i e s   f i l e . 
 i f _ c h a n g e d _ d e p   =   $ ( i f   $ ( s t r i p   $ ( a n y - p r e r e q )   $ ( a r g - c h e c k )   ) ,                                     \ 
 	 @ s e t   - e ;                                                                                                                           \ 
 	 $ ( e c h o - c m d )   $ ( c m d _ $ ( 1 ) ) ;                                                                                           \ 
 	 s c r i p t s / b a s i c / f i x d e p   $ ( d e p f i l e )   $ @   ' $ ( m a k e - c m d ) '   >   $ ( d o t - t a r g e t ) . t m p ; \ 
 	 r m   - f   $ ( d e p f i l e ) ;                                                                                                         \ 
 	 m v   - f   $ ( d o t - t a r g e t ) . t m p   $ ( d o t - t a r g e t ) . c m d ) 
 
 #   U s a g e :   $ ( c a l l   i f _ c h a n g e d _ r u l e , f o o ) 
 #   W i l l   c h e c k   i f   $ ( c m d _ f o o )   o r   a n y   o f   t h e   p r e r e q u i s i t e s   c h a n g e d , 
 #   a n d   i f   s o   w i l l   e x e c u t e   $ ( r u l e _ f o o ) . 
 i f _ c h a n g e d _ r u l e   =   $ ( i f   $ ( s t r i p   $ ( a n y - p r e r e q )   $ ( a r g - c h e c k )   ) ,                                   \ 
 	 @ s e t   - e ;                                                                                                                           \ 
 	 $ ( r u l e _ $ ( 1 ) ) ) 
 
 # # # 
 #   w h y   -   t e l l   w h y   a   a   t a r g e t   g o t   b u i l d 
 #               e n a b l e d   b y   m a k e   V = 2 
 #               O u t p u t   ( l i s t e d   i n   t h e   o r d e r   t h e y   a r e   c h e c k e d ) : 
 #                     ( 1 )   -   d u e   t o   t a r g e t   i s   P H O N Y 
 #                     ( 2 )   -   d u e   t o   t a r g e t   m i s s i n g 
 #                     ( 3 )   -   d u e   t o :   f i l e 1 . h   f i l e 2 . h 
 #                     ( 4 )   -   d u e   t o   c o m m a n d   l i n e   c h a n g e 
 #                     ( 5 )   -   d u e   t o   m i s s i n g   . c m d   f i l e 
 #                     ( 6 )   -   d u e   t o   t a r g e t   n o t   i n   $ ( t a r g e t s ) 
 #   ( 1 )   P H O N Y   t a r g e t s   a r e   a l w a y s   b u i l d 
 #   ( 2 )   N o   t a r g e t ,   s o   w e   b e t t e r   b u i l d   i t 
 #   ( 3 )   P r e r e q u i s i t e   i s   n e w e r   t h a n   t a r g e t 
 #   ( 4 )   T h e   c o m m a n d   l i n e   s t o r e d   i n   t h e   f i l e   n a m e d   d i r / . t a r g e t . c m d 
 #           d i f f e r e d   f r o m   a c t u a l   c o m m a n d   l i n e .   T h i s   h a p p e n s   w h e n   c o m p i l e r 
 #           o p t i o n s   c h a n g e s 
 #   ( 5 )   N o   d i r / . t a r g e t . c m d   f i l e   ( u s e d   t o   s t o r e   c o m m a n d   l i n e ) 
 #   ( 6 )   N o   d i r / . t a r g e t . c m d   f i l e   a n d   t a r g e t   n o t   l i s t e d   i n   $ ( t a r g e t s ) 
 #           T h i s   i s   a   g o o d   h i n t   t h a t   t h e r e   i s   a   b u g   i n   t h e   k b u i l d   f i l e 
 i f e q   ( $ ( K B U I L D _ V E R B O S E ) , 2 ) 
 w h y   =                                                                                                                                                 \ 
         $ ( i f   $ ( f i l t e r   $ @ ,   $ ( P H O N Y ) ) , -   d u e   t o   t a r g e t   i s   P H O N Y ,                                         \ 
                 $ ( i f   $ ( w i l d c a r d   $ @ ) ,                                                                                                   \ 
                         $ ( i f   $ ( s t r i p   $ ( a n y - p r e r e q ) ) , -   d u e   t o :   $ ( a n y - p r e r e q ) ,                           \ 
                                 $ ( i f   $ ( a r g - c h e c k ) ,                                                                                       \ 
                                         $ ( i f   $ ( c m d _ $ @ ) , -   d u e   t o   c o m m a n d   l i n e   c h a n g e ,                           \ 
                                                 $ ( i f   $ ( f i l t e r   $ @ ,   $ ( t a r g e t s ) ) ,                                               \ 
                                                         -   d u e   t o   m i s s i n g   . c m d   f i l e ,                                             \ 
                                                         -   d u e   t o   $ ( n o t d i r   $ @ )   n o t   i n   $ $ ( t a r g e t s )                   \ 
                                                   )                                                                                                       \ 
                                           )                                                                                                               \ 
                                   )                                                                                                                       \ 
                           ) ,                                                                                                                             \ 
                           -   d u e   t o   t a r g e t   m i s s i n g                                                                                   \ 
                   )                                                                                                                                       \ 
           ) 
 
 e c h o - w h y   =   $ ( c a l l   e s c s q ,   $ ( s t r i p   $ ( w h y ) ) ) 
 e n d i f 
 
 
 #   F o r   b a c k w a r d   c o m p a t i b i l i t y   c h e c k   t h a t   t h e s e   v a r i a b l e s   d o   n o t   c h a n g e 
 s a v e - c f l a g s   : =   $ ( C F L A G S ) 
 
 #   T h e   f i l e n a m e   K b u i l d   h a s   p r e c e d e n c e   o v e r   M a k e f i l e 
 k b u i l d - d i r   : =   $ ( i f   $ ( f i l t e r   / % , $ ( s r c ) ) , $ ( s r c ) , $ ( s r c t r e e ) / $ ( s r c ) ) 
 k b u i l d - f i l e   : =   $ ( i f   $ ( w i l d c a r d   $ ( k b u i l d - d i r ) / K b u i l d ) , $ ( k b u i l d - d i r ) / K b u i l d , $ ( k b u i l d - d i r ) / M a k e f i l e ) 
 i n c l u d e   $ ( k b u i l d - f i l e ) 
 
 #   I f   t h e   s a v e - *   v a r i a b l e s   c h a n g e d   e r r o r   o u t 
 i f e q   ( $ ( K B U I L D _ N O P E D A N T I C ) , ) 
                 i f n e q   ( " $ ( s a v e - c f l a g s ) " , " $ ( C F L A G S ) " ) 
                                 $ ( e r r o r   C F L A G S   w a s   c h a n g e d   i n   " $ ( k b u i l d - f i l e ) " .   F i x   i t   t o   u s e   c c f l a g s - y ) 
                 e n d i f 
 e n d i f 
 
 # 
 #   m a k e   W = . . .   s e t t i n g s 
 # 
 #   W = 1   -   w a r n i n g s   t h a t   m a y   b e   r e l e v a n t   a n d   d o e s   n o t   o c c u r   t o o   o f t e n 
 #   W = 2   -   w a r n i n g s   t h a t   o c c u r   q u i t e   o f t e n   b u t   m a y   s t i l l   b e   r e l e v a n t 
 #   W = 3   -   t h e   m o r e   o b s c u r e   w a r n i n g s ,   c a n   m o s t   l i k e l y   b e   i g n o r e d 
 # 
 #   $ ( c a l l   c c - o p t i o n ,   - W . . . )   h a n d l e s   g c c   - W . .   o p t i o n s   w h i c h 
 #   a r e   n o t   s u p p o r t e d   b y   a l l   v e r s i o n s   o f   t h e   c o m p i l e r 
 i f d e f   K B U I L D _ E N A B L E _ E X T R A _ G C C _ C H E C K S 
 w a r n i n g -     : =   $ ( e m p t y ) 
 
 w a r n i n g - 1   : =   - W e x t r a   - W u n u s e d   - W n o - u n u s e d - p a r a m e t e r 
 w a r n i n g - 1   + =   - W m i s s i n g - d e c l a r a t i o n s 
 w a r n i n g - 1   + =   - W m i s s i n g - f o r m a t - a t t r i b u t e 
 w a r n i n g - 1   + =   - W m i s s i n g - p r o t o t y p e s 
 w a r n i n g - 1   + =   - W o l d - s t y l e - d e f i n i t i o n 
 w a r n i n g - 1   + =   $ ( c a l l   c c - o p t i o n ,   - W m i s s i n g - i n c l u d e - d i r s ) 
 w a r n i n g - 1   + =   $ ( c a l l   c c - o p t i o n ,   - W u n u s e d - b u t - s e t - v a r i a b l e ) 
 w a r n i n g - 1   + =   $ ( c a l l   c c - d i s a b l e - w a r n i n g ,   m i s s i n g - f i e l d - i n i t i a l i z e r s ) 
 
 w a r n i n g - 2   : =   - W a g g r e g a t e - r e t u r n 
 w a r n i n g - 2   + =   - W c a s t - a l i g n 
 w a r n i n g - 2   + =   - W d i s a b l e d - o p t i m i z a t i o n 
 w a r n i n g - 2   + =   - W n e s t e d - e x t e r n s 
 w a r n i n g - 2   + =   - W s h a d o w 
 w a r n i n g - 2   + =   $ ( c a l l   c c - o p t i o n ,   - W l o g i c a l - o p ) 
 w a r n i n g - 2   + =   $ ( c a l l   c c - o p t i o n ,   - W m i s s i n g - f i e l d - i n i t i a l i z e r s ) 
 
 w a r n i n g - 3   : =   - W b a d - f u n c t i o n - c a s t 
 w a r n i n g - 3   + =   - W c a s t - q u a l 
 w a r n i n g - 3   + =   - W c o n v e r s i o n 
 w a r n i n g - 3   + =   - W p a c k e d 
 w a r n i n g - 3   + =   - W p a d d e d 
 w a r n i n g - 3   + =   - W p o i n t e r - a r i t h 
 w a r n i n g - 3   + =   - W r e d u n d a n t - d e c l s 
 w a r n i n g - 3   + =   - W s w i t c h - d e f a u l t 
 w a r n i n g - 3   + =   $ ( c a l l   c c - o p t i o n ,   - W p a c k e d - b i t f i e l d - c o m p a t ) 
 w a r n i n g - 3   + =   $ ( c a l l   c c - o p t i o n ,   - W v l a ) 
 
 w a r n i n g   : =   $ ( w a r n i n g - $ ( f i n d s t r i n g   1 ,   $ ( K B U I L D _ E N A B L E _ E X T R A _ G C C _ C H E C K S ) ) ) 
 w a r n i n g   + =   $ ( w a r n i n g - $ ( f i n d s t r i n g   2 ,   $ ( K B U I L D _ E N A B L E _ E X T R A _ G C C _ C H E C K S ) ) ) 
 w a r n i n g   + =   $ ( w a r n i n g - $ ( f i n d s t r i n g   3 ,   $ ( K B U I L D _ E N A B L E _ E X T R A _ G C C _ C H E C K S ) ) ) 
 
 i f e q   ( " $ ( s t r i p   $ ( w a r n i n g ) ) " , " " ) 
                 $ ( e r r o r   W = $ ( K B U I L D _ E N A B L E _ E X T R A _ G C C _ C H E C K S )   i s   u n k n o w n ) 
 e n d i f 
 
 K B U I L D _ C F L A G S   + =   $ ( w a r n i n g ) 
 e n d i f 
 
 #   B a c k w a r d   c o m p a t i b i l i t y 
 a s f l a g s - y     + =   $ ( E X T R A _ A F L A G S ) 
 c c f l a g s - y     + =   $ ( E X T R A _ C F L A G S ) 
 c p p f l a g s - y   + =   $ ( E X T R A _ C P P F L A G S ) 
 l d f l a g s - y     + =   $ ( E X T R A _ L D F L A G S ) 
 
 # 
 #   f l a g s   t h a t   t a k e   e f f e c t   i n   s u b   d i r e c t o r i e s 
 e x p o r t   K B U I L D _ S U B D I R _ A S F L A G S   : =   $ ( K B U I L D _ S U B D I R _ A S F L A G S )   $ ( s u b d i r - a s f l a g s - y ) 
 e x p o r t   K B U I L D _ S U B D I R _ C C F L A G S   : =   $ ( K B U I L D _ S U B D I R _ C C F L A G S )   $ ( s u b d i r - c c f l a g s - y ) 
 
 #   F i g u r e   o u t   w h a t   w e   n e e d   t o   b u i l d   f r o m   t h e   v a r i o u s   v a r i a b l e s 
 #   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 #   W h e n   a n   o b j e c t   i s   l i s t e d   t o   b e   b u i l t   c o m p i l e d - i n   a n d   m o d u l a r , 
 #   o n l y   b u i l d   t h e   c o m p i l e d - i n   v e r s i o n 
 
 o b j - m   : =   $ ( f i l t e r - o u t   $ ( o b j - y ) , $ ( o b j - m ) ) 
 
 #   L i b r a r i e s   a r e   a l w a y s   c o l l e c t e d   i n   o n e   l i b   f i l e . 
 #   F i l t e r   o u t   o b j e c t s   a l r e a d y   b u i l t - i n 
 
 l i b - y   : =   $ ( f i l t e r - o u t   $ ( o b j - y ) ,   $ ( s o r t   $ ( l i b - y )   $ ( l i b - m ) ) ) 
 
 
 #   H a n d l e   o b j e c t s   i n   s u b d i r s 
 #   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 #   o   i f   w e   e n c o u n t e r   f o o /   i n   $ ( o b j - y ) ,   r e p l a c e   i t   b y   f o o / b u i l t - i n . o 
 #       a n d   a d d   t h e   d i r e c t o r y   t o   t h e   l i s t   o f   d i r s   t o   d e s c e n d   i n t o :   $ ( s u b d i r - y ) 
 #   o   i f   w e   e n c o u n t e r   f o o /   i n   $ ( o b j - m ) ,   r e m o v e   i t   f r o m   $ ( o b j - m )   
 #       a n d   a d d   t h e   d i r e c t o r y   t o   t h e   l i s t   o f   d i r s   t o   d e s c e n d   i n t o :   $ ( s u b d i r - m ) 
 
 #   D e t e r m i n e   m o d o r d e r . 
 #   U n f o r t u n a t e l y ,   w e   d o n ' t   h a v e   i n f o r m a t i o n   a b o u t   o r d e r i n g   b e t w e e n   - y 
 #   a n d   - m   s u b d i r s .     J u s t   p u t   - y ' s   f i r s t . 
 m o d o r d e r 	 : =   $ ( p a t s u b s t   % / , % / m o d u l e s . o r d e r ,   $ ( f i l t e r   % / ,   $ ( o b j - y ) )   $ ( o b j - m : . o = . k o ) ) 
 
 _ _ s u b d i r - y 	 : =   $ ( p a t s u b s t   % / , % , $ ( f i l t e r   % / ,   $ ( o b j - y ) ) ) 
 s u b d i r - y 	 + =   $ ( _ _ s u b d i r - y ) 
 _ _ s u b d i r - m 	 : =   $ ( p a t s u b s t   % / , % , $ ( f i l t e r   % / ,   $ ( o b j - m ) ) ) 
 s u b d i r - m 	 + =   $ ( _ _ s u b d i r - m ) 
 o b j - y 	 	 : =   $ ( p a t s u b s t   % / ,   % / b u i l t - i n . o ,   $ ( o b j - y ) ) 
 o b j - m 	 	 : =   $ ( f i l t e r - o u t   % / ,   $ ( o b j - m ) ) 
 
 #   S u b d i r e c t o r i e s   w e   n e e d   t o   d e s c e n d   i n t o 
 
 s u b d i r - y m 	 : =   $ ( s o r t   $ ( s u b d i r - y )   $ ( s u b d i r - m ) ) 
 
 #   i f   $ ( f o o - o b j s )   e x i s t s ,   f o o . o   i s   a   c o m p o s i t e   o b j e c t   
 m u l t i - u s e d - y   : =   $ ( s o r t   $ ( f o r e a c h   m , $ ( o b j - y ) ,   $ ( i f   $ ( s t r i p   $ ( $ ( m : . o = - o b j s ) )   $ ( $ ( m : . o = - y ) ) ) ,   $ ( m ) ) ) ) 
 m u l t i - u s e d - m   : =   $ ( s o r t   $ ( f o r e a c h   m , $ ( o b j - m ) ,   $ ( i f   $ ( s t r i p   $ ( $ ( m : . o = - o b j s ) )   $ ( $ ( m : . o = - y ) ) ) ,   $ ( m ) ) ) ) 
 m u l t i - u s e d       : =   $ ( m u l t i - u s e d - y )   $ ( m u l t i - u s e d - m ) 
 s i n g l e - u s e d - m   : =   $ ( s o r t   $ ( f i l t e r - o u t   $ ( m u l t i - u s e d - m ) , $ ( o b j - m ) ) ) 
 
 #   B u i l d   l i s t   o f   t h e   p a r t s   o f   o u r   c o m p o s i t e   o b j e c t s ,   o u r   c o m p o s i t e 
 #   o b j e c t s   d e p e n d   o n   t h o s e   ( o b v i o u s l y ) 
 m u l t i - o b j s - y   : =   $ ( f o r e a c h   m ,   $ ( m u l t i - u s e d - y ) ,   $ ( $ ( m : . o = - o b j s ) )   $ ( $ ( m : . o = - y ) ) ) 
 m u l t i - o b j s - m   : =   $ ( f o r e a c h   m ,   $ ( m u l t i - u s e d - m ) ,   $ ( $ ( m : . o = - o b j s ) )   $ ( $ ( m : . o = - y ) ) ) 
 m u l t i - o b j s       : =   $ ( m u l t i - o b j s - y )   $ ( m u l t i - o b j s - m ) 
 
 #   $ ( s u b d i r - o b j - y )   i s   t h e   l i s t   o f   o b j e c t s   i n   $ ( o b j - y )   w h i c h   u s e s   d i r /   t o 
 #   t e l l   k b u i l d   t o   d e s c e n d 
 s u b d i r - o b j - y   : =   $ ( f i l t e r   % / b u i l t - i n . o ,   $ ( o b j - y ) ) 
 
 #   $ ( o b j - d i r s )   i s   a   l i s t   o f   d i r e c t o r i e s   t h a t   c o n t a i n   o b j e c t   f i l e s 
 o b j - d i r s   : =   $ ( d i r   $ ( m u l t i - o b j s )   $ ( s u b d i r - o b j - y ) ) 
 
 #   R e p l a c e   m u l t i - p a r t   o b j e c t s   b y   t h e i r   i n d i v i d u a l   p a r t s ,   l o o k   a t   l o c a l   d i r   o n l y 
 r e a l - o b j s - y   : =   $ ( f o r e a c h   m ,   $ ( f i l t e r - o u t   $ ( s u b d i r - o b j - y ) ,   $ ( o b j - y ) ) ,   $ ( i f   $ ( s t r i p   $ ( $ ( m : . o = - o b j s ) )   $ ( $ ( m : . o = - y ) ) ) , $ ( $ ( m : . o = - o b j s ) )   $ ( $ ( m : . o = - y ) ) , $ ( m ) ) )   $ ( e x t r a - y ) 
 r e a l - o b j s - m   : =   $ ( f o r e a c h   m ,   $ ( o b j - m ) ,   $ ( i f   $ ( s t r i p   $ ( $ ( m : . o = - o b j s ) )   $ ( $ ( m : . o = - y ) ) ) , $ ( $ ( m : . o = - o b j s ) )   $ ( $ ( m : . o = - y ) ) , $ ( m ) ) ) 
 
 #   A d d   s u b d i r   p a t h 
 
 e x t r a - y 	 	 : =   $ ( a d d p r e f i x   $ ( o b j ) / , $ ( e x t r a - y ) ) 
 a l w a y s 	 	 : =   $ ( a d d p r e f i x   $ ( o b j ) / , $ ( a l w a y s ) ) 
 t a r g e t s 	 	 : =   $ ( a d d p r e f i x   $ ( o b j ) / , $ ( t a r g e t s ) ) 
 m o d o r d e r 	 : =   $ ( a d d p r e f i x   $ ( o b j ) / , $ ( m o d o r d e r ) ) 
 o b j - y 	 	 : =   $ ( a d d p r e f i x   $ ( o b j ) / , $ ( o b j - y ) ) 
 o b j - m 	 	 : =   $ ( a d d p r e f i x   $ ( o b j ) / , $ ( o b j - m ) ) 
 l i b - y 	 	 : =   $ ( a d d p r e f i x   $ ( o b j ) / , $ ( l i b - y ) ) 
 s u b d i r - o b j - y 	 : =   $ ( a d d p r e f i x   $ ( o b j ) / , $ ( s u b d i r - o b j - y ) ) 
 r e a l - o b j s - y 	 : =   $ ( a d d p r e f i x   $ ( o b j ) / , $ ( r e a l - o b j s - y ) ) 
 r e a l - o b j s - m 	 : =   $ ( a d d p r e f i x   $ ( o b j ) / , $ ( r e a l - o b j s - m ) ) 
 s i n g l e - u s e d - m 	 : =   $ ( a d d p r e f i x   $ ( o b j ) / , $ ( s i n g l e - u s e d - m ) ) 
 m u l t i - u s e d - y 	 : =   $ ( a d d p r e f i x   $ ( o b j ) / , $ ( m u l t i - u s e d - y ) ) 
 m u l t i - u s e d - m 	 : =   $ ( a d d p r e f i x   $ ( o b j ) / , $ ( m u l t i - u s e d - m ) ) 
 m u l t i - o b j s - y 	 : =   $ ( a d d p r e f i x   $ ( o b j ) / , $ ( m u l t i - o b j s - y ) ) 
 m u l t i - o b j s - m 	 : =   $ ( a d d p r e f i x   $ ( o b j ) / , $ ( m u l t i - o b j s - m ) ) 
 s u b d i r - y m 	 : =   $ ( a d d p r e f i x   $ ( o b j ) / , $ ( s u b d i r - y m ) ) 
 o b j - d i r s 	 : =   $ ( a d d p r e f i x   $ ( o b j ) / , $ ( o b j - d i r s ) ) 
 
 #   T h e s e   f l a g s   a r e   n e e d e d   f o r   m o d v e r s i o n s   a n d   c o m p i l i n g ,   s o   w e   d e f i n e   t h e m   h e r e 
 #   a l r e a d y 
 #   $ ( m o d n a m e _ f l a g s )   # d e f i n e s   K B U I L D _ M O D N A M E   a s   t h e   n a m e   o f   t h e   m o d u l e   i t   w i l l   
 #   e n d   u p   i n   ( o r   w o u l d ,   i f   i t   g e t s   c o m p i l e d   i n ) 
 #   N o t e :   F i l e s   t h a t   e n d   u p   i n   t w o   o r   m o r e   m o d u l e s   a r e   c o m p i l e d   w i t h o u t   t h e 
 #               K B U I L D _ M O D N A M E   d e f i n i t i o n .   T h e   r e a s o n   i s   t h a t   a n y   m a d e - u p   n a m e   w o u l d 
 #               d i f f e r   i n   d i f f e r e n t   c o n f i g s . 
 n a m e - f i x   =   $ ( s u b s t   $ ( c o m m a ) , _ , $ ( s u b s t   - , _ , $ 1 ) ) 
 b a s e n a m e _ f l a g s   =   - D " K B U I L D _ B A S E N A M E = K B U I L D _ S T R ( $ ( c a l l   n a m e - f i x , $ ( b a s e t a r g e t ) ) ) " 
 m o d n a m e _ f l a g s     =   $ ( i f   $ ( f i l t e r   1 , $ ( w o r d s   $ ( m o d n a m e ) ) ) , \ 
                                   - D " K B U I L D _ M O D N A M E = K B U I L D _ S T R ( $ ( c a l l   n a m e - f i x , $ ( m o d n a m e ) ) ) " ) 
 
 o r i g _ c _ f l a g s       =   $ ( K B U I L D _ C P P F L A G S )   $ ( K B U I L D _ C F L A G S )   $ ( K B U I L D _ S U B D I R _ C C F L A G S )   \ 
                                   $ ( c c f l a g s - y )   $ ( C F L A G S _ $ ( b a s e t a r g e t ) . o ) 
 _ c _ f l a g s               =   $ ( f i l t e r - o u t   $ ( C F L A G S _ R E M O V E _ $ ( b a s e t a r g e t ) . o ) ,   $ ( o r i g _ c _ f l a g s ) ) 
 _ a _ f l a g s               =   $ ( K B U I L D _ C P P F L A G S )   $ ( K B U I L D _ A F L A G S )   $ ( K B U I L D _ S U B D I R _ A S F L A G S )   \ 
                                   $ ( a s f l a g s - y )   $ ( A F L A G S _ $ ( b a s e t a r g e t ) . o ) 
 _ c p p _ f l a g s           =   $ ( K B U I L D _ C P P F L A G S )   $ ( c p p f l a g s - y )   $ ( C P P F L A G S _ $ ( @ F ) ) 
 
 # 
 #   E n a b l e   g c o v   p r o f i l i n g   f l a g s   f o r   a   f i l e ,   d i r e c t o r y   o r   f o r   a l l   f i l e s   d e p e n d i n g 
 #   o n   v a r i a b l e s   G C O V _ P R O F I L E _ o b j . o ,   G C O V _ P R O F I L E   a n d   C O N F I G _ G C O V _ P R O F I L E _ A L L 
 #   ( i n   t h i s   o r d e r ) 
 # 
 i f e q   ( $ ( C O N F I G _ G C O V _ K E R N E L ) , y ) 
 _ c _ f l a g s   + =   $ ( i f   $ ( p a t s u b s t   n % , ,   \ 
 	 	 $ ( G C O V _ P R O F I L E _ $ ( b a s e t a r g e t ) . o ) $ ( G C O V _ P R O F I L E ) $ ( C O N F I G _ G C O V _ P R O F I L E _ A L L ) ) ,   \ 
 	 	 $ ( C F L A G S _ G C O V ) ) 
 e n d i f 
 
 i f d e f   C O N F I G _ S Y M B O L _ P R E F I X 
 _ s y m _ f l a g s   =   - D S Y M B O L _ P R E F I X = $ ( p a t s u b s t   " % " , % , $ ( C O N F I G _ S Y M B O L _ P R E F I X ) ) 
 _ c p p _ f l a g s   + =   $ ( _ s y m _ f l a g s ) 
 _ a _ f l a g s   + =   $ ( _ s y m _ f l a g s ) 
 e n d i f 
 
 
 #   I f   b u i l d i n g   t h e   k e r n e l   i n   a   s e p a r a t e   o b j t r e e   e x p a n d   a l l   o c c u r r e n c e s 
 #   o f   - I d i r   t o   - I $ ( s r c t r e e ) / d i r   e x c e p t   f o r   a b s o l u t e   p a t h s   ( s t a r t i n g   w i t h   ' / ' ) . 
 
 i f e q   ( $ ( K B U I L D _ S R C ) , ) 
 _ _ c _ f l a g s 	 =   $ ( _ c _ f l a g s ) 
 _ _ a _ f l a g s 	 =   $ ( _ a _ f l a g s ) 
 _ _ c p p _ f l a g s           =   $ ( _ c p p _ f l a g s ) 
 e l s e 
 
 #   - I $ ( o b j )   l o c a t e s   g e n e r a t e d   . h   f i l e s 
 #   $ ( c a l l   a d d t r e e , - I $ ( o b j ) )   l o c a t e s   . h   f i l e s   i n   s r c t r e e ,   f r o m   g e n e r a t e d   . c   f i l e s 
 #       a n d   l o c a t e s   g e n e r a t e d   . h   f i l e s 
 #   F I X M E :   R e p l a c e   b o t h   w i t h   s p e c i f i c   C F L A G S *   s t a t e m e n t s   i n   t h e   m a k e f i l e s 
 _ _ c _ f l a g s 	 =   $ ( c a l l   a d d t r e e , - I $ ( o b j ) )   $ ( c a l l   f l a g s , _ c _ f l a g s ) 
 _ _ a _ f l a g s 	 =                                                     $ ( c a l l   f l a g s , _ a _ f l a g s ) 
 _ _ c p p _ f l a g s           =                                                     $ ( c a l l   f l a g s , _ c p p _ f l a g s ) 
 e n d i f 
 
 c _ f l a g s                 =   - W p , - M D , $ ( d e p f i l e )   $ ( N O S T D I N C _ F L A G S )   $ ( L I N U X I N C L U D E )           \ 
 	 	   $ ( _ _ c _ f l a g s )   $ ( m o d k e r n _ c f l a g s )                                                       \ 
 	 	   - D " K B U I L D _ S T R ( s ) = \ # s "   $ ( b a s e n a m e _ f l a g s )   $ ( m o d n a m e _ f l a g s ) 
 
 a _ f l a g s                 =   - W p , - M D , $ ( d e p f i l e )   $ ( N O S T D I N C _ F L A G S )   $ ( L I N U X I N C L U D E )           \ 
 	 	   $ ( _ _ a _ f l a g s )   $ ( m o d k e r n _ a f l a g s ) 
 
 c p p _ f l a g s             =   - W p , - M D , $ ( d e p f i l e )   $ ( N O S T D I N C _ F L A G S )   $ ( L I N U X I N C L U D E )           \ 
 	 	   $ ( _ _ c p p _ f l a g s ) 
 
 l d _ f l a g s               =   $ ( L D F L A G S )   $ ( l d f l a g s - y ) 
 
 #   F i n d s   t h e   m u l t i - p a r t   o b j e c t   t h e   c u r r e n t   o b j e c t   w i l l   b e   l i n k e d   i n t o 
 m o d n a m e - m u l t i   =   $ ( s o r t   $ ( f o r e a c h   m , $ ( m u l t i - u s e d ) , \ 
 	 	 $ ( i f   $ ( f i l t e r   $ ( s u b s t   $ ( o b j ) / , , $ * . o ) ,   $ ( $ ( m : . o = - o b j s ) )   $ ( $ ( m : . o = - y ) ) ) , $ ( m : . o = ) ) ) ) 
 
 i f d e f   R E G E N E R A T E _ P A R S E R S 
 
 #   G P E R F 
 #   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 q u i e t _ c m d _ g p e r f   =   G P E R F   $ @ 
             c m d _ g p e r f   =   g p e r f   - t   - - o u t p u t - f i l e   $ @   - a   - C   - E   - g   - k   1 , 3 , $ $   - p   - t   $ < 
 
 . P R E C I O U S :   $ ( s r c ) / % . h a s h . c _ s h i p p e d 
 $ ( s r c ) / % . h a s h . c _ s h i p p e d :   $ ( s r c ) / % . g p e r f 
 	 $ ( c a l l   c m d , g p e r f ) 
 
 #   L E X 
 #   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 L E X _ P R E F I X   =   $ ( i f   $ ( L E X _ P R E F I X _ $ { b a s e p r e r e q } ) , $ ( L E X _ P R E F I X _ $ { b a s e p r e r e q } ) , y y ) 
 
 q u i e t _ c m d _ f l e x   =   L E X           $ @ 
             c m d _ f l e x   =   f l e x   - o $ @   - L   - P   $ ( L E X _ P R E F I X )   $ < 
 
 . P R E C I O U S :   $ ( s r c ) / % . l e x . c _ s h i p p e d 
 $ ( s r c ) / % . l e x . c _ s h i p p e d :   $ ( s r c ) / % . l 
 	 $ ( c a l l   c m d , f l e x ) 
 
 #   Y A C C 
 #   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 Y A C C _ P R E F I X   =   $ ( i f   $ ( Y A C C _ P R E F I X _ $ { b a s e p r e r e q } ) , $ ( Y A C C _ P R E F I X _ $ { b a s e p r e r e q } ) , y y ) 
 
 q u i e t _ c m d _ b i s o n   =   Y A C C         $ @ 
             c m d _ b i s o n   =   b i s o n   - o $ @   - t   - l   - p   $ ( Y A C C _ P R E F I X )   $ < 
 
 . P R E C I O U S :   $ ( s r c ) / % . t a b . c _ s h i p p e d 
 $ ( s r c ) / % . t a b . c _ s h i p p e d :   $ ( s r c ) / % . y 
 	 $ ( c a l l   c m d , b i s o n ) 
 
 q u i e t _ c m d _ b i s o n _ h   =   Y A C C         $ @ 
             c m d _ b i s o n _ h   =   b i s o n   - o / d e v / n u l l   - - d e f i n e s = $ @   - t   - l   - p   $ ( Y A C C _ P R E F I X )   $ < 
 
 . P R E C I O U S :   $ ( s r c ) / % . t a b . h _ s h i p p e d 
 $ ( s r c ) / % . t a b . h _ s h i p p e d :   $ ( s r c ) / % . y 
 	 $ ( c a l l   c m d , b i s o n _ h ) 
 
 e n d i f 
 
 #   S h i p p e d   f i l e s 
 #   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 q u i e t _ c m d _ s h i p p e d   =   S H I P P E D   $ @ 
 c m d _ s h i p p e d   =   c a t   $ <   >   $ @ 
 
 $ ( o b j ) / % :   $ ( s r c ) / % _ s h i p p e d 
 	 $ ( c a l l   c m d , s h i p p e d ) 
 
 #   C o m m a n d s   u s e f u l   f o r   b u i l d i n g   a   b o o t   i m a g e 
 #   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 #   
 # 	 U s e   a s   f o l l o w i n g : 
 # 
 # 	 t a r g e t :   s o u r c e ( s )   F O R C E 
 # 	 	 $ ( i f _ c h a n g e d , l d / o b j c o p y / g z i p ) 
 # 
 # 	 a n d   a d d   t a r g e t   t o   e x t r a - y   s o   t h a t   w e   k n o w   w e   h a v e   t o 
 # 	 r e a d   i n   t h e   s a v e d   c o m m a n d   l i n e 
 
 #   L i n k i n g 
 #   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 q u i e t _ c m d _ l d   =   L D             $ @ 
 c m d _ l d   =   $ ( L D )   $ ( L D F L A G S )   $ ( l d f l a g s - y )   $ ( L D F L A G S _ $ ( @ F ) )   \ 
 	               $ ( f i l t e r - o u t   F O R C E , $ ^ )   - o   $ @   
 
 #   O b j c o p y 
 #   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 q u i e t _ c m d _ o b j c o p y   =   O B J C O P Y   $ @ 
 c m d _ o b j c o p y   =   $ ( O B J C O P Y )   $ ( O B J C O P Y F L A G S )   $ ( O B J C O P Y F L A G S _ $ ( @ F ) )   $ <   $ @ 
 
 #   G z i p 
 #   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 q u i e t _ c m d _ g z i p   =   G Z I P         $ @ 
 c m d _ g z i p   =   ( c a t   $ ( f i l t e r - o u t   F O R C E , $ ^ )   |   g z i p   - n   - f   - 9   >   $ @ )   | |   \ 
 	 ( r m   - f   $ @   ;   f a l s e ) 
 
 #   D T C 
 #   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 #   G e n e r a t e   a n   a s s e m b l y   f i l e   t o   w r a p   t h e   o u t p u t   o f   t h e   d e v i c e   t r e e   c o m p i l e r 
 q u i e t _ c m d _ d t _ S _ d t b =   D T B         $ @ 
 c m d _ d t _ S _ d t b = 	 	 	 	 	 	 \ 
 ( 	 	 	 	 	 	 	 \ 
 	 e c h o   ' \ # i n c l u d e   < a s m - g e n e r i c / v m l i n u x . l d s . h > ' ;   	 \ 
 	 e c h o   ' . s e c t i o n   . d t b . i n i t . r o d a t a , " a " ' ; 	 	 \ 
 	 e c h o   ' . b a l i g n   S T R U C T _ A L I G N M E N T ' ; 	 	 \ 
 	 e c h o   ' . g l o b a l   _ _ d t b _ $ ( * F ) _ b e g i n ' ; 	 	 \ 
 	 e c h o   ' _ _ d t b _ $ ( * F ) _ b e g i n : ' ; 	 	 	 \ 
 	 e c h o   ' . i n c b i n   " $ < "   ' ; 	 	 	 	 \ 
 	 e c h o   ' _ _ d t b _ $ ( * F ) _ e n d : ' ; 	 	 	 \ 
 	 e c h o   ' . g l o b a l   _ _ d t b _ $ ( * F ) _ e n d ' ; 	 	 	 \ 
 	 e c h o   ' . b a l i g n   S T R U C T _ A L I G N M E N T ' ;   	 	 \ 
 )   >   $ @ 
 
 $ ( o b j ) / % . d t b . S :   $ ( o b j ) / % . d t b 
 	 $ ( c a l l   c m d , d t _ S _ d t b ) 
 
 q u i e t _ c m d _ d t c   =   D T C           $ @ 
 c m d _ d t c   =   $ ( o b j t r e e ) / s c r i p t s / d t c / d t c   - O   d t b   - o   $ @   - b   0   $ ( D T C _ F L A G S )   - d   $ ( d e p f i l e )   $ < 
 
 #   B z i p 2 
 #   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 #   B z i p 2   a n d   L Z M A   d o   n o t   i n c l u d e   s i z e   i n   f i l e . . .   s o   w e   h a v e   t o   f a k e   t h a t ; 
 #   a p p e n d   t h e   s i z e   a s   a   3 2 - b i t   l i t t l e e n d i a n   n u m b e r   a s   g z i p   d o e s . 
 s i z e _ a p p e n d   =   p r i n t f   $ ( s h e l l 	 	 	 	 	 	 \ 
 d e c _ s i z e = 0 ; 	 	 	 	 	 	 	 	 \ 
 f o r   F   i n   $ 1 ;   d o 	 	 	 	 	 	 	 	 \ 
 	 f s i z e = $ $ ( s t a t   - c   " % s "   $ $ F ) ; 	 	 	 	 	 \ 
 	 d e c _ s i z e = $ $ ( e x p r   $ $ d e c _ s i z e   +   $ $ f s i z e ) ; 	 	 	 	 \ 
 d o n e ; 	 	 	 	 	 	 	 	 	 \ 
 p r i n t f   " % 0 8 x \ n "   $ $ d e c _ s i z e   | 	 	 	 	 	 	 \ 
 	 s e d   ' s / \ ( . . \ ) / \ 1   / g '   |   { 	 	 	 	 	 \ 
 	 	 r e a d   c h 0   c h 1   c h 2   c h 3 ; 	 	 	 	 	 \ 
 	 	 f o r   c h   i n   $ $ c h 3   $ $ c h 2   $ $ c h 1   $ $ c h 0 ;   d o 	 	 	 \ 
 	 	 	 p r i n t f   ' % s % 0 3 o '   ' \ \ '   $ $ ( ( 0 x $ $ c h ) ) ;   	 	 \ 
 	 	 d o n e ; 	 	 	 	 	 	 	 \ 
 	 } 	 	 	 	 	 	 	 	 \ 
 ) 
 
 q u i e t _ c m d _ b z i p 2   =   B Z I P 2       $ @ 
 c m d _ b z i p 2   =   ( c a t   $ ( f i l t e r - o u t   F O R C E , $ ^ )   |   \ 
 	 b z i p 2   - 9   & &   $ ( c a l l   s i z e _ a p p e n d ,   $ ( f i l t e r - o u t   F O R C E , $ ^ ) ) )   >   $ @   | |   \ 
 	 ( r m   - f   $ @   ;   f a l s e ) 
 
 #   L z m a 
 #   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 q u i e t _ c m d _ l z m a   =   L Z M A         $ @ 
 c m d _ l z m a   =   ( c a t   $ ( f i l t e r - o u t   F O R C E , $ ^ )   |   \ 
 	 l z m a   - 9   & &   $ ( c a l l   s i z e _ a p p e n d ,   $ ( f i l t e r - o u t   F O R C E , $ ^ ) ) )   >   $ @   | |   \ 
 	 ( r m   - f   $ @   ;   f a l s e ) 
 
 q u i e t _ c m d _ l z o   =   L Z O           $ @ 
 c m d _ l z o   =   ( c a t   $ ( f i l t e r - o u t   F O R C E , $ ^ )   |   \ 
 	 l z o p   - 9   & &   $ ( c a l l   s i z e _ a p p e n d ,   $ ( f i l t e r - o u t   F O R C E , $ ^ ) ) )   >   $ @   | |   \ 
 	 ( r m   - f   $ @   ;   f a l s e ) 
 
 #   U - B o o t   m k i m a g e 
 #   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 M K I M A G E   : =   $ ( s r c t r e e ) / s c r i p t s / m k u b o o t . s h 
 
 #   S R C A R C H   j u s t   h a p p e n s   t o   m a t c h   s l i g h t l y   m o r e   t h a n   A R C H   ( o n   s p a r c ) ,   s o   r e d u c e s 
 #   t h e   n u m b e r   o f   o v e r r i d e s   i n   a r c h   m a k e f i l e s 
 U I M A G E _ A R C H   ? =   $ ( S R C A R C H ) 
 U I M A G E _ C O M P R E S S I O N   ? =   $ ( i f   $ ( 2 ) , $ ( 2 ) , n o n e ) 
 U I M A G E _ O P T S - y   ? = 
 U I M A G E _ T Y P E   ? =   k e r n e l 
 U I M A G E _ L O A D A D D R   ? =   a r c h _ m u s t _ s e t _ t h i s 
 U I M A G E _ E N T R Y A D D R   ? =   $ ( U I M A G E _ L O A D A D D R ) 
 U I M A G E _ N A M E   ? =   ' L i n u x - $ ( K E R N E L R E L E A S E ) ' 
 U I M A G E _ I N   ? =   $ < 
 U I M A G E _ O U T   ? =   $ @ 
 
 q u i e t _ c m d _ u i m a g e   =   U I M A G E     $ ( U I M A G E _ O U T ) 
             c m d _ u i m a g e   =   $ ( C O N F I G _ S H E L L )   $ ( M K I M A G E )   - A   $ ( U I M A G E _ A R C H )   - O   l i n u x   \ 
 	 	 	 - C   $ ( U I M A G E _ C O M P R E S S I O N )   $ ( U I M A G E _ O P T S - y )   \ 
 	 	 	 - T   $ ( U I M A G E _ T Y P E )   \ 
 	 	 	 - a   $ ( U I M A G E _ L O A D A D D R )   - e   $ ( U I M A G E _ E N T R Y A D D R )   \ 
 	 	 	 - n   $ ( U I M A G E _ N A M E )   - d   $ ( U I M A G E _ I N )   $ ( U I M A G E _ O U T ) 
 
 #   X Z 
 #   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 #   U s e   x z k e r n   t o   c o m p r e s s   t h e   k e r n e l   i m a g e   a n d   x z m i s c   t o   c o m p r e s s   o t h e r   t h i n g s . 
 # 
 #   x z k e r n   u s e s   a   b i g   L Z M A 2   d i c t i o n a r y   s i n c e   i t   d o e s n ' t   i n c r e a s e   m e m o r y   u s a g e 
 #   o f   t h e   k e r n e l   d e c o m p r e s s o r .   A   B C J   f i l t e r   i s   u s e d   i f   i t   i s   a v a i l a b l e   f o r 
 #   t h e   t a r g e t   a r c h i t e c t u r e .   x z k e r n   a l s o   a p p e n d s   u n c o m p r e s s e d   s i z e   o f   t h e   d a t a 
 #   u s i n g   s i z e _ a p p e n d .   T h e   . x z   f o r m a t   h a s   t h e   s i z e   i n f o r m a t i o n   a v a i l a b l e   a t 
 #   t h e   e n d   o f   t h e   f i l e   t o o ,   b u t   i t ' s   i n   m o r e   c o m p l e x   f o r m a t   a n d   i t ' s   g o o d   t o 
 #   a v o i d   c h a n g i n g   t h e   p a r t   o f   t h e   b o o t   c o d e   t h a t   r e a d s   t h e   u n c o m p r e s s e d   s i z e . 
 #   N o t e   t h a t   t h e   b y t e s   a d d e d   b y   s i z e _ a p p e n d   w i l l   m a k e   t h e   x z   t o o l   t h i n k   t h a t 
 #   t h e   f i l e   i s   c o r r u p t .   T h i s   i s   e x p e c t e d . 
 # 
 #   x z m i s c   d o e s n ' t   u s e   s i z e _ a p p e n d ,   s o   i t   c a n   b e   u s e d   t o   c r e a t e   n o r m a l   . x z 
 #   f i l e s .   x z m i s c   u s e s   s m a l l e r   L Z M A 2   d i c t i o n a r y   t h a n   x z k e r n ,   b e c a u s e   a   v e r y 
 #   b i g   d i c t i o n a r y   w o u l d   i n c r e a s e   t h e   m e m o r y   u s a g e   t o o   m u c h   i n   t h e   m u l t i - c a l l 
 #   d e c o m p r e s s i o n   m o d e .   A   B C J   f i l t e r   i s n ' t   u s e d   e i t h e r . 
 q u i e t _ c m d _ x z k e r n   =   X Z K E R N     $ @ 
 c m d _ x z k e r n   =   ( c a t   $ ( f i l t e r - o u t   F O R C E , $ ^ )   |   \ 
 	 s h   $ ( s r c t r e e ) / s c r i p t s / x z _ w r a p . s h   & &   \ 
 	 $ ( c a l l   s i z e _ a p p e n d ,   $ ( f i l t e r - o u t   F O R C E , $ ^ ) ) )   >   $ @   | |   \ 
 	 ( r m   - f   $ @   ;   f a l s e ) 
 
 q u i e t _ c m d _ x z m i s c   =   X Z M I S C     $ @ 
 c m d _ x z m i s c   =   ( c a t   $ ( f i l t e r - o u t   F O R C E , $ ^ )   |   \ 
 	 x z   - - c h e c k = c r c 3 2   - - l z m a 2 = d i c t = 1 M i B )   >   $ @   | |   \ 
 	 ( r m   - f   $ @   ;   f a l s e ) 
 
 #   m i s c   s t u f f 
 #   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 q u o t e : = " 
 
 
 i f d e f   h o s t - p r o g s 
 i f n e q   ( $ ( h o s t p r o g s - y ) , $ ( h o s t - p r o g s ) ) 
 $ ( w a r n i n g   k b u i l d :   $ ( o b j ) / M a k e f i l e   -   U s a g e   o f   h o s t - p r o g s   i s   d e p r e c a t e d .   P l e a s e   r e p l a c e   w i t h   h o s t p r o g s - y ! ) 
 h o s t p r o g s - y   + =   $ ( h o s t - p r o g s ) 
 e n d i f 
 e n d i f 
 
 #   D o   n o t   i n c l u d e   h o s t   r u l e s   u n l e s s   n e e d e d 
 i f n e q   ( $ ( h o s t p r o g s - y ) $ ( h o s t p r o g s - m ) , ) 
 i n c l u d e   s c r i p t s / M a k e f i l e . h o s t 
 e n d i f 
 
 i f n e q   ( $ ( K B U I L D _ S R C ) , ) 
 #   C r e a t e   o u t p u t   d i r e c t o r y   i f   n o t   a l r e a d y   p r e s e n t 
 _ d u m m y   : =   $ ( s h e l l   [   - d   $ ( o b j )   ]   | |   m k d i r   - p   $ ( o b j ) ) 
 
 #   C r e a t e   d i r e c t o r i e s   f o r   o b j e c t   f i l e s   i f   d i r e c t o r y   d o e s   n o t   e x i s t 
 #   N e e d e d   w h e n   o b j - y   : =   d i r / f i l e . o   s y n t a x   i s   u s e d 
 _ d u m m y   : =   $ ( f o r e a c h   d , $ ( o b j - d i r s ) ,   $ ( s h e l l   [   - d   $ ( d )   ]   | |   m k d i r   - p   $ ( d ) ) ) 
 e n d i f 
 
 i f n d e f   o b j 
 $ ( w a r n i n g   k b u i l d :   M a k e f i l e . b u i l d   i s   i n c l u d e d   i m p r o p e r l y ) 
 e n d i f 
 
 #   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 i f n e q   ( $ ( s t r i p   $ ( l i b - y )   $ ( l i b - m )   $ ( l i b - n )   $ ( l i b - ) ) , ) 
 l i b - t a r g e t   : =   $ ( o b j ) / l i b . a 
 e n d i f 
 
 i f n e q   ( $ ( s t r i p   $ ( o b j - y )   $ ( o b j - m )   $ ( o b j - n )   $ ( o b j - )   $ ( s u b d i r - m )   $ ( l i b - t a r g e t ) ) , ) 
 b u i l t i n - t a r g e t   : =   $ ( o b j ) / b u i l t - i n . o 
 e n d i f 
 
 m o d o r d e r - t a r g e t   : =   $ ( o b j ) / m o d u l e s . o r d e r 
 
 #   W e   k e e p   a   l i s t   o f   a l l   m o d u l e s   i n   $ ( M O D V E R D I R ) 
 
 _ _ b u i l d :   $ ( i f   $ ( K B U I L D _ B U I L T I N ) , $ ( b u i l t i n - t a r g e t )   $ ( l i b - t a r g e t )   $ ( e x t r a - y ) )   \ 
 	   $ ( i f   $ ( K B U I L D _ M O D U L E S ) , $ ( o b j - m )   $ ( m o d o r d e r - t a r g e t ) )   \ 
 	   $ ( s u b d i r - y m )   $ ( a l w a y s ) 
 	 @ : 
 
 #   L i n u s '   k e r n e l   s a n i t y   c h e c k i n g   t o o l 
 i f n e q   ( $ ( K B U I L D _ C H E C K S R C ) , 0 ) 
     i f e q   ( $ ( K B U I L D _ C H E C K S R C ) , 2 ) 
         q u i e t _ c m d _ f o r c e _ c h e c k s r c   =   C H E C K       $ < 
                     c m d _ f o r c e _ c h e c k s r c   =   $ ( C H E C K )   $ ( C H E C K F L A G S )   $ ( c _ f l a g s )   $ <   ; 
     e l s e 
             q u i e t _ c m d _ c h e c k s r c           =   C H E C K       $ < 
                         c m d _ c h e c k s r c           =   $ ( C H E C K )   $ ( C H E C K F L A G S )   $ ( c _ f l a g s )   $ <   ; 
     e n d i f 
 e n d i f 
 
 #   D o   s e c t i o n   m i s m a t c h   a n a l y s i s   f o r   e a c h   m o d u l e / b u i l t - i n . o 
 i f d e f   C O N F I G _ D E B U G _ S E C T I O N _ M I S M A T C H 
     c m d _ s e c a n a l y s i s   =   ;   s c r i p t s / m o d / m o d p o s t   $ @ 
 e n d i f 
 
 #   C o m p i l e   C   s o u r c e s   ( . c ) 
 #   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 #   D e f a u l t   i s   b u i l t - i n ,   u n l e s s   w e   k n o w   o t h e r w i s e 
 m o d k e r n _ c f l a g s   =                                                                                     \ 
 	 $ ( i f   $ ( p a r t - o f - m o d u l e ) ,                                                       \ 
 	 	 $ ( K B U I L D _ C F L A G S _ M O D U L E )   $ ( C F L A G S _ M O D U L E ) ,   \ 
 	 	 $ ( K B U I L D _ C F L A G S _ K E R N E L )   $ ( C F L A G S _ K E R N E L ) ) 
 q u i e t _ m o d t a g   : =   $ ( e m p t y )       $ ( e m p t y ) 
 
 $ ( r e a l - o b j s - m )                 :   p a r t - o f - m o d u l e   : =   y 
 $ ( r e a l - o b j s - m : . o = . i )     :   p a r t - o f - m o d u l e   : =   y 
 $ ( r e a l - o b j s - m : . o = . s )     :   p a r t - o f - m o d u l e   : =   y 
 $ ( r e a l - o b j s - m : . o = . l s t ) :   p a r t - o f - m o d u l e   : =   y 
 
 $ ( r e a l - o b j s - m )                 :   q u i e t _ m o d t a g   : =   [ M ] 
 $ ( r e a l - o b j s - m : . o = . i )     :   q u i e t _ m o d t a g   : =   [ M ] 
 $ ( r e a l - o b j s - m : . o = . s )     :   q u i e t _ m o d t a g   : =   [ M ] 
 $ ( r e a l - o b j s - m : . o = . l s t ) :   q u i e t _ m o d t a g   : =   [ M ] 
 
 $ ( o b j - m )                             :   q u i e t _ m o d t a g   : =   [ M ] 
 
 #   D e f a u l t   f o r   n o t   m u l t i - p a r t   m o d u l e s 
 m o d n a m e   =   $ ( b a s e t a r g e t ) 
 
 $ ( m u l t i - o b j s - m )                   :   m o d n a m e   =   $ ( m o d n a m e - m u l t i ) 
 $ ( m u l t i - o b j s - m : . o = . i )       :   m o d n a m e   =   $ ( m o d n a m e - m u l t i ) 
 $ ( m u l t i - o b j s - m : . o = . s )       :   m o d n a m e   =   $ ( m o d n a m e - m u l t i ) 
 $ ( m u l t i - o b j s - m : . o = . l s t )   :   m o d n a m e   =   $ ( m o d n a m e - m u l t i ) 
 $ ( m u l t i - o b j s - y )                   :   m o d n a m e   =   $ ( m o d n a m e - m u l t i ) 
 $ ( m u l t i - o b j s - y : . o = . i )       :   m o d n a m e   =   $ ( m o d n a m e - m u l t i ) 
 $ ( m u l t i - o b j s - y : . o = . s )       :   m o d n a m e   =   $ ( m o d n a m e - m u l t i ) 
 $ ( m u l t i - o b j s - y : . o = . l s t )   :   m o d n a m e   =   $ ( m o d n a m e - m u l t i ) 
 
 q u i e t _ c m d _ c c _ s _ c   =   C C   $ ( q u i e t _ m o d t a g )     $ @ 
 c m d _ c c _ s _ c               =   $ ( C C )   $ ( c _ f l a g s )   - f v e r b o s e - a s m   - S   - o   $ @   $ < 
 
 $ ( o b j ) / % . s :   $ ( s r c ) / % . c   F O R C E 
 	 $ ( c a l l   i f _ c h a n g e d _ d e p , c c _ s _ c ) 
 
 q u i e t _ c m d _ c c _ i _ c   =   C P P   $ ( q u i e t _ m o d t a g )   $ @ 
 c m d _ c c _ i _ c               =   $ ( C P P )   $ ( c _ f l a g s )       - o   $ @   $ < 
 
 $ ( o b j ) / % . i :   $ ( s r c ) / % . c   F O R C E 
 	 $ ( c a l l   i f _ c h a n g e d _ d e p , c c _ i _ c ) 
 
 c m d _ g e n s y m t y p e s   =                                                                                                                       \ 
         $ ( C P P )   - D _ _ G E N K S Y M S _ _   $ ( c _ f l a g s )   $ <   |                                                                       \ 
         $ ( G E N K S Y M S )   $ ( i f   $ ( 1 ) ,   - T   $ ( 2 ) )   - a   $ ( A R C H )                                                             \ 
           $ ( i f   $ ( K B U I L D _ P R E S E R V E ) , - p )                                                                                         \ 
           - r   $ ( f i r s t w o r d   $ ( w i l d c a r d   $ ( 2 : . s y m t y p e s = . s y m r e f )   / d e v / n u l l ) ) 
 
 q u i e t _ c m d _ c c _ s y m t y p e s _ c   =   S Y M   $ ( q u i e t _ m o d t a g )   $ @ 
 c m d _ c c _ s y m t y p e s _ c   =                                                                                                                   \ 
         s e t   - e ;                                                                                                                                   \ 
         $ ( c a l l   c m d _ g e n s y m t y p e s , t r u e , $ @ )   > / d e v / n u l l ;                                                           \ 
         t e s t   - s   $ @   | |   r m   - f   $ @ 
 
 $ ( o b j ) / % . s y m t y p e s   :   $ ( s r c ) / % . c   F O R C E 
 	 $ ( c a l l   c m d , c c _ s y m t y p e s _ c ) 
 
 #   C   ( . c )   f i l e s 
 #   T h e   C   f i l e   i s   c o m p i l e d   a n d   u p d a t e d   d e p e n d e n c y   i n f o r m a t i o n   i s   g e n e r a t e d . 
 #   ( S e e   c m d _ c c _ o _ c   +   r e l e v a n t   p a r t   o f   r u l e _ c c _ o _ c ) 
 
 q u i e t _ c m d _ c c _ o _ c   =   C C   $ ( q u i e t _ m o d t a g )     $ @ 
 
 i f n d e f   C O N F I G _ M O D V E R S I O N S 
 c m d _ c c _ o _ c   =   $ ( C C )   $ ( c _ f l a g s )   - c   - o   $ @   $ < 
 
 e l s e 
 #   W h e n   m o d u l e   v e r s i o n i n g   i s   e n a b l e d   t h e   f o l l o w i n g   s t e p s   a r e   e x e c u t e d : 
 #   o   c o m p i l e   a   . t m p _ < f i l e > . o   f r o m   < f i l e > . c 
 #   o   i f   . t m p _ < f i l e > . o   d o e s n ' t   c o n t a i n   a   _ _ k s y m t a b   v e r s i o n ,   i . e .   d o e s 
 #       n o t   e x p o r t   s y m b o l s ,   w e   j u s t   r e n a m e   . t m p _ < f i l e > . o   t o   < f i l e > . o   a n d 
 #       a r e   d o n e . 
 #   o   o t h e r w i s e ,   w e   c a l c u l a t e   s y m b o l   v e r s i o n s   u s i n g   t h e   g o o d   o l d 
 #       g e n k s y m s   o n   t h e   p r e p r o c e s s e d   s o u r c e   a n d   p o s t p r o c e s s   t h e m   i n   a   w a y 
 #       t h a t   t h e y   a r e   u s a b l e   a s   a   l i n k e r   s c r i p t 
 #   o   g e n e r a t e   < f i l e > . o   f r o m   . t m p _ < f i l e > . o   u s i n g   t h e   l i n k e r   t o 
 #       r e p l a c e   t h e   u n r e s o l v e d   s y m b o l s   _ _ c r c _ e x p o r t e d _ s y m b o l   w i t h 
 #       t h e   a c t u a l   v a l u e   o f   t h e   c h e c k s u m   g e n e r a t e d   b y   g e n k s y m s 
 
 c m d _ c c _ o _ c   =   $ ( C C )   $ ( c _ f l a g s )   - c   - o   $ ( @ D ) / . t m p _ $ ( @ F )   $ < 
 c m d _ m o d v e r s i o n s   = 	 	 	 	 	 	 	 	 \ 
 	 i f   $ ( O B J D U M P )   - h   $ ( @ D ) / . t m p _ $ ( @ F )   |   g r e p   - q   _ _ k s y m t a b ;   t h e n 	 	 \ 
 	 	 $ ( c a l l   c m d _ g e n s y m t y p e s , $ ( K B U I L D _ S Y M T Y P E S ) , $ ( @ : . o = . s y m t y p e s ) ) 	 \ 
 	 	         >   $ ( @ D ) / . t m p _ $ ( @ F : . o = . v e r ) ; 	 	 	 	 	 \ 
 	 	 	 	 	 	 	 	 	 	 \ 
 	 	 $ ( L D )   $ ( L D F L A G S )   - r   - o   $ @   $ ( @ D ) / . t m p _ $ ( @ F )   	 	 	 \ 
 	 	 	 - T   $ ( @ D ) / . t m p _ $ ( @ F : . o = . v e r ) ; 	 	 	 	 \ 
 	 	 r m   - f   $ ( @ D ) / . t m p _ $ ( @ F )   $ ( @ D ) / . t m p _ $ ( @ F : . o = . v e r ) ; 	 	 \ 
 	 e l s e 	 	 	 	 	 	 	 	 	 \ 
 	 	 m v   - f   $ ( @ D ) / . t m p _ $ ( @ F )   $ @ ; 	 	 	 	 	 \ 
 	 f i ; 
 e n d i f 
 
 i f d e f   C O N F I G _ F T R A C E _ M C O U N T _ R E C O R D 
 i f d e f   B U I L D _ C _ R E C O R D M C O U N T 
 i f e q   ( " $ ( o r i g i n   R E C O R D M C O U N T _ W A R N ) " ,   " c o m m a n d   l i n e " ) 
     R E C O R D M C O U N T _ F L A G S   =   - w 
 e n d i f 
 #   D u e   t o   r e c u r s i o n ,   w e   m u s t   s k i p   e m p t y . o . 
 #   T h e   e m p t y . o   f i l e   i s   c r e a t e d   i n   t h e   m a k e   p r o c e s s   i n   o r d e r   t o   d e t e r m i n e 
 #     t h e   t a r g e t   e n d i a n n e s s   a n d   w o r d   s i z e .   I t   i s   m a d e   b e f o r e   a l l   o t h e r   C 
 #     f i l e s ,   i n c l u d i n g   r e c o r d m c o u n t . 
 s u b _ c m d _ r e c o r d _ m c o u n t   = 	 	 	 	 	 \ 
 	 i f   [   $ ( @ )   ! =   " s c r i p t s / m o d / e m p t y . o "   ] ;   t h e n 	 \ 
 	 	 $ ( o b j t r e e ) / s c r i p t s / r e c o r d m c o u n t   $ ( R E C O R D M C O U N T _ F L A G S )   " $ ( @ ) " ; 	 \ 
 	 f i ; 
 r e c o r d m c o u n t _ s o u r c e   : =   $ ( s r c t r e e ) / s c r i p t s / r e c o r d m c o u n t . c   \ 
 	 	         $ ( s r c t r e e ) / s c r i p t s / r e c o r d m c o u n t . h 
 e l s e 
 s u b _ c m d _ r e c o r d _ m c o u n t   =   s e t   - e   ;   p e r l   $ ( s r c t r e e ) / s c r i p t s / r e c o r d m c o u n t . p l   " $ ( A R C H ) "   \ 
 	 " $ ( i f   $ ( C O N F I G _ C P U _ B I G _ E N D I A N ) , b i g , l i t t l e ) "   \ 
 	 " $ ( i f   $ ( C O N F I G _ 6 4 B I T ) , 6 4 , 3 2 ) "   \ 
 	 " $ ( O B J D U M P ) "   " $ ( O B J C O P Y ) "   " $ ( C C )   $ ( K B U I L D _ C F L A G S ) "   \ 
 	 " $ ( L D ) "   " $ ( N M ) "   " $ ( R M ) "   " $ ( M V ) "   \ 
 	 " $ ( i f   $ ( p a r t - o f - m o d u l e ) , 1 , 0 ) "   " $ ( @ ) " ; 
 r e c o r d m c o u n t _ s o u r c e   : =   $ ( s r c t r e e ) / s c r i p t s / r e c o r d m c o u n t . p l 
 e n d i f 
 c m d _ r e c o r d _ m c o u n t   =   	 	 	 	 	 	 \ 
 	 i f   [   " $ ( f i n d s t r i n g   - p g , $ ( _ c _ f l a g s ) ) "   =   " - p g "   ] ;   t h e n 	 \ 
 	 	 $ ( s u b _ c m d _ r e c o r d _ m c o u n t ) 	 	 	 \ 
 	 f i ; 
 e n d i f 
 
 d e f i n e   r u l e _ c c _ o _ c 
 	 $ ( c a l l   e c h o - c m d , c h e c k s r c )   $ ( c m d _ c h e c k s r c ) 	 	 	     \ 
 	 $ ( c a l l   e c h o - c m d , c c _ o _ c )   $ ( c m d _ c c _ o _ c ) ; 	 	 	 	     \ 
 	 $ ( c m d _ m o d v e r s i o n s ) 	 	 	 	 	 	     \ 
 	 $ ( c a l l   e c h o - c m d , r e c o r d _ m c o u n t ) 	 	 	 	 	     \ 
 	 $ ( c m d _ r e c o r d _ m c o u n t ) 	 	 	 	 	 	     \ 
 	 s c r i p t s / b a s i c / f i x d e p   $ ( d e p f i l e )   $ @   ' $ ( c a l l   m a k e - c m d , c c _ o _ c ) '   >         \ 
 	                                                                                             $ ( d o t - t a r g e t ) . t m p ;     \ 
 	 r m   - f   $ ( d e p f i l e ) ; 	 	 	 	 	 	     \ 
 	 m v   - f   $ ( d o t - t a r g e t ) . t m p   $ ( d o t - t a r g e t ) . c m d 
 e n d e f 
 
 #   B u i l t - i n   a n d   c o m p o s i t e   m o d u l e   p a r t s 
 $ ( o b j ) / % . o :   $ ( s r c ) / % . c   $ ( r e c o r d m c o u n t _ s o u r c e )   F O R C E 
 	 $ ( c a l l   c m d , f o r c e _ c h e c k s r c ) 
 	 $ ( c a l l   i f _ c h a n g e d _ r u l e , c c _ o _ c ) 
 
 #   S i n g l e - p a r t   m o d u l e s   a r e   s p e c i a l   s i n c e   w e   n e e d   t o   m a r k   t h e m   i n   $ ( M O D V E R D I R ) 
 
 $ ( s i n g l e - u s e d - m ) :   $ ( o b j ) / % . o :   $ ( s r c ) / % . c   $ ( r e c o r d m c o u n t _ s o u r c e )   F O R C E 
 	 $ ( c a l l   c m d , f o r c e _ c h e c k s r c ) 
 	 $ ( c a l l   i f _ c h a n g e d _ r u l e , c c _ o _ c ) 
 	 @ {   e c h o   $ ( @ : . o = . k o ) ;   e c h o   $ @ ;   }   >   $ ( M O D V E R D I R ) / $ ( @ F : . o = . m o d ) 
 
 q u i e t _ c m d _ c c _ l s t _ c   =   M K L S T       $ @ 
             c m d _ c c _ l s t _ c   =   $ ( C C )   $ ( c _ f l a g s )   - g   - c   - o   $ * . o   $ <   & &   \ 
 	 	           $ ( C O N F I G _ S H E L L )   $ ( s r c t r e e ) / s c r i p t s / m a k e l s t   $ * . o   \ 
 	 	 	 	           S y s t e m . m a p   $ ( O B J D U M P )   >   $ @ 
 
 $ ( o b j ) / % . l s t :   $ ( s r c ) / % . c   F O R C E 
 	 $ ( c a l l   i f _ c h a n g e d _ d e p , c c _ l s t _ c ) 
 
 #   C o m p i l e   a s s e m b l e r   s o u r c e s   ( . S ) 
 #   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 m o d k e r n _ a f l a g s   : =   $ ( K B U I L D _ A F L A G S _ K E R N E L )   $ ( A F L A G S _ K E R N E L ) 
 
 $ ( r e a l - o b j s - m )             :   m o d k e r n _ a f l a g s   : =   $ ( K B U I L D _ A F L A G S _ M O D U L E )   $ ( A F L A G S _ M O D U L E ) 
 $ ( r e a l - o b j s - m : . o = . s ) :   m o d k e r n _ a f l a g s   : =   $ ( K B U I L D _ A F L A G S _ M O D U L E )   $ ( A F L A G S _ M O D U L E ) 
 
 q u i e t _ c m d _ a s _ s _ S   =   C P P   $ ( q u i e t _ m o d t a g )   $ @ 
 c m d _ a s _ s _ S               =   $ ( C P P )   $ ( a _ f l a g s )       - o   $ @   $ <   
 
 $ ( o b j ) / % . s :   $ ( s r c ) / % . S   F O R C E 
 	 $ ( c a l l   i f _ c h a n g e d _ d e p , a s _ s _ S ) 
 
 q u i e t _ c m d _ a s _ o _ S   =   A S   $ ( q u i e t _ m o d t a g )     $ @ 
 c m d _ a s _ o _ S               =   $ ( C C )   $ ( a _ f l a g s )   - c   - o   $ @   $ < 
 
 $ ( o b j ) / % . o :   $ ( s r c ) / % . S   F O R C E 
 	 $ ( c a l l   i f _ c h a n g e d _ d e p , a s _ o _ S ) 
 
 t a r g e t s   + =   $ ( r e a l - o b j s - y )   $ ( r e a l - o b j s - m )   $ ( l i b - y ) 
 t a r g e t s   + =   $ ( e x t r a - y )   $ ( M A K E C M D G O A L S )   $ ( a l w a y s ) 
 
 #   L i n k e r   s c r i p t s   p r e p r o c e s s o r   ( . l d s . S   - >   . l d s ) 
 #   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 q u i e t _ c m d _ c p p _ l d s _ S   =   L D S           $ @ 
             c m d _ c p p _ l d s _ S   =   $ ( C P P )   $ ( c p p _ f l a g s )   - P   - C   - U $ ( A R C H )   \ 
 	                                           - D _ _ A S S E M B L Y _ _   - D L I N K E R _ S C R I P T   - o   $ @   $ < 
 
 $ ( o b j ) / % . l d s :   $ ( s r c ) / % . l d s . S   F O R C E 
 	 $ ( c a l l   i f _ c h a n g e d _ d e p , c p p _ l d s _ S ) 
 
 #   B u i l d   t h e   c o m p i l e d - i n   t a r g e t s 
 #   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 #   T o   b u i l d   o b j e c t s   i n   s u b d i r s ,   w e   n e e d   t o   d e s c e n d   i n t o   t h e   d i r e c t o r i e s 
 $ ( s o r t   $ ( s u b d i r - o b j - y ) ) :   $ ( s u b d i r - y m )   ; 
 
 # 
 #   R u l e   t o   c o m p i l e   a   s e t   o f   . o   f i l e s   i n t o   o n e   . o   f i l e 
 # 
 i f d e f   b u i l t i n - t a r g e t 
 q u i e t _ c m d _ l i n k _ o _ t a r g e t   =   L D             $ @ 
 #   I f   t h e   l i s t   o f   o b j e c t s   t o   l i n k   i s   e m p t y ,   j u s t   c r e a t e   a n   e m p t y   b u i l t - i n . o 
 c m d _ l i n k _ o _ t a r g e t   =   $ ( i f   $ ( s t r i p   $ ( o b j - y ) ) , \ 
 	 	             $ ( L D )   $ ( l d _ f l a g s )   - r   - o   $ @   $ ( f i l t e r   $ ( o b j - y ) ,   $ ^ )   \ 
 	 	             $ ( c m d _ s e c a n a l y s i s ) , \ 
 	 	             r m   - f   $ @ ;   $ ( A R )   r c s $ ( K B U I L D _ A R F L A G S )   $ @ ) 
 
 $ ( b u i l t i n - t a r g e t ) :   $ ( o b j - y )   F O R C E 
 	 $ ( c a l l   i f _ c h a n g e d , l i n k _ o _ t a r g e t ) 
 
 t a r g e t s   + =   $ ( b u i l t i n - t a r g e t ) 
 e n d i f   #   b u i l t i n - t a r g e t 
 
 # 
 #   R u l e   t o   c r e a t e   m o d u l e s . o r d e r   f i l e 
 # 
 #   C r e a t e   c o m m a n d s   t o   e i t h e r   r e c o r d   . k o   f i l e   o r   c a t   m o d u l e s . o r d e r   f r o m 
 #   a   s u b d i r e c t o r y 
 m o d o r d e r - c m d s   = 	 	 	 	 	 	 \ 
 	 $ ( f o r e a c h   m ,   $ ( m o d o r d e r ) , 	 	 	 \ 
 	 	 $ ( i f   $ ( f i l t e r   % / m o d u l e s . o r d e r ,   $ m ) , 	 \ 
 	 	 	 c a t   $ m ; ,   e c h o   k e r n e l / $ m ; ) ) 
 
 $ ( m o d o r d e r - t a r g e t ) :   $ ( s u b d i r - y m )   F O R C E 
 	 $ ( Q ) ( c a t   / d e v / n u l l ;   $ ( m o d o r d e r - c m d s ) )   >   $ @ 
 
 # 
 #   R u l e   t o   c o m p i l e   a   s e t   o f   . o   f i l e s   i n t o   o n e   . a   f i l e 
 # 
 i f d e f   l i b - t a r g e t 
 q u i e t _ c m d _ l i n k _ l _ t a r g e t   =   A R             $ @ 
 c m d _ l i n k _ l _ t a r g e t   =   r m   - f   $ @ ;   $ ( A R )   r c s $ ( K B U I L D _ A R F L A G S )   $ @   $ ( l i b - y ) 
 
 $ ( l i b - t a r g e t ) :   $ ( l i b - y )   F O R C E 
 	 $ ( c a l l   i f _ c h a n g e d , l i n k _ l _ t a r g e t ) 
 
 t a r g e t s   + =   $ ( l i b - t a r g e t ) 
 e n d i f 
 
 # 
 #   R u l e   t o   l i n k   c o m p o s i t e   o b j e c t s 
 # 
 #     C o m p o s i t e   o b j e c t s   a r e   s p e c i f i e d   i n   k b u i l d   m a k e f i l e   a s   f o l l o w s : 
 #         < c o m p o s i t e - o b j e c t > - o b j s   : =   < l i s t   o f   . o   f i l e s > 
 #     o r 
 #         < c o m p o s i t e - o b j e c t > - y         : =   < l i s t   o f   . o   f i l e s > 
 l i n k _ m u l t i _ d e p s   =                                           \ 
 $ ( f i l t e r   $ ( a d d p r e f i x   $ ( o b j ) / ,                   \ 
 $ ( $ ( s u b s t   $ ( o b j ) / , , $ ( @ : . o = - o b j s ) ) )         \ 
 $ ( $ ( s u b s t   $ ( o b j ) / , , $ ( @ : . o = - y ) ) ) ) ,   $ ^ ) 
   
 q u i e t _ c m d _ l i n k _ m u l t i - y   =   L D             $ @ 
 c m d _ l i n k _ m u l t i - y   =   $ ( L D )   $ ( l d _ f l a g s )   - r   - o   $ @   $ ( l i n k _ m u l t i _ d e p s )   $ ( c m d _ s e c a n a l y s i s ) 
 
 q u i e t _ c m d _ l i n k _ m u l t i - m   =   L D   [ M ]     $ @ 
 c m d _ l i n k _ m u l t i - m   =   $ ( c m d _ l i n k _ m u l t i - y ) 
 
 #   W e   w o u l d   r a t h e r   h a v e   a   l i s t   o f   r u l e s   l i k e 
 #   	 f o o . o :   $ ( f o o - o b j s ) 
 #   b u t   t h a t ' s   n o t   s o   e a s y ,   s o   w e   r a t h e r   m a k e   a l l   c o m p o s i t e   o b j e c t s   d e p e n d 
 #   o n   t h e   s e t   o f   a l l   t h e i r   p a r t s 
 $ ( m u l t i - u s e d - y )   :   % . o :   $ ( m u l t i - o b j s - y )   F O R C E 
 	 $ ( c a l l   i f _ c h a n g e d , l i n k _ m u l t i - y ) 
 
 $ ( m u l t i - u s e d - m )   :   % . o :   $ ( m u l t i - o b j s - m )   F O R C E 
 	 $ ( c a l l   i f _ c h a n g e d , l i n k _ m u l t i - m ) 
 	 @ {   e c h o   $ ( @ : . o = . k o ) ;   e c h o   $ ( l i n k _ m u l t i _ d e p s ) ;   }   >   $ ( M O D V E R D I R ) / $ ( @ F : . o = . m o d ) 
 
 t a r g e t s   + =   $ ( m u l t i - u s e d - y )   $ ( m u l t i - u s e d - m ) 
 
 
 #   D e s c e n d i n g 
 #   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 P H O N Y   + =   $ ( s u b d i r - y m ) 
 $ ( s u b d i r - y m ) : 
 	 $ ( Q ) $ ( M A K E )   $ ( b u i l d ) = $ @ 
 
 #   A d d   F O R C E   t o   t h e   p r e q u i s i t e s   o f   a   t a r g e t   t o   f o r c e   i t   t o   b e   a l w a y s   r e b u i l t . 
 #   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 P H O N Y   + =   F O R C E 
 
 F O R C E : 
 
 #   R e a d   a l l   s a v e d   c o m m a n d   l i n e s   a n d   d e p e n d e n c i e s   f o r   t h e   $ ( t a r g e t s )   w e 
 #   m a y   b e   b u i l d i n g   a b o v e ,   u s i n g   $ ( i f _ c h a n g e d { , _ d e p } ) .   A s   a n 
 #   o p t i m i z a t i o n ,   w e   d o n ' t   n e e d   t o   r e a d   t h e m   i f   t h e   t a r g e t   d o e s   n o t 
 #   e x i s t ,   w e   w i l l   r e b u i l d   a n y w a y   i n   t h a t   c a s e . 
 
 t a r g e t s   : =   $ ( w i l d c a r d   $ ( s o r t   $ ( t a r g e t s ) ) ) 
 c m d _ f i l e s   : =   $ ( w i l d c a r d   $ ( f o r e a c h   f , $ ( t a r g e t s ) , $ ( d i r   $ ( f ) ) . $ ( n o t d i r   $ ( f ) ) . c m d ) ) 
 
 i f n e q   ( $ ( c m d _ f i l e s ) , ) 
     i n c l u d e   $ ( c m d _ f i l e s ) 
 e n d i f 
 
 #   D e c l a r e   t h e   c o n t e n t s   o f   t h e   . P H O N Y   v a r i a b l e   a s   p h o n y .     W e   k e e p   t h a t 
 #   i n f o r m a t i o n   i n   a   v a r i a b l e   s e   w e   c a n   u s e   i t   i n   i f _ c h a n g e d   a n d   f r i e n d s . 
 
 . P H O N Y :   $ ( P H O N Y ) 
 