import common ; using doxygen ; import doxygen ; import feature ; import os ; import path ; using testing ; # Calculate install path from PREFIX environment variable or use default local prefix-from-environ = [ os.environ PREFIX ] ; if ( $(prefix-from-environ) ) { if ( [ path.is-rooted $(prefix-from-environ) ] ) { path-constant PREFIX : $(prefix-from-environ) ; } else { path-constant PREFIX : $(TOP)/$(prefix-from-environ) ; } } else { path-constant PREFIX : $(TOP)/../dist ; } TARGET_INPUTS = $(TOP)/../Boost//boost-date_time-dll $(TOP)/../Boost//boost-filesystem-dll $(TOP)/../Boost//boost-regex-dll $(TOP)/../Boost//boost-system-dll $(TOP)/../Boost//boost-thread-dll $(TOP)/../fost-base/Cpp/fost-core//fost-core ; TARGET_REQUIREMENTS = darwin:$(TOP)/../fost-base/External//openssl iphone:$(TOP)/../OpenSSL//crypto iphone:$(TOP)/../OpenSSL//ssl linux:$(TOP)/../fost-base/External//openssl windows:$(TOP)/../fost-base/External//ole windows:$(TOP)/../OpenSSL//libeay32-dll windows:$(TOP)/../OpenSSL//ssleay32-dll gcc:-fdiagnostics-show-option gcc:-fno-strict-aliasing ; rule fost-project ( name : requirements * ) { project : requirements $(requirements) Cpp/include ../fost-base/Cpp/include $(BOOST_HEADERS) iphone:../OpenSSL/install/include/ windows:../OpenSSL/install/include/ BOOST_VERSION_MAJOR=$(BOOST_VERSION_MAJOR) BOOST_VERSION_MINOR=$(BOOST_VERSION_MINOR) multi shared debug:DEBUG debug:_DEBUG debug-mfc:DEBUG debug-mfc:_DEBUG release:NDEBUG release-mfc:NDEBUG darwin:FOST_OS_OSX linux:FOST_OS_LINUX windows:FOST_OS_WINDOWS windows:UNICODE windows:_UNICODE windows:on windows:on windows:off : : build-dir $(BUILD_DIRECTORY) ; } rule fost-install-to-directory ( lib-dir : exe-dir : sources + ) { for local source in $(sources) { install $(source)-lib : $(source) : $(lib-dir) $(lib-dir) linux:LIB darwin:LIB windows:XXX ; install $(source)-loc : $(source) : $(exe-dir) $(lib-dir) EXE windows:LIB ; } } rule fost-install-loc ( loc : sources + ) { fost-install-to-directory $(loc)/lib : $(loc)/bin : $(sources) ; } rule fost-install ( sources + ) { fost-install-loc $(PREFIX) : $(sources) ; } rule fost-py-install ( pyd : location ) { install $(location) : $(pyd) : $(PREFIX)/lib/python/site-packages/$(location) ; } rule fost-smoke-test ( name : libs * : files * ) { if ( $(files) ) { local unit-test-name = $(name) "-unit-test" ; unit-test $(unit-test-name:J) : $(TARGET_INPUTS) $(TOP)/../fost-base/Cpp/fost-cli//fost-cli $(TOP)/../fost-base/Cpp/fost-test $(TOP)/../fost-base/Cpp/fost-test/boost-build-unit-test.cpp $(libs) $(files) : $(TARGET_REQUIREMENTS) ; } } rule run-py-test ( test-name : sources + ) { import testing ; testing.make-test run-pyd : $(sources) : : $(test-name) ; } rule fost-tag-output ( name : type ? : properties * ) { if $(type) in OBJ { # Don't do anything for OBJ files } else if $(type) in EXE { if [ $(properties).get ] in debug debug-mfc { if [ $(properties).get ] in windows { local n = $(name) "-gd.exe" ; return $(n:J) ; } else { local n = $(name) "-d" ; return $(n:J) ; } } } else if $(type) in STATIC_LIB && [ $(properties).get ] in iphone { if [ $(properties).get ] in arm { return $(name)-arm.a ; } else { return $(name)-x86.a ; } } else if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB { if [ $(properties).get ] in debug-mfc { if $(type) in SHARED_LIB { return $(name)-gd.dll ; } else if $(type) in IMPORT_LIB { return $(name)-gd.lib ; } else { echo "Unknown type for debug-mfc build" $(type) $(name) ; } } else { # For more options here take a look at the rule "tag" in Boost's Jamroot return [ common.format-name : $(name) : $(type) : $(properties) ] ; } } else { # We don't yet know what to do about these target types echo $(name) $(type) $(properties) ; } } rule fost-lib ( name : sources + : requirements * : install-loc ? ) { lib $(name) : $(TARGET_INPUTS) $(sources) : $(requirements) $(TARGET_REQUIREMENTS) @fost-tag-output ; if $(install-loc) { fost-install-to-directory $(install-loc) : $(install-loc) : $(name) ; } else { fost-install $(name) ; } } rule fost-exe ( name : sources + : requirements * ) { exe $(name) : $(TARGET_INPUTS) $(TOP)/../fost-base/Cpp/fost-cli $(sources) : $(requirements) $(TARGET_REQUIREMENTS) @fost-tag-output ; fost-install $(name) ; } rule fost-lib-autotest ( name : location : libs * : requirements * : install-loc ? ) { fost-lib $(name) : $(libs) [ path.glob $(TOP)/$(location) : *.cpp : *-tests.cpp ] : $(requirements) : $(install-loc) ; local smoke-test-name = $(name) "-unit-tests" ; fost-smoke-test $(smoke-test-name:J) : $(libs) $(name) : [ path.glob $(TOP)/$(location) : *-tests.cpp ] ; } rule fost-integration-test ( name : location : libs * : requirements * : install-loc ? ) { fost-smoke-test $(name) : $(libs) : [ path.glob $(TOP)/$(location) : *.cpp ] ; } rule fost-mkdir { fost-mkdir-i $(<) ; } actions fost-mkdir-i { mkdir -p $(<) } rule fost-doxygen ( name : path : sources * ) { path-constant DOC_PATH : $(PREFIX)/$(path) ; alias $(DOC_PATH) ; fost-mkdir-i $(DOC_PATH) ; #make $(DOC_PATH) : : @fost-mkdir ; doxygen name : $(sources) : -multi # Works around a bug in boost.build # Boost.Build in 1.42.0 requires this to be relative #../../../dist/usr/share/fost/ # Relative to Docs in the build folder $(DOC_PATH) SEARCH_INCLUDES=YES INCLUDE_PATH=Cpp/include SHOW_INCLUDE_FILES=YES OUTPUT_DIRECTORY=$(DOC_PATH) ; }