small irrelevant typo
[k8jam.git] / Jamfile
blob48af18b73534792d86ce5680b70d37303c88392a
2 # Jamfile to build Jam (a make(1)-like program)
4 # There are no user-serviceable parts in this file.
6 # Put executables in platform-specific  subdirectory.
7 VERSION = k8jam-2.5.5 ;
9 if $(THIS_IS_K8JAM) {
10   Echo "K8Jam detected" ;
11   #profile "standard" ;
12   profile "size" ;
13 } else {
14   OPTIM = -O2 -s ;
15   LINKFLAGS = -s ;
17 if ! "-Wall" in $(OPTIM) { OPTIM += -Wall ; }
20 if ! $(PREFIX) { PREFIX = /usr/local ; }
23 # note that we use the target directory 'bin.unix' to ensure that
24 # 'make install' and 'make uninstall' work correctly
26 if $(UNIX) {
27   if ! $(LOCATE_TARGET) { LOCATE_TARGET = bin.unix/obj ; }
28   LOCATE_BIN ?= bin.unix ;
29 } else {
30   if ! $(LOCATE_TARGET) { LOCATE_TARGET = bin.$(OSFULL[1]:L)$(PATH_SEPARATOR)obj ; }
31   LOCATE_TARGET ?= bin.$(OSFULL[1]:L) ;
34 # Leave generated source in current directory; it would be nice to use
35 # these lines below to build the source into the platform-specific
36 # directory, but getting scan.c to include the right jambase.h is
37 # hard: with ""'s, it always gets the bootstrap version; with <>'s,
38 # it won't find the bootstrap version.
40 # SEARCH_SOURCE ?= $(LOCATE_TARGET) $(DOT) ;
41 # LOCATE_SOURCE ?= $(LOCATE_TARGET) ;
44 # We have some different files for UNIX, VMS, and NT.
48 # For some really stupid reason, classic Jam doesn't define NT
49 # when compiling with Mingw, but the variable MINGW instead..
52 if ! $(NT) && $(MINGW) {
53   NT = 1 ;
54   JAM_TOOLSET = MINGW ;
57 if $(NT) || $(WINE_MINGW) { code = execunix.c filent.c pathunix.c ; }
58 else { code = execunix.c fileunix.c pathunix.c ; }
60 if $(UNIX) && $(OS) = CYGWIN {
61   CCFLAGS += -D__cygwin__ ;
65 # For jam profiling/debugging.
66 if $(PROFILE) {
67   CCFLAGS += -pg ;
68   LINKFLAGS += -pg ;
69   LOCATE_TARGET = $(LOCATE_TARGET)/pg ;
72 if $(DEBUG) {
73   CCFLAGS += -g ;
74   LINKFLAGS += -g ;
75   LOCATE_TARGET = $(LOCATE_TARGET)/g ;
78 # We have to signal jam.h for these
80 if $(OS) = NT {
81   switch $(JAM_TOOLSET) {
82     case MINGW       : CCFLAGS += -DNT ;
83     case LCC         : CCFLAGS += -DNT ;
84     case DIGITALMARS : CCFLAGS += -DNT ;
85     case *           : CCFLAGS += /DNT ;
86   }
90 # Do we know yacc?
91 if $(YACC) { code += jamgram.y ; }
92 else { code += jamgram.c ; }
96 # Build the jamgram.y from the jamgram.yy
97 # yyacc is a slippery script that makes grammars a little
98 # easier to read/maintain.
100 if $(YACC) && $(SUFEXE) = "" {
101   GenFile jamgram.y jamgramtab.h : ./yyacc jamgram.yy ;
106 # How to build the compiled in jambase.
108 Main mkjambase : mkjambase.c ;
112 # The guts of the Jamfile: how to build Jam
114 Main jam : jam.c jambase.c ;
115 LinkLibraries jam : libjam.a ;
116 GenFile jambase.c : mkjambase Jambase ;
119 if $(UNIX) {
120   actions Strip {
121     strip -s $(1)
122   }
124   Strip mkjambase ;
125   Strip jam ;
129 # Strip the Jam executable on Mingw
131 if $(JAM_TOOLSET) = MINGW {
132   actions  Strip {
133     strip $(1)
134   }
135   Strip  jam$(SUFEXE) ;
139 Library libjam.a :
140   builtins.c command.c compile.c $(code) expand.c
141   glob.c hash.c headers.c lists.c make.c make1.c
142   newstr.c option.c parse.c regexp.c rules.c scan.c
143   search.c timestamp.c variable.c
144   hdrmacro.c kstrings.c
146 aliasbreaks =
147   #newstr.c
148   #rules.c
149   #timestamp.c
150   #variable.c
151   #hdrmacro.c
154 if $(THIS_IS_K8JAM) {
155   ObjectNoAliasing $(aliasbreaks) ;
156 } else {
157   ObjectCcFlags $(aliasbreaks) : -fno-strict-aliasing ;
161 # installing
162 if $(UNIX) {
163   if $(DESTDIR) { INSTALLDIR_PREFIX = $(DESTDIR)$(PREFIX) ; } else { INSTALLDIR_PREFIX = $(PREFIX) ; }
165   INSTALLDIR_BIN = $(INSTALLDIR_PREFIX)/bin ;
166   INSTALLDIR_MAN = $(INSTALLDIR_PREFIX)/man ;
167   INSTALLDIR_DOCS = $(INSTALLDIR_PREFIX)/share/doc/$(VERSION) ;
169   InstallBin $(INSTALLDIR_BIN) : jam$(SUFEXE) ;
170   #InstallBin $(INSTALLDIR_BIN) : mkjambase$(SUFEXE) ;
171   SubDir TOP ;
172   SubInclude TOP doc ;