# No user-serviceable parts below this line. And none above it either ;) JAMSETTINGS = Jamsettings ; include $(JAMSETTINGS:D=$(TOP)) ; VERSION = 3.2.0 ; MKDIR = mkdir -p ; USECACHE = 1 ; if $(OPTIM) = "-O" { OPTIM = "-O3" ; } OPTIM ?= ; RANLIB = ; USE_X86_ASM = ; if ( $(JAMUNAME[1]) = "i686" || $(JAMUNAME[1]) = "i586" ) { USE_X86_ASM = 1 ; } if $(ICC) { C++ = icc ; C++FLAGS += -wd1476 -wd654 -wd913 -wd873 -wd1125 ; BUILD = build/icc ; LINKFLAGS += -lcxa -lunwind ; } else if $(CLANG_NOT) { C++ = clang ; LINK = clang ; C++FLAGS += -Wno-invalid-source-encoding -Wno-string-plus-int ; BUILD = build/clang ; LINKFLAGS += -lstdc++ ; } else { C++ = g++ ; C++FLAGS += -W -Wall ; BUILD = build/gcc ; if $(OPTIM) { BUILD = build/gcc$(OPTIM) ; } if $(COV) { C++FLAGS += -fprofile-arcs -ftest-coverage ; BUILD = build/gcov ; } if $(CCACHE) { C++ = ccache g++ ; } } LINK = $(C++) ; rule SubInclude { if ! $($(<[1])) { Exit SubInclude $(<[1]) without prior SubDir $(<[1]) ; } local _tokens = $(SUBDIR_TOKENS) ; SubDir $(<) ; local a b ; for a in $(IncludedDirectories) { if $(a) = $(SUBDIR) { b = true ; } } if ! $(b) { IncludedDirectories += $(SUBDIR) ; include $(JAMFILE:D=$(SUBDIR)) ; } SubDir TOP $(_tokens) ; } rule Build { LOCATE_TARGET = [ FDirName $(TOP) $(BUILD) $(SUBDIR_TOKENS) ] ; Objects $(>) ; set-$(<) += [ FGristFiles $(>:S=$(SUFOBJ)) ] ; sets += $(<) ; } rule UseLibrary { LINKLIBS on [ FGristFiles $(<:S=$(SUFOBJ)) ] += -l$(>) ; } rule Executable { local target a ; Depends exe : $(<) ; Depends $(<) : $(set-$(>)) ; MakeLocate $(<) : [ FDirName $(TOP) bin ] ; Clean clean : $(<) ; Link $(<) : $(set-$(>)) ; for a in $(set-$(>)) { on $(a) LINKLIBS on $(<) += $(LINKLIBS) ; } } rule Program { Executable $(<) : $(>) ; InstallBin $(INSTALLROOT)$(BINDIR) : $(<) ; } rule Server { Executable $(<) : $(>) ; InstallBin $(INSTALLROOT)$(SBINDIR) : $(<) ; } actions EngraveConfig { sed -e 's!$BINDIR!'$(BINDIR)'!' \ -e 's!$SBINDIR!'$(SBINDIR)'!' \ -e 's!$MANDIR!'$(MANDIR)'!' \ -e 's!$LIBDIR!'$(LIBDIR)'!' \ -e 's!$INITDIR!'$(INITDIR)'!' \ -e 's!$PIDFILEDIR!'$(PIDFILEDIR)'!' \ -e 's!$JAILDIR!'$(JAILDIR)'!' \ -e 's!$MESSAGEDIR!'$(MESSAGEDIR)'!' \ -e 's!$CONFIGDIR!'$(CONFIGDIR)'!' \ -e 's!$LOGFILEMODE!'$(LOGFILEMODE)'!' \ -e 's!$LOGFILE!'$(LOGFILE)'!' \ -e 's!$DBNAME!'$(DBNAME)'!' \ -e 's!$DBSCHEMA!'$(DBSCHEMA)'!' \ -e 's!$DBOWNER!'$(DBOWNER)'!' \ -e 's!$DBADDRESS!'$(DBADDRESS)'!' \ -e 's!$AOXUSER!'$(AOXUSER)'!' \ -e 's!$AOXGROUP!'$(AOXGROUP)'!' \ -e 's!$VERSION!'$(VERSION)'!' \ -e 's!$PREFIX!'$(PREFIX)'!' \ < $(>) > $(<) } rule Doc { UDOCBIN = udoc ; Depends $(<) : $(UDOCBIN) $(set-$(>)) ; NOTFILE $(<) ; Doc2 $(<) : $(set-$(>):S=.cpp) ; documented-sets += $(>) ; Depends doc : $(<) ; Clean clean : $(output) ; RemoveDirectories clean ; } actions together RemoveDirectories { rm -rf $(TOP)/doc/man/man3 $(TOP)/$(BUILD) find $(TOP)/doc/html -name udoc.css -prune -o -type f -exec rm {} \; } actions together Doc2 bind UDOCBIN { mkdir -p doc/man/man3 doc/html build/doc $(UDOCBIN) -o 'The Archiveopteryx Developers' -m doc/man/man3 -w doc/html $(>) } # If you need to do horrid or perverse things that shouldn't be # version-controlled, you can create a file called Jamhacks and do # them there. JAMHACKS = Jamhacks ; NOCARE $(JAMHACKS:D=$(TOP)) ; include $(JAMHACKS:D=$(TOP)) ;