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.
12 # note that we use the target directory 'bin.unix' to ensure that
13 # 'make install' and 'make uninstall' work correctly
16 if ! $(LOCATE_TARGET) { LOCATE_TARGET = bin.unix/obj ; }
17 LOCATE_BIN ?= bin.unix ;
19 if ! $(LOCATE_TARGET) { LOCATE_TARGET = bin.$(OSFULL[1]:L)$(PATH_SEPARATOR)obj ; }
20 LOCATE_TARGET ?= bin.$(OSFULL[1]:L) ;
23 # Leave generated source in current directory; it would be nice to use
24 # these lines below to build the source into the platform-specific
25 # directory, but getting scan.c to include the right jambase.h is
26 # hard: with ""'s, it always gets the bootstrap version; with <>'s,
27 # it won't find the bootstrap version.
29 # SEARCH_SOURCE ?= $(LOCATE_TARGET) $(DOT) ;
30 # LOCATE_SOURCE ?= $(LOCATE_TARGET) ;
33 # We have some different files for UNIX, VMS, and NT.
37 # For some really stupid reason, classic Jam doesn't define NT
38 # when compiling with Mingw, but the variable MINGW instead..
41 if ! $(NT) && $(MINGW) {
46 if $(NT) || $(WINE_MINGW) { code = execunix.c filent.c pathunix.c ; }
47 else { code = execunix.c fileunix.c pathunix.c ; }
49 if $(UNIX) && $(OS) = CYGWIN {
50 CCFLAGS += -D__cygwin__ ;
54 # For jam profiling/debugging.
58 LOCATE_TARGET = $(LOCATE_TARGET)/pg ;
64 LOCATE_TARGET = $(LOCATE_TARGET)/g ;
67 # We have to signal jam.h for these
70 switch $(JAM_TOOLSET) {
71 case MINGW : CCFLAGS += -DNT ;
72 case LCC : CCFLAGS += -DNT ;
73 case DIGITALMARS : CCFLAGS += -DNT ;
74 case * : CCFLAGS += /DNT ;
80 if $(YACC) { code += jamgram.y ; }
81 else { code += jamgram.c ; }
85 # Build the jamgram.y from the jamgram.yy
86 # yyacc is a slippery script that makes grammars a little
87 # easier to read/maintain.
89 if $(YACC) && $(SUFEXE) = "" {
90 GenFile jamgram.y jamgramtab.h : ./yyacc jamgram.yy ;
95 # How to build the compiled in jambase.
97 Main mkjambase : mkjambase.c ;
101 # The guts of the Jamfile: how to build Jam
103 Main jam : jam.c jambase.c ;
104 LinkLibraries jam : libjam.a ;
105 GenFile jambase.c : mkjambase Jambase ;
118 # Strip the Jam executable on Mingw
120 if $(JAM_TOOLSET) = MINGW {
129 builtins.c command.c compile.c $(code) expand.c
130 glob.c hash.c headers.c lists.c make.c make1.c
131 newstr.c option.c parse.c regexp.c rules.c scan.c
132 search.c timestamp.c variable.c
133 hdrmacro.c kstrings.c
144 ObjectNoAliasing $(aliasbreaks) ;
146 ObjectCcFlags $(aliasbreaks) : -fno-strict-aliasing ;