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 ;
10 Echo "K8Jam detected" ;
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
27 if ! $(LOCATE_TARGET) { LOCATE_TARGET = bin.unix/obj ; }
28 LOCATE_BIN ?= bin.unix ;
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) {
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.
69 LOCATE_TARGET = $(LOCATE_TARGET)/pg ;
75 LOCATE_TARGET = $(LOCATE_TARGET)/g ;
78 # We have to signal jam.h for these
81 switch $(JAM_TOOLSET) {
82 case MINGW : CCFLAGS += -DNT ;
83 case LCC : CCFLAGS += -DNT ;
84 case DIGITALMARS : CCFLAGS += -DNT ;
85 case * : CCFLAGS += /DNT ;
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 ;
129 # Strip the Jam executable on Mingw
131 if $(JAM_TOOLSET) = MINGW {
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
154 if $(THIS_IS_K8JAM) {
155 ObjectNoAliasing $(aliasbreaks) ;
157 ObjectCcFlags $(aliasbreaks) : -fno-strict-aliasing ;
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) ;