# # Jamfile to build Jam (a make(1)-like program) # # There are no user-serviceable parts in this file. # # Put executables in platform-specific subdirectory. if $(VMS) { LOCATE_TARGET ?= [.binvms] ; } else if $(MAC) { LOCATE_TARGET ?= :bin.mac ; } else { LOCATE_TARGET ?= bin.$(OSFULL[1]:L) ; } if $(BUILD_J) { LOCATE_TARGET = j$(LOCATE_TARGET) ; } # Leave generated source in current directory; it would be nice to use # these lines below to build the source into the platform-specific # directory, but getting scan.c to include the right jambase.h is # hard: with ""'s, it always gets the bootstrap version; with <>'s, # it won't find the bootstrap version. # SEARCH_SOURCE ?= $(LOCATE_TARGET) $(DOT) ; # LOCATE_SOURCE ?= $(LOCATE_TARGET) ; # # We have some different files for UNIX, VMS, and NT. # if $(NT) { code = execunix.c filent.c pathunix.c ; } else if $(MINGW) { code = execunix.c filent.c pathunix.c ; } else if $(OS2) { code = execunix.c fileos2.c pathunix.c ; } else if $(VMS) { code = execvms.c filevms.c pathvms.c ; } else if $(MAC) { code = execmac.c filemac.c pathmac.c ; } else { code = execunix.c fileunix.c pathunix.c ; } # For jam profiling/debugging. if $(PROFILE) { CCFLAGS += -pg ; LINKFLAGS += -pg ; LOCATE_TARGET = $(LOCATE_TARGET)/pg ; } if $(DEBUG) { if ! $(OS) = NT { CCFLAGS += -g ; LINKFLAGS += -g ; } LOCATE_TARGET = $(LOCATE_TARGET)-g ; OPTIM = ; } # We have to signal jam.h for these if $(OS) = NT { CCFLAGS += /DNT ; } # Do we know yacc? if $(YACC) { code += jamgram.y ; } else { code += jamgram.c ; } ### LOCAL CHANGE # # The default NT CCFLAGS build jam with nothing but /DNT. # We want to optimize it as well. # if $(BUILD_J) { # Improvements grabbed from //guest/craig_mcpheeters/jam/src/ on the # Perforce public depot. LOCAL_DEFINES += OPT_HEADER_CACHE_EXT ; LOCAL_DEFINES += OPT_IMPROVED_WARNINGS_EXT ; # Bug Fixes LOCAL_DEFINES += OPT_FIX_TEMPFILE_CRASH ; LOCAL_DEFINES += OPT_FIX_NOTFILE_NEWESTFIRST ; # Improvements developed locally. LOCAL_DEFINES += OPT_PIECEMEAL_PUNT_EXT ; # Improvements LOCAL_DEFINES += OPT_IMPROVED_PATIENCE_EXT ; LOCAL_DEFINES += OPT_IMPROVED_PROGRESS_EXT ; LOCAL_DEFINES += OPT_PRINT_TOTAL_TIME_EXT ; LOCAL_DEFINES += OPT_IMPROVE_DEBUG_LEVEL_HELP_EXT ; LOCAL_DEFINES += OPT_IMPROVE_DEBUG_COMPILE_EXT ; LOCAL_DEFINES += OPT_IMPROVE_TEMP_FILE_DELETE_EXT ; # Features LOCAL_DEFINES += OPT_PATCHED_VERSION_VAR_EXT ; LOCAL_DEFINES += OPT_HDRRULE_BOUNDNAME_ARG_EXT ; LOCAL_DEFINES += OPT_BUILTIN_PWD_EXT ; LOCAL_DEFINES += OPT_VAR_CWD_EXT ; LOCAL_DEFINES += OPT_RESPONSE_FILES ; if $(OS) = NT { LOCAL_DEFINES += OPT_BUILTIN_W32_GETREG_EXT ; LOCAL_DEFINES += OPT_BUILTIN_W32_SHORTNAME_EXT ; } LOCAL_DEFINES += OPT_EXPAND_RULE_NAMES_EXT ; if $(OS) = NT { CCFLAGS += /nologo /W3 ; CCFLAGS += /DNT ; #CCFLAGS += /D_CONSOLE /D_MBCS ; DEBUG default = no ; if $(DEBUG) { CCFLAGS += /Zi /MLd /Od ; LINKFLAGS += /DEBUG ; } else { CCFLAGS += /ZI /ML /O2 ; } LINKFLAGS += /nologo /subsystem:console /machine:I386 ; LINKLIBS = kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ; DEFINEFLAG ?= /D ; } else if $(UNIX) { CC = gcc ; if ! $(DEBUG) { OPTIM = -O3 -fomit-frame-pointer -fstrength-reduce ; } DEFINEFLAG ?= -D ; } else { EXIT "Not configured for non-UNIX non-Windows targets" ; } CCFLAGS += $(DEFINEFLAG)$(LOCAL_DEFINES) ; CCFLAGS += $(DEFINEFLAG)YYSTACKSIZE=5000 ; } if $(UNIX) && $(PURE) { LOCATE_TARGET = $(LOCATE_TARGET)/pure ; CCFLAGS += $(DEFINEFLAG)PURE ; LINK = /usr/local/bin/purify cc ; } # ### LOCAL CHANGE # # Build the jamgram.y from the jamgram.yy # yyacc is a slippery script that makes grammars a little # easier to read/maintain. # if $(YACC) && $(SUFEXE) = "" { GenFile jamgram.y jamgramtab.h : yyacc jamgram.yy ; } ### LOCAL CHANGE # # These files contain locally developed improvements. # if $(BUILD_J) { code += pwd.c w32_getreg.c w32_shortname.c ; # code primarily not written locally, but grabbed from the net code += hcache.c tmpunix.c ; } # ### LOCAL CHANGE # # How to build the compiled in jambase. # Main mkjambase : mkjambase.c ; if $(VMS) { CC = cxx ; LINK = cxxlink ; CCFLAGS += /define=VMS ; } # # The guts of the Jamfile: how to build Jam # if $(BUILD_J) { Main j : jam.c jambase-j.c ; LinkLibraries j : libjam.a ; GenFile jambase-j.c : mkjambase Jambase-j ; } else { Main jam : jam.c jambase.c ; LinkLibraries jam : libjam.a ; GenFile jambase.c : mkjambase Jambase ; } Library libjam.a : builtins.c command.c compile.c $(code) expand.c glob.c hash.c headers.c lists.c make.c make1.c newstr.c option.c parse.c regexp.c rules.c scan.c search.c timestamp.c variable.c ; if $(BINDIR) { InstallBin $(BINDIR) : jam ; } # # Distribution making from here on out. # ALLSOURCE = Build.com Build.mpw Jam.html Jambase Jambase.html Jamfile Jamfile.html Makefile Porting README RELNOTES builtins.c builtins.h command.c command.h compile.c compile.h execcmd.h execmac.c execunix.c execvms.c expand.c expand.h filemac.c filent.c fileos2.c filesys.h fileunix.c filevms.c glob.c hash.c hash.h headers.c headers.h jam.c jam.h jambase.c jambase.h jamgram.c jamgram.h jamgram.y jamgram.yy jamgramtab.h lists.c lists.h make.c make.h make1.c mkjambase.c newstr.c newstr.h option.c option.h parse.c parse.h patchlevel.h pathmac.c pathsys.h pathunix.c pathvms.c regexp.c regexp.h rules.c rules.h scan.c scan.h search.c search.h timestamp.c timestamp.h variable.c variable.h yyacc ; ### LOCAL CHANGE # ALLSOURCE += LOCAL_DIFFERENCES.txt ; # ### LOCAL CHANGE rule Ball { NotFile balls ; Depends balls : $(<) ; DEPENDS $(<) : $(>) ; switch $(<) { case *.tar : Tar $(<) : $(>) ; case *.shar : Shar $(<) : $(>) ; case *.zip : Zip $(<) : $(>) ; } } VERSION = jam-2.5rc1 ; actions Tar { ln -s . $(VERSION) tar cvhf $(<) $(VERSION)/$(>) rm $(VERSION) } actions Shar { shar $(>) > $(<) } actions Zip { zip $(<) $(>) } Ball $(VERSION).shar : $(ALLSOURCE) ; Ball $(VERSION).tar : $(ALLSOURCE) ; Ball $(VERSION).zip : $(ALLSOURCE) ;