2 # Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc.
3 # Copyright 2009-2012 Ketmar // Vampire Avalon
5 # This file is part of Jam - see jam.c for Copyright information.
9 # JAMBASE - k8jam 2.x ruleset providing make(1)-like functionality
11 # Supports UNIX, NT and maybe other things
13 # 12/27/93 (seiwald) - purturb library sources with SOURCE_GRIST
14 # 04/18/94 (seiwald) - use '?=' when setting OS specific vars
15 # 04/21/94 (seiwald) - do RmTemps together
16 # 05/05/94 (seiwald) - all supported C compilers support -o: relegate RELOCATE as an option;
17 # set Ranlib to "" to disable it
18 # 06/01/94 (seiwald) - new 'actions existing' to do existing sources
19 # 08/25/94 (seiwald) - new ObjectCcFlags rule to append to per-target CCFLAGS
20 # 08/29/94 (seiwald) - new ObjectHdrs rule to append to per-target HDRS
21 # 09/19/94 (seiwald) - LinkLibraries and Undefs now append
22 # - Rule names downshifted.
23 # 10/06/94 (seiwald) - Dumb yyacc stuff moved into Jamfile.
24 # 10/14/94 (seiwald) - (Crude) support for .s, .C, .cc, .cpp, and .f files.
25 # 01/08/95 (seiwald) - Shell now handled with awk, not sed
26 # 01/09/95 (seiwald) - Install* now take dest directory as target
27 # 01/10/95 (seiwald) - All entries sorted.
28 # 01/10/95 (seiwald) - NT support moved in, with LauraW's help.
29 # 01/10/95 (seiwald) - VMS support moved in.
30 # 02/06/95 (seiwald) - ObjectC++Flags and SubDirC++Flags added.
31 # 02/07/95 (seiwald) - Iron out when HDRSEARCH uses "" or SEARCH_SOURCE.
32 # 02/08/95 (seiwald) - SubDir works on VMS.
33 # 02/14/95 (seiwald) - MkDir and entourage.
34 # 04/30/95 (seiwald) - Use install -c flag so that it copies, not moves.
35 # 07/10/95 (taylor) - Support for Microsoft C++.
36 # 11/21/96 (peterk) - Support for BeOS
37 # 07/19/99 (sickel) - Support for Mac OS X Server (and maybe client)
38 # 02/18/00 (belmonte)- Support for Cygwin.
41 # [*] windoze support shortened (fuck it! %-)
42 # [-] OS/2 support removed (we'll cry for you...)
43 # [-] VMS support removed (nobody cares)
44 # [-] MAC support removed (should be rewritten!)
45 # [-] BEOS support removed (dead should be dead)
46 # [-] fortran support removed (who need that shit anyway?!)
47 # [+] C++ files will be compiled by g++, not gcc
48 # [+] MainC++ & MainC++FromObjects rules added (g++ linker instead of gcc)
49 # [+] LINKC++, LINKC++FLAGS, LINKC++LIBS, C++OPTIM variables added
50 # [+] LOCATE_BIN variable added (for Main rule)
51 # [+] PATH_SEPARATOR variable added
52 # [+] LOCATE_LIB and LOCATE_LIBSO variables added
53 # [+] xxxC++ renamed to C++xxx
54 # [+] SubIncludeOnce varname : TOP ... ;
55 # [-] xxxC++ rules removed (no need to keep obsolete crap)
56 # [-] aliases for compatibility with jam 2.2 removed
57 # [-] comented out all libtool crap
58 # [+] added rules: LinkFlagsOn, C++LinkFlagsOn, ObjCLinkFlagsOn
59 # [+] added rule: gcc-suggest-attrs
60 # [.] tired of writing this log
61 # [+] CC.standard, C++.standard
63 # Special targets defined in this file:
65 # all - parent of first, shell, files, lib, exe
66 # first - first dependent of 'all', for potential initialization
67 # shell - parent of all Shell targets
68 # files - parent of all File targets
69 # lib - parent of all Library targets
70 # exe - parent of all Main targets
71 # dirs - parent of all MkDir targets
72 # clean - removes all Shell, File, Library, and Main targets
73 # uninstall - removes all Install targets
76 # Rules defined by this file:
78 # as obj.o : source.s ; .s -> .o
79 # Bulk dir : files ; populate directory with many files
80 # Cc obj.o : source.c ; .c -> .o
81 # C++ obj.o : source.cc ; .cc -> .o
82 # Clean clean : sources ; remove sources with 'jam clean'
83 # File dest : source ; copy file
84 # GenFile source.c : program args ; make custom file
85 # HardLink target : source ; make link from source to target
86 # HdrRule source : headers ; handle #includes
87 # InstallInto dir : sources ; install any files
88 # InstallBin dir : sources ; install binaries
89 # InstallLib dir : sources ; install files
90 # InstallFile dir : sources ; install files
91 # InstallMan dir : sources ; install man pages
92 # InstallShell dir : sources ; install shell scripts
93 # Lex source.c : source.l ; .l -> .c
94 # Library lib : source ; archive library from compiled sources
95 # LibraryFromObjects lib : objects ; archive library from objects
96 # LinkLibraries images : libraries ; bag libraries onto Mains
97 # Main image : source ; link executable from compiled sources
98 # C++Main image : source ; link c++ executable from compiled sources
99 # ObjC-Main image : source ; link obj-c executable from compiled sources
100 # MainFromObjects image : objects ; link executable from objects
101 # C++MainFromObjects image : objects ; link c++ executable from objects
102 # ObjC-MainFromObjects image : objects ; link obj-c executable from objects
103 # MkDir dir ; make a directory, if not there
104 # Object object : source ; compile object from source
105 # ObjectCcFlags source : flags ; add compiler flags for object
106 # ObjectC++Flags source : flags ; add compiler flags for object
107 # ObjectObjCFlags source : flags ; add compiler flags for object
108 # ObjectHdrs source : dirs ; add include directories for object
109 # Objects sources targets exename ; compile sources
110 # RmTemps target : sources ; remove temp sources after target made
111 # Setuid images ; mark executables Setuid
112 # SoftLink target : source ; make symlink from source to target
113 # SubDir TOP d1 d2 ... ; start a subdirectory Jamfile
114 # SubDirCcFlags flags ; add compiler flags until next SubDir
115 # SubDirC++Flags flags ; add compiler flags until next SubDir
116 # SubDirHdrs d1 d2 ... ; add include dir until next SubDir
117 # SubInclude TOP d1 d2 ... ; include a subdirectory Jamfile
118 # Shell exe : source ; make a shell executable
119 # Undefines images : symbols ; save undef's for linking
120 # UserObject object : source ; handle unknown suffixes for Object
121 # Yacc source.c : source.y ; .y -> .c
123 # Utility rules that have no side effects (not supported):
125 # FAppendSuffix f1 f2 ... : $(SUF) ; return $(<) with suffixes
126 # FDirName d1 d2 ... ; return path from root to dir
127 # FGrist d1 d2 ... ; return d1!d2!...
128 # FGristFiles value ; return $(value:G=$(SOURCE_GRIST))
129 # FGristSourceFiles value ; return $(value:G=$(SOURCE_GRIST))
130 # FStripCommon v1 : v2 ; strip common initial parts of v1 v2
131 # FReverse a1 a2 ... ; return ... a2 a1
132 # FRelPath d1 : d2 ; return rel path from d1 to d2
133 # FSubDir d1 d2 ... ; return path to root
137 # Brief review of the jam language:
140 # rule RULE - statements to process a rule
141 # actions RULE - system commands to carry out target update
143 # Modifiers on actions:
144 # together - multiple instances of same rule on target get executed
145 # once with their sources ($(>)) concatenated
146 # updated - refers to updated sources ($(>)) only
147 # ignore - ignore return status of command
148 # quietly - don't trace its execution unless verbose
149 # piecemeal - iterate command each time with a small subset of $(>)
150 # existing - refers to currently existing sources ($(>)) only
151 # bind vars - subject to binding before expanding in actions
154 # Always - always build a target
155 # Depends - builds the dependency graph
156 # Echo - blurt out targets on stdout
157 # Exit - blurt out targets and exit
158 # Includes - marks sources as headers for target (a codependency)
159 # NoCare - don't panic if the target can't be built
160 # NoUpdate - create the target if needed but never update it
161 # NotFile - ignore the timestamp of the target (it's not a file)
162 # Temporary - target need not be present if sources haven't changed
164 # Special variables set by jam:
165 # $(<) - targets of a rule (to the left of the :)
166 # $(>) - sources of a rule (to the right of the :)
167 # $(xxx) - true on xxx (UNIX, VMS, NT, OS2, MAC)
168 # $(OS) - name of OS - varies wildly
169 # $(K8_JAMVERSION) - version number (2.5.xx)
171 # Special variables used by jam:
172 # SEARCH - where to find something (used during binding and actions)
173 # LOCATE - where to plop something not found with SEARCH
174 # HDRRULE - rule to call to handle include files
175 # HDRSCAN - egrep regex to extract include files
178 # all - default if none given on command line
181 THIS_IS_K8JAM = "tan" ; # we are using k8jam
185 . Jambase.vars # default vars -- compiler and linker name, etc
186 . Jambase.deps # default targets and dependencies
188 . Jambase.misc # miscelaneous helpers
190 . Jambase.subdir # SubDir, SubInclude, etc
191 . Jambase.object # `Object` rule and company
192 . Jambase.build # build rules for various languages
193 . Jambase.link # link rules for various languages
194 . Jambase.main # link rules for various languages
195 . Jambase.clean # `clean` target
197 . Jambase.install # install targets (incomplete)
199 . Jambase.profile # `profile` and `set-profile`
200 . Jambase.locs # `set-target-locations`
202 . Jambase.pkgcfg # lib-config and pkg-config
204 . Jambase.gnustep # some utilities for GNUStep
206 . Jambase.fix # various native specifics
208 . Jambase.windoze # cross-compiling specifics
210 . Jambase.userext # user extension rules
211 . Jambase.help # 'help*' targets
212 . Jambase.push # 'push' target
213 . Jambase.boiler # 'gen-boiler' code
215 . configure/Jambase.configure
218 check-setup-windoze ;
221 # Now include the user's Jamfile.
223 if "gen-boiler" in $(JAM_TARGETS) {
224 Echo "skipping $(JAMFILE)" ;