import common ; import path ; using testing ; rule fost-project ( name : requirements * ) { project : requirements $(requirements) Cpp/include ../fost-base/Cpp/include $(BOOST_HEADERS) windows:../OpenSSL/install/include/ multi shared linux:-Wl,-E windows:on windows:on windows:off windows:on windows:database windows:WIN32 windows:_AFXDLL windows:UNICODE windows:_UNICODE : default-build debug : 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) 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)/dist/lib : $(loc)/dist/bin : $(sources) ; } rule fost-install ( sources + ) { fost-install-loc $(TOP)/.. : $(sources) ; } rule fost-smoke-test ( name : libs * : files * ) { #lib $(name) # : # $(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 # $(TOP)/../fost-base/Cpp/fost-test/ # $(libs) # $(files) # : # windows:$(TOP)/../OpenSSL//libeay32-dll # windows:$(TOP)/../OpenSSL//ssleay32-dll # linux:$(TOP)/../fost-base/External//openssl # darwin:$(TOP)/../fost-base/External//openssl # ; #fost-install $(name) ; #local unit-test-name = $(name) "-unit" ; unit-test $(name) #$(unit-test-name:J) : $(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-cli//fost-cli $(TOP)/../fost-base/Cpp/fost-core//fost-core $(TOP)/../fost-base/Cpp/fost-test//fost-test $(libs) $(files) #$(name) $(TOP)/../fost-base/Cpp/fost-test/boost-build-unit-test.cpp : darwin:$(TOP)/../fost-base/External//openssl linux:$(TOP)/../fost-base/External//openssl windows:$(TOP)/../fost-base/External//ole windows:$(TOP)/../OpenSSL//libeay32-dll windows:$(TOP)/../OpenSSL//ssleay32-dll ; } 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 { 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 SHARED_LIB IMPORT_LIB { # 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) : $(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 $(sources) : $(requirements) darwin:$(TOP)/../fost-base/External//openssl linux:$(TOP)/../fost-base/External//openssl windows:$(TOP)/../OpenSSL//libeay32-dll windows:$(TOP)/../OpenSSL//ssleay32-dll @fost-tag-output ; if $(install-loc) { fost-install-to-directory $(install-loc) : $(install-loc) : $(name) ; } else { fost-install $(name) ; } } rule fost-exe ( name : sources + ) { exe $(name) : $(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/ $(TOP)/../fost-base/Cpp/fost-cli/ $(sources) : darwin:$(TOP)/../fost-base/External//openssl linux:$(TOP)/../fost-base/External//openssl windows:$(TOP)/../fost-base/External//ole windows:$(TOP)/../OpenSSL//libeay32-dll windows:$(TOP)/../OpenSSL//ssleay32-dll @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) "-smoke-test" ; fost-smoke-test $(smoke-test-name:J) : $(libs) $(name) : [ path.glob $(TOP)/$(location) : *-tests.cpp ] ; }