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
62 # Special targets defined in this file:
64 # all - parent of first, shell, files, lib, exe
65 # first - first dependent of 'all', for potential initialization
66 # shell - parent of all Shell targets
67 # files - parent of all File targets
68 # lib - parent of all Library targets
69 # exe - parent of all Main targets
70 # dirs - parent of all MkDir targets
71 # clean - removes all Shell, File, Library, and Main targets
72 # uninstall - removes all Install targets
75 # Rules defined by this file:
77 # as obj.o : source.s ; .s -> .o
78 # Bulk dir : files ; populate directory with many files
79 # Cc obj.o : source.c ; .c -> .o
80 # C++ obj.o : source.cc ; .cc -> .o
81 # Clean clean : sources ; remove sources with 'jam clean'
82 # File dest : source ; copy file
83 # GenFile source.c : program args ; make custom file
84 # HardLink target : source ; make link from source to target
85 # HdrRule source : headers ; handle #includes
86 # InstallInto dir : sources ; install any files
87 # InstallBin dir : sources ; install binaries
88 # InstallLib dir : sources ; install files
89 # InstallFile dir : sources ; install files
90 # InstallMan dir : sources ; install man pages
91 # InstallShell dir : sources ; install shell scripts
92 # Lex source.c : source.l ; .l -> .c
93 # Library lib : source ; archive library from compiled sources
94 # LibraryFromObjects lib : objects ; archive library from objects
95 # LinkLibraries images : libraries ; bag libraries onto Mains
96 # Main image : source ; link executable from compiled sources
97 # C++Main image : source ; link c++ executable from compiled sources
98 # ObjC-Main image : source ; link obj-c executable from compiled sources
99 # MainFromObjects image : objects ; link executable from objects
100 # C++MainFromObjects image : objects ; link c++ executable from objects
101 # ObjC-MainFromObjects image : objects ; link obj-c executable from objects
102 # MkDir dir ; make a directory, if not there
103 # Object object : source ; compile object from source
104 # ObjectCcFlags source : flags ; add compiler flags for object
105 # ObjectC++Flags source : flags ; add compiler flags for object
106 # ObjectObjCFlags source : flags ; add compiler flags for object
107 # ObjectHdrs source : dirs ; add include directories for object
108 # Objects sources ; compile sources
109 # RmTemps target : sources ; remove temp sources after target made
110 # Setuid images ; mark executables Setuid
111 # SoftLink target : source ; make symlink from source to target
112 # SubDir TOP d1 d2 ... ; start a subdirectory Jamfile
113 # SubDirCcFlags flags ; add compiler flags until next SubDir
114 # SubDirC++Flags flags ; add compiler flags until next SubDir
115 # SubDirHdrs d1 d2 ... ; add include dir until next SubDir
116 # SubInclude TOP d1 d2 ... ; include a subdirectory Jamfile
117 # Shell exe : source ; make a shell executable
118 # Undefines images : symbols ; save undef's for linking
119 # UserObject object : source ; handle unknown suffixes for Object
120 # Yacc source.c : source.y ; .y -> .c
122 # Utility rules that have no side effects (not supported):
124 # FAppendSuffix f1 f2 ... : $(SUF) ; return $(<) with suffixes
125 # FDirName d1 d2 ... ; return path from root to dir
126 # FGrist d1 d2 ... ; return d1!d2!...
127 # FGristFiles value ; return $(value:G=$(SOURCE_GRIST))
128 # FGristSourceFiles value ; return $(value:G=$(SOURCE_GRIST))
129 # FStripCommon v1 : v2 ; strip common initial parts of v1 v2
130 # FReverse a1 a2 ... ; return ... a2 a1
131 # FRelPath d1 : d2 ; return rel path from d1 to d2
132 # FSubDir d1 d2 ... ; return path to root
136 # Brief review of the jam language:
139 # rule RULE - statements to process a rule
140 # actions RULE - system commands to carry out target update
142 # Modifiers on actions:
143 # together - multiple instances of same rule on target get executed
144 # once with their sources ($(>)) concatenated
145 # updated - refers to updated sources ($(>)) only
146 # ignore - ignore return status of command
147 # quietly - don't trace its execution unless verbose
148 # piecemeal - iterate command each time with a small subset of $(>)
149 # existing - refers to currently existing sources ($(>)) only
150 # bind vars - subject to binding before expanding in actions
153 # Always - always build a target
154 # Depends - builds the dependency graph
155 # Echo - blurt out targets on stdout
156 # Exit - blurt out targets and exit
157 # Includes - marks sources as headers for target (a codependency)
158 # NoCare - don't panic if the target can't be built
159 # NoUpdate - create the target if needed but never update it
160 # NotFile - ignore the timestamp of the target (it's not a file)
161 # Temporary - target need not be present if sources haven't changed
163 # Special variables set by jam:
164 # $(<) - targets of a rule (to the left of the :)
165 # $(>) - sources of a rule (to the right of the :)
166 # $(xxx) - true on xxx (UNIX, VMS, NT, OS2, MAC)
167 # $(OS) - name of OS - varies wildly
168 # $(JAMVERSION) - version number (2.5)
170 # Special variables used by jam:
171 # SEARCH - where to find something (used during binding and actions)
172 # LOCATE - where to plop something not found with SEARCH
173 # HDRRULE - rule to call to handle include files
174 # HDRSCAN - egrep regex to extract include files
177 # all - default if none given on command line
180 THIS_IS_K8JAM = "tan" ; # we are using k8jam
183 . Jambase.modes # modes for `profile`
184 . Jambase.vars # default vars -- compiler and linker name, etc
185 . Jambase.deps # default targets and dependencies
187 . Jambase.misc # miscelaneous helpers
189 . Jambase.subdir # SubDir, SubInclude, etc
190 . Jambase.object # `Object` rule and company
191 . Jambase.build # build rules for various languages
192 . Jambase.link # link rules for various languages
193 . Jambase.main # link rules for various languages
194 . Jambase.clean # `clean` target
196 . Jambase.install # install targets (incomplete)
198 . Jambase.profile # `profile` and `set-profile`
199 . Jambase.locs # `set-target-locations`
201 . Jambase.pkgcfg # lib-config and pkg-config
203 . Jambase.gnustep # some utilities for GNUStep
205 . Jambase.fix # various native specifics
207 . Jambase.windoze # cross-compiling specifics
209 . Jambase.userext # user extension rules
210 . Jambase.help # 'help*' targets
211 . Jambase.push # 'push' target
212 . Jambase.boiler # 'gen-boiler' code
215 check-setup-windoze ;
218 # Now include the user's Jamfile.