├── config ├── .gitignore ├── modules │ ├── 510-Metis.mk │ ├── 110-longbow.mk │ ├── 120-libparc.mk │ ├── 511-Athena.mk │ ├── 601-ccnxPing.mk │ ├── 603-ccnxFileRepo.mk │ ├── 210-libccnx-common.mk │ ├── 230-libccnx-portal.mk │ ├── README │ ├── 220-libccnx-transport-rta.mk │ ├── 602-ccnxSimpleFileTransfer.mk │ ├── 100-distillery.mk │ ├── 900-sanity.mk │ ├── 000-distillery-update.mk │ ├── 701-MasterIDE.mk │ ├── 002-make-modules.mk │ ├── 001-modules.mk │ ├── 002-cmake-modules.mk │ └── 000-gitModule.mk ├── README ├── MasterIDE-CMakeLists.txt └── config.mk ├── tools ├── .gitignore └── bin │ ├── export_ccnx_env.sh │ ├── clion_wrapper.sh │ ├── gitCloneOneOf.sh │ ├── gitAddUpstream.sh │ ├── getStatus.sh │ ├── gitStatus.sh │ ├── syncOriginMasterWithPARCUpstream.sh │ └── sanityCheck-FileTransfer.py ├── dependencies ├── ubuntu-packages.list ├── Makefile.ubuntu ├── ubuntu-install-packages.sh ├── .gitignore ├── Makefile.jekyll ├── ubuntu-check-system.sh ├── ubuntu-check-packages.sh ├── patches │ └── openssl.patch ├── Makefile.downloader ├── Makefile.unix └── Makefile ├── .gitignore ├── LICENSE ├── README.md └── Makefile /config/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /config/modules/510-Metis.mk: -------------------------------------------------------------------------------- 1 | $(eval $(call addCMakeModule,Metis)) 2 | -------------------------------------------------------------------------------- /config/modules/110-longbow.mk: -------------------------------------------------------------------------------- 1 | $(eval $(call addCMakeModule,LongBow)) 2 | -------------------------------------------------------------------------------- /config/modules/120-libparc.mk: -------------------------------------------------------------------------------- 1 | $(eval $(call addCMakeModule,Libparc)) 2 | -------------------------------------------------------------------------------- /config/modules/511-Athena.mk: -------------------------------------------------------------------------------- 1 | $(eval $(call addCMakeModule,Athena)) 2 | -------------------------------------------------------------------------------- /config/modules/601-ccnxPing.mk: -------------------------------------------------------------------------------- 1 | $(eval $(call addCMakeModule,ccnxPing)) 2 | -------------------------------------------------------------------------------- /config/modules/603-ccnxFileRepo.mk: -------------------------------------------------------------------------------- 1 | $(eval $(call addCMakeModule,ccnxFileRepo)) 2 | -------------------------------------------------------------------------------- /config/modules/210-libccnx-common.mk: -------------------------------------------------------------------------------- 1 | $(eval $(call addCMakeModule,Libccnx-common)) 2 | -------------------------------------------------------------------------------- /config/modules/230-libccnx-portal.mk: -------------------------------------------------------------------------------- 1 | $(eval $(call addCMakeModule,Libccnx-portal)) 2 | -------------------------------------------------------------------------------- /config/modules/README: -------------------------------------------------------------------------------- 1 | CCNx Distillery Modules 2 | 3 | These modules are loaded in order. 4 | -------------------------------------------------------------------------------- /config/modules/220-libccnx-transport-rta.mk: -------------------------------------------------------------------------------- 1 | $(eval $(call addCMakeModule,Libccnx-transport-rta)) 2 | -------------------------------------------------------------------------------- /config/modules/602-ccnxSimpleFileTransfer.mk: -------------------------------------------------------------------------------- 1 | $(eval $(call addCMakeModule,ccnxSimpleFileTransfer)) 2 | -------------------------------------------------------------------------------- /config/modules/100-distillery.mk: -------------------------------------------------------------------------------- 1 | CCNx_Distillery_SOURCE_DIR=${DISTILLERY_ROOT_DIR} 2 | $(eval $(call addGitModule,CCNx_Distillery)) 3 | -------------------------------------------------------------------------------- /tools/.gitignore: -------------------------------------------------------------------------------- 1 | parc 2 | bin/getStatus 3 | bin/gitCloneOneOf 4 | bin/gitAddUpstream 5 | bin/gitStatus 6 | bin/syncOriginMasterWithPARCUpstream 7 | -------------------------------------------------------------------------------- /dependencies/ubuntu-packages.list: -------------------------------------------------------------------------------- 1 | libssl-dev openssl flex bison expat libexpat1-dev libpcap-dev libevent-dev g++ libpcre3-dev python-dev uncrustify doxygen 2 | -------------------------------------------------------------------------------- /dependencies/Makefile.ubuntu: -------------------------------------------------------------------------------- 1 | # Makefile to install ubuntu dependencies 2 | 3 | ubuntu.install.packages: 4 | ubuntu-install-packages.sh 5 | 6 | ubuntu.check: 7 | ubuntu-check.sh 8 | -------------------------------------------------------------------------------- /dependencies/ubuntu-install-packages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | required_packages=`cat ubuntu-packages.list` 4 | echo sudo apt-get install $required_packages 5 | sudo apt-get install $required_packages 6 | -------------------------------------------------------------------------------- /config/modules/900-sanity.mk: -------------------------------------------------------------------------------- 1 | 2 | ## Run the simple file transfer check. 3 | sanity-filetransfer: 4 | tools/bin/sanityCheck-FileTransfer.py ${CCNX_HOME}/bin 5 | 6 | 7 | sanity: sanity-filetransfer 8 | -------------------------------------------------------------------------------- /dependencies/.gitignore: -------------------------------------------------------------------------------- 1 | autoconf-2.69 2 | automake-1.14.1 3 | doxygen-1.8.11 4 | hfcca-1.7.1 5 | libevent-2.0.22-stable 6 | libtool-2.4.2 7 | openssl-1.0.1q 8 | pcre-8.38 9 | uncrustify-0.61 10 | cmake-3.4.3 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created files and directories 2 | build 3 | usr 4 | .distillery.stamp 5 | src/* 6 | xcode 7 | 8 | # Temporary files 9 | *.swp 10 | *~ 11 | build-debug 12 | usr-debug 13 | build-nopants 14 | build-release 15 | usr-nopants 16 | usr-release 17 | -------------------------------------------------------------------------------- /tools/bin/export_ccnx_env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | working_dir=`pwd` 4 | script_dir=$(dirname "$BASH_SOURCE") 5 | 6 | cd "${script_dir}"/../../ 7 | 8 | env=`make -f Makefile -s env` 9 | for def in $env; do 10 | { export $def; } 11 | done 12 | 13 | cd "$working_dir" 14 | -------------------------------------------------------------------------------- /tools/bin/clion_wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | script_dir=$(dirname "$BASH_SOURCE") 3 | 4 | export DISTILLERY_BUILD_NAME=-debug 5 | 6 | cd "${script_dir}" 7 | source ./export_ccnx_env.sh 8 | 9 | cd ${DISTILLERY_ROOT_DIR}/src 10 | 11 | osType=`uname -s` 12 | 13 | case "$osType" in 14 | Darwin) 15 | open /Applications/CLion.app 16 | ;; 17 | Linux) 18 | clion.sh 19 | ;; 20 | *) 21 | echo "System not recognized, edit ${0} to add support" 22 | ;; 23 | esac 24 | 25 | -------------------------------------------------------------------------------- /dependencies/Makefile.jekyll: -------------------------------------------------------------------------------- 1 | #!/bin/make -f 2 | 3 | export RUBY_DIR=$(shell pwd)/Jekyll 4 | export GEM_HOME=${RUBY_DIR} 5 | export GEM_PATH=${GEM_HOME}:/usr/lib/ruby/gems/2.0.0 6 | 7 | SOURCE_DIR=PARC 8 | 9 | JEKYLL_DIR=${GEM_HOME}/gems/jekyll-1.4.3/bin/jekyll 10 | 11 | all: depend 12 | 13 | check: 14 | GEM_PATH=${GEM_PATH} GEM_HOME=${GEM_HOME} gem environment 15 | 16 | depend: ${JEKYLL_DIR} 17 | 18 | ${JEKYLL_DIR}: 19 | mkdir -p ${RUBY_DIR} 20 | gem install -i ${RUBY_DIR} jekyll 21 | 22 | clobber: 23 | rm -rf ${RUBY_DIR} 24 | -------------------------------------------------------------------------------- /dependencies/ubuntu-check-system.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | system_check_error(){ 4 | echo "" 5 | echo "ERROR: You are not running Ubuntu 14.04" 6 | echo "" 7 | echo "If you want to IGNORE this error please set DISABLE_UBUNTU_CHECK=True" 8 | echo "This is done in the config.local.mk file" 9 | echo "Please see the config.local.mk file for more information" 10 | exit 1 11 | } 12 | 13 | system_check_ubuntu() { 14 | LINUX_SYSTEM=`lsb_release -d -s | grep 14.04` 15 | ret=$? 16 | if [ x$ret != "x0" ]; then 17 | system_check_error 18 | fi 19 | } 20 | 21 | system_check_ubuntu 22 | -------------------------------------------------------------------------------- /config/README: -------------------------------------------------------------------------------- 1 | CCNx Distillery Config Directory 2 | 3 | This is the directory where CCNx Distillery stores it's configuration 4 | information. Most configuration is parsed by makefile so the files are in 5 | makefile format. 6 | 7 | Important files and directories 8 | 9 | # config.mk 10 | This is the default configuration. DO NOT CHANGE THIS FILE. You can use this 11 | file as a template to create your own configuration. 12 | 13 | # modules 14 | This is the modules directory. It has the configuration file for each module 15 | that is available through Distillery. 16 | 17 | # local 18 | This directory (may or may not exist) is the place to put your local 19 | configuration files. It gets ignored by git. Make will look for a 20 | configuration file called config.mk in this directory to configure this 21 | specific instance of Distillery. 22 | -------------------------------------------------------------------------------- /config/modules/000-distillery-update.mk: -------------------------------------------------------------------------------- 1 | ########################################## 2 | # Tell people they need to use the "new" way. 3 | 4 | define errorMessage 5 | $(warning * Attention, the configuration for GitHub has changed) 6 | $(warning * DISTILLERY_GITHUB_USER is depricated. You shoud now) 7 | $(warning * use DISTILLERY_GITHUB_URL_USER) 8 | $(warning * DISTILLERY_GITHUB_SERVER is depricated. You shoud now) 9 | $(warning * use DISTILLERY_GITHUB_URL) 10 | $(warning * Set this in your config file .ccnx/distillery/config.mk) 11 | $(warning * See config/config.mk for default values) 12 | $(error ERROR: Make found depricated variable $1) 13 | endef 14 | 15 | ifdef DISTILLERY_GITHUB_USER 16 | $(call errorMessage,DISTILLERY_GITHUB_USER) 17 | endif 18 | 19 | ifdef DISTILLERY_GITHUB_SERVER 20 | $(call errorMessage,DISTILLERY_GITHUB_SERVER) 21 | endif 22 | -------------------------------------------------------------------------------- /config/modules/701-MasterIDE.mk: -------------------------------------------------------------------------------- 1 | $(eval Master_SOURCE_DIR?=${DISTILLERY_SOURCE_DIR}) 2 | $(eval Master_XCODE_DIR?=${DISTILLERY_XCODE_DIR}) 3 | $(eval modules_xcode+=MasterIDE) 4 | 5 | ${Master_SOURCE_DIR}/CMakeLists.txt: 6 | @echo "No CMakeLists.txt in ${Master_SOURCE_DIR}, copying config/MasterIDE-CMakeLists.txt" 7 | @cp config/MasterIDE-CMakeLists.txt ${Master_SOURCE_DIR}/CMakeLists.txt 8 | 9 | MasterIDE.build: ${Master_SOURCE_DIR}/CMakeLists.txt debug-all 10 | 11 | MasterIDE.xcode: debug-MasterIDE.build 12 | @mkdir -p ${Master_XCODE_DIR} 13 | cd ${Master_XCODE_DIR}; \ 14 | DEPENDENCY_HOME=${DISTILLERY_EXTERN_DIR} \ 15 | cmake -DCMAKE_BUILD_TYPE=Debug -G Xcode ${Master_SOURCE_DIR} 16 | 17 | MasterIDE.xcodeopen: debug-MasterIDE.xcode 18 | @open ${Master_XCODE_DIR}/Master.xcodeproj 19 | 20 | MasterIDE.clion: debug-MasterIDE.build 21 | 22 | MasterIDE.clionopen: debug-MasterIDE.clion 23 | @tools/bin/clion_wrapper.sh& 24 | @echo "CLion has been spawned" 25 | 26 | xcode: debug-MasterIDE.xcode 27 | 28 | -------------------------------------------------------------------------------- /tools/bin/gitCloneOneOf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $# -lt 3 ]; then 4 | echo "ERROR incorrect number of parameters" 5 | echo "Usage:" 6 | echo " $0 [...]" 7 | echo 8 | echo "$0 clones repository to the directory " 9 | echo "It clones off of . If git can't clone off of it tries" 10 | echo "to clone off of , then etc." 11 | exit 1 12 | fi 13 | 14 | REPO_NAME=$1 15 | REPO_DIR=$2 16 | 17 | REMOTES=${@:3} 18 | 19 | if [ -d $REPO_DIR ]; then 20 | echo "Directory $REPO_DIR exists, no need to clone" 21 | exit 0 22 | fi 23 | 24 | echo "###################################################################" 25 | echo "# Cloning $REPO_NAME" 26 | 27 | for remote in $REMOTES; do 28 | echo "# Trying $remote" 29 | git clone $remote $REPO_DIR >/dev/null 2>&1 30 | ERROR=$? 31 | if [ $ERROR -eq 0 ]; then 32 | echo "# SUCCESS" 33 | exit 0 34 | fi 35 | echo "# Skipped " 36 | done 37 | echo "# FAILED cloning " 38 | exit 1 39 | -------------------------------------------------------------------------------- /tools/bin/gitAddUpstream.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ $# -lt 4 ]; then 4 | echo "ERROR incorrect number of parameters" 5 | echo "Usage:" 6 | echo " $0 " 7 | echo 8 | echo "$0 adds a remote named to repository located" 9 | echo "in directory . The remote will point towards " 10 | echo "If already exits nothing will be done." 11 | exit 1 12 | fi 13 | 14 | REPO_NAME=$1 15 | REPO_DIR=$2 16 | REMOTE_NAME=$3 17 | REMOTE_URL=$4 18 | 19 | if [ ! -d $REPO_DIR ]; then 20 | echo "ERROR running $0" 21 | echo " Directory $REPO_DIR not found" 22 | exit 1 23 | fi 24 | 25 | echo "###################################################################" 26 | echo "# Updationg remote $REMOTE_NAME for $REPO_NAME" 27 | 28 | cd $REPO_DIR 29 | 30 | git remote add $REMOTE_NAME $REMOTE_URL > /dev/null 2>&1 31 | if [ $? -ne 0 ]; then 32 | echo "# Skipped - not needed" 33 | exit 0 34 | fi 35 | 36 | echo "# Added $REMOTE_URL" 37 | exit 0 38 | -------------------------------------------------------------------------------- /config/MasterIDE-CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This is a master CMakeLists.txt file for IDEs. If you are viewing this as 2 | # CMakeLists.txt in the source directory IT IS A COPY and SHOULD NOT BE EDITED - 3 | # edit the MasterIDE-CMakeLists.txt in CCNx_Distillery/config instead. 4 | # 5 | cmake_minimum_required(VERSION 3.2) 6 | project (master) 7 | 8 | message("--- Collecting all sub-projects ---") 9 | 10 | macro(Subdirs result parent) 11 | file(GLOB children LIST_DIRECTORIES true RELATIVE ${parent} "[^.]*") 12 | set(dirlist "") 13 | foreach(child ${children}) 14 | if(IS_DIRECTORY ${parent}/${child}) 15 | if(EXISTS ${parent}/${child}/CMakeLists.txt) 16 | list(APPEND dirlist ${child}) 17 | endif() 18 | endif() 19 | endforeach() 20 | set(${result} ${dirlist}) 21 | endmacro() 22 | 23 | Subdirs(modules ${CMAKE_SOURCE_DIR}) 24 | 25 | foreach(module ${modules}) 26 | message("module: ${module}") 27 | set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/${module}/cmake/Modules") 28 | add_subdirectory(${module}) 29 | endforeach() 30 | -------------------------------------------------------------------------------- /tools/bin/getStatus.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | GIT_DIRECTORY=$1 4 | GIT_REPO=`basename ${GIT_DIRECTORY}` 5 | 6 | cd ${GIT_DIRECTORY} 7 | 8 | CURRENT_SHA=`git branch -av | grep "\*" | awk '{print $3}'` 9 | CURRENT_BRANCH=`git branch -av | grep "\*" | awk '{print $2}'` 10 | UPSTREAM_SHA=`git branch -av | grep "remotes/parc_upstream/master" | awk '{print $2}'` 11 | 12 | if [ x${UPSTREAM_SHA} = x ]; then 13 | # We don't have an upstream... 14 | UPSTREAM_SHA="NO_UPSTREAM" 15 | else 16 | PARC_MASTER_IN_BRANCH=`git branch -v --contains $UPSTREAM_SHA | grep "\*" | awk '{print $3}'` 17 | fi 18 | 19 | 20 | echo '====================================================================' 21 | 22 | if [ "x${PARC_MASTER_IN_BRANCH}" != "x" ]; then 23 | # This branch is master OR ahead of master 24 | if [ x${CURRENT_SHA} = x${UPSTREAM_SHA} ]; then 25 | echo "PARC ${GIT_REPO} ${CURRENT_BRANCH} ${CURRENT_SHA}::${UPSTREAM_SHA}" 26 | else 27 | echo "PARC++ ${GIT_REPO} ${CURRENT_BRANCH} ${CURRENT_SHA}::${UPSTREAM_SHA}" 28 | fi 29 | else 30 | echo "------ ${GIT_REPO} ${CURRENT_BRANCH} ${CURRENT_SHA}::${UPSTREAM_SHA}" 31 | fi 32 | git status -s 33 | -------------------------------------------------------------------------------- /dependencies/ubuntu-check-packages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | required_packages=`cat ubuntu-packages.list` 4 | 5 | 6 | package_check_fail(){ 7 | echo "" 8 | echo " ================================================= " 9 | echo "ERROR: The package check has failed." 10 | echo "" 11 | echo "You do not have the required packages installed on your system, please install them." 12 | echo "" 13 | echo "You can run the command:" 14 | echo " sudo apt-get install $required_packages" 15 | echo "" 16 | echo "alternatively you can just run it via the Makefile" 17 | echo " make -C dependencies fix-as-root" 18 | echo "" 19 | echo "You can also disable this check by setting DISABLE_UBUNTU_PACKAGE_CHECK=True" 20 | echo "This is done in the config.local.mk file" 21 | echo "Please see the config.local.mk file for more information" 22 | exit 1 23 | } 24 | 25 | package_check_installed(){ 26 | package=$1 27 | INSTALLED=`dpkg-query -W -f='${Status}\n' $package | awk '{print $3}'` 28 | if [ "status-${INSTALLED}" != "status-installed" ]; then 29 | echo "Package $package is not installed" 30 | package_check_fail 31 | fi 32 | } 33 | 34 | for package in $required_packages; do 35 | package_check_installed $package 36 | done 37 | -------------------------------------------------------------------------------- /dependencies/patches/openssl.patch: -------------------------------------------------------------------------------- 1 | --- Configure.orig 2010-01-19 13:40:54.000000000 -0800 2 | +++ Configure 2010-05-07 11:26:25.067067029 -0700 3 | @@ -337,6 +337,9 @@ my %table=( 4 | # *-generic* is endian-neutral target, but ./config is free to 5 | # throw in -D[BL]_ENDIAN, whichever appropriate... 6 | "linux-generic32","gcc:-DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 7 | +"linux-octeon-uclibc32","mips64-octeon-linux-gnu-gcc:\${TOOLCHAIN_ABI} -O3 -DB_ENDIAN -DTERMIO -Wall::::-ldl::${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):mips64-octeon-linux-gnu-ranlib:", 8 | +"linux-octeon32","mips64-octeon-linux-gnu-gcc:\${TOOLCHAIN_ABI} -O3 -DB_ENDIAN -DTERMIO -Wall::::-ldl::${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):mips64-octeon-linux-gnu-ranlib:", 9 | +"linux-octeon64","mips64-octeon-linux-gnu-gcc:\${TOOLCHAIN_ABI} -O3 -DB_ENDIAN -DTERMIO -Wall::::-ldl:SIXTY_FOUR_BIT_LONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):mips64-octeon-linux-gnu-ranlib:", 10 | "linux-ppc", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc32_asm}:linux32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 11 | # It's believed that majority of ARM toolchains predefine appropriate -march. 12 | # If you compiler does not, do complement config command line with one! 13 | -------------------------------------------------------------------------------- /config/modules/002-make-modules.mk: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # Distillery Make Module 3 | # 4 | # This is a framework for Distillery Modules using make. 5 | # 6 | # Modules can add themselves do distillery by calling the addMakeModule 7 | # function. A module called Foo would do the following: 8 | # 9 | # $(eval $(call addMakeModule,Foo)) 10 | # 11 | # Assumptions 12 | # - The source for Foo is in git, located at: ${DISTILLERY_GITHUB_URL}/Foo 13 | # You can change this via a variable, see bellow. 14 | # - The source can do an off-tree build. 15 | # - The source is compiled via Make 16 | # 17 | # Parameters: 18 | # This function can be modified by setting some variables for the specified 19 | # module. These variables must be set BEFORE you call the function. replace 20 | # "Module" by the parameter passed on to the funcion. 21 | # 22 | # - Module_GIT_REPOSITORY 23 | # URL to the Git repository of the source. 24 | # Defaults to: ${DISTILLERY_GITHUB_URL}${DISTILLERY_GITHUB_URL_USER}/Foo 25 | # You can modify this to point to a different repository. (git origin) 26 | # - Module_GIT_UPSTREAM_REPOSITORY 27 | # URL to the remote git repository to use as upstream. This defaults to 28 | # ${DISTILLERY_GITHUB_UPSTREAM_URL}/Module. The remote will be added to git 29 | # under the name ${DISTILLERY_GITHUB_UPSTREAM_NAME} 30 | # - Module_SOURCE_DIR 31 | # Location where the source will be downloaded. Don't change this unless you 32 | # have a very good reason to. 33 | # - Module_BUILD_DIR 34 | # Location where the source will be built. Don't change this unless you have 35 | # a very good reason to. 36 | 37 | 38 | define addMakeModule 39 | $(eval $(call addModule,$1)) 40 | 41 | ${$1_BUILD_DIR}/Makefile: ${$1_SOURCE_DIR}/Makefile 42 | @cp -rf ${$1_SOURCE_DIR}/ ${$1_BUILD_DIR}/ 43 | 44 | ${$1_SOURCE_DIR}/Makefile: 45 | @$(MAKE) distillery.checkout.error 46 | 47 | $1.check: ${$1_BUILD_DIR}/Makefile 48 | @${MAKE} ${MAKE_BUILD_FLAGS} -C ${$1_BUILD_DIR} check 49 | 50 | endef 51 | -------------------------------------------------------------------------------- /tools/bin/gitStatus.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ $# -lt 5 ]; then 4 | echo "ERROR incorrect number of parameters" 5 | echo "Usage:" 6 | echo " $0 " 7 | echo 8 | echo "$0 check the values of the repo. Compare what git things with what we would like" 9 | echo " repo_name - Name of the repo (cosmetic)" 10 | echo " repo_directory - Directory where to find the git repo" 11 | echo " origin - What origin should be set to" 12 | echo " remote_name - The name of a remote to check" 13 | echo " remote_url - What that remote should be set to" 14 | exit 1 15 | fi 16 | 17 | REPO_NAME=$1 18 | REPO_DIR=$2 19 | ORIGIN=$3 20 | REMOTE_NAME=$4 21 | REMOTE_URL=$5 22 | 23 | if [ ! -d $REPO_DIR ]; then 24 | echo "ERROR running $0" 25 | echo " Directory $REPO_DIR not found" 26 | exit 1 27 | fi 28 | 29 | cd $REPO_DIR 30 | 31 | NEEDS_UPDATE=NO 32 | 33 | echo "###################################################################" 34 | echo "# $REPO_NAME " 35 | 36 | # An origin of - means we should ignore the origin check 37 | if [ $ORIGIN != - ]; then 38 | ORIGIN_ACTUAL=`git config --get remote.origin.url` 39 | if [ $ORIGIN_ACTUAL != $ORIGIN ]; then 40 | echo "# WARNING: remote origin missmatch" 41 | echo "# Expected $ORIGIN" 42 | echo "# Found $ORIGIN_ACTUAL" 43 | NEEDS_UPDATE=YES 44 | fi 45 | fi 46 | 47 | REMOTE_URL_ACTUAL=`git config --get remote.$REMOTE_NAME.url 2>/dev/null` 48 | 49 | if [ $? -ne 0 ]; then 50 | echo "# WARNING remote $REMOTE_NAME does not exist" 51 | echo "# Expected $REMOTE_NAME = $REMOTE_URL" 52 | echo "# Found a remote called $REMOTE_NAME does not exist" 53 | NEEDS_UPDATE=YES 54 | else 55 | if [ $REMOTE_URL_ACTUAL != $REMOTE_URL ]; then 56 | echo "# WARNING remote $REMOTE_NAME missmatch" 57 | echo "# Expected $REMOTE_NAME = $REMOTE_URL" 58 | echo "# Found $REMOTE_NAME = $REMOTE_URL_ACTUAL" 59 | NEEDS_UPDATE=YES 60 | fi 61 | fi 62 | 63 | if [ $NEEDS_UPDATE = NO ]; then 64 | echo "# Up to date" 65 | exit 0 66 | fi 67 | 68 | echo "#" 69 | echo "# Your settings don't match the default settings for $REPO_NAME" 70 | echo "# located at $REPO_DIR" 71 | 72 | 73 | -------------------------------------------------------------------------------- /config/modules/001-modules.mk: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # Distillery Module 3 | # 4 | # This is a framework for Distillery Modules. 5 | # 6 | # Modules can add themselves do distillery by calling the addModule 7 | # function. A module called Foo would do the following: 8 | # 9 | # $(eval $(call addModule,Foo)) 10 | # 11 | # Assumptions 12 | # - The source for Foo is in git, located at: ${DISTILLERY_GITHUB_URL}/Foo 13 | # You can change this via a variable, see bellow. 14 | # - The source can do an off-tree build. 15 | # 16 | # Parameters: 17 | # This function can be modified by setting some variables for the specified 18 | # module. These variables must be set BEFORE you call the function. replace 19 | # "Module" by the parameter passed on to the funcion. 20 | # 21 | # - Module_GIT_REPOSITORY 22 | # URL to the Git repository of the source. 23 | # Defaults to: ${DISTILLERY_GITHUB_URL}${DISTILLERY_GITHUB_URL_USER}/Foo 24 | # You can modify this to point to a different repository. (git origin) 25 | # - Module_GIT_UPSTREAM_REPOSITORY 26 | # URL to the remote git repository to use as upstream. This defaults to 27 | # ${DISTILLERY_GITHUB_UPSTREAM_URL}/Module. The remote will be added to git 28 | # under the name ${DISTILLERY_GITHUB_UPSTREAM_NAME} 29 | # - Module_SOURCE_DIR 30 | # Location where the source will be downloaded. Don't change this unless you 31 | # have a very good reason to. 32 | # - Module_BUILD_DIR 33 | # Location where the source will be built. Don't change this unless you have 34 | # a very good reason to. 35 | # - Module_XCODE_DIR 36 | # Location where to put the xcode project Defaults to 37 | # ${DISTILLERY_XCODE_DIR}/Module 38 | 39 | 40 | define addModule 41 | $(eval $(call addGitModule,$1)) 42 | $(eval modules+=$1) 43 | 44 | $1: $1.build $1.install 45 | 46 | $1.step: $1.build $1.check $1.install 47 | 48 | $1.build: ${$1_BUILD_DIR}/Makefile 49 | ${MAKE} ${MAKE_BUILD_FLAGS} -C ${$1_BUILD_DIR} 50 | 51 | $1.install: ${$1_BUILD_DIR}/Makefile 52 | @${MAKE} ${MAKE_BUILD_FLAGS} -C ${$1_BUILD_DIR} install 53 | 54 | $1.clean: ${$1_BUILD_DIR}/Makefile 55 | @${MAKE} ${MAKE_BUILD_FLAGS} -C ${$1_BUILD_DIR} clean 56 | 57 | $1.distclean: 58 | rm -rf ${$1_BUILD_DIR} 59 | endef 60 | 61 | module.list: 62 | @echo ${modules} 63 | -------------------------------------------------------------------------------- /config/modules/002-cmake-modules.mk: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # Distillery CMake Module 3 | # 4 | # This is a framework for Distillery Modules using cmake. 5 | # 6 | # Modules can add themselves do distillery by calling the addCMakeModule 7 | # function. A module called Foo would do the following: 8 | # 9 | # $(eval $(call addCmakeModule,Foo)) 10 | # 11 | # Assumptions 12 | # - The source for Foo is in git, located at: ${DISTILLERY_GITHUB_URL}/Foo 13 | # You can change this via a variable, see bellow. 14 | # - The source can do an off-tree build. 15 | # - The source is compiled via CMake 16 | # 17 | # Parameters: 18 | # This function can be modified by setting some variables for the specified 19 | # module. These variables must be set BEFORE you call the function. replace 20 | # "Module" by the parameter passed on to the funcion. 21 | # 22 | # - Module_GIT_REPOSITORY 23 | # URL to the Git repository of the source. 24 | # Defaults to: ${DISTILLERY_GITHUB_URL}${DISTILLERY_GITHUB_URL_USER}/Foo 25 | # You can modify this to point to a different repository. (git origin) 26 | # - Module_GIT_UPSTREAM_REPOSITORY 27 | # URL to the remote git repository to use as upstream. This defaults to 28 | # ${DISTILLERY_GITHUB_UPSTREAM_URL}/Module. The remote will be added to git 29 | # under the name ${DISTILLERY_GITHUB_UPSTREAM_NAME} 30 | # - Module_SOURCE_DIR 31 | # Location where the source will be downloaded. Don't change this unless you 32 | # have a very good reason to. 33 | # - Module_BUILD_DIR 34 | # Location where the source will be built. Don't change this unless you have 35 | # a very good reason to. 36 | # - Module_XCODE_DIR 37 | # Location where to put the xcode project Defaults to 38 | # ${DISTILLERY_XCODE_DIR}/Module 39 | 40 | 41 | 42 | define addCMakeModule 43 | $(eval $(call addModule,$1)) 44 | $(eval $1_XCODE_DIR?=${DISTILLERY_XCODE_DIR}/$1) 45 | $(eval modules_xcode+=$1) 46 | 47 | ${$1_BUILD_DIR}/Makefile: ${$1_SOURCE_DIR}/CMakeLists.txt ${DISTILLERY_STAMP} 48 | mkdir -p ${$1_BUILD_DIR} 49 | cd ${$1_BUILD_DIR}; \ 50 | DEPENDENCY_HOME=${DISTILLERY_EXTERN_DIR} \ 51 | cmake ${$1_SOURCE_DIR} \ 52 | ${CMAKE_BUILD_TYPE_FLAG} \ 53 | -DCMAKE_INSTALL_PREFIX=${DISTILLERY_INSTALL_DIR} 54 | 55 | ${$1_SOURCE_DIR}/CMakeLists.txt: 56 | @$(MAKE) distillery.checkout.error 57 | 58 | $1.check: ${$1_BUILD_DIR}/Makefile 59 | @${MAKE} ${MAKE_BUILD_FLAGS} -C ${$1_BUILD_DIR} test ${CMAKE_MAKE_TEST_ARGS} 60 | 61 | $1.xcode: 62 | @mkdir -p ${$1_XCODE_DIR} 63 | @cd ${$1_XCODE_DIR} && cmake -G Xcode ${$1_SOURCE_DIR} 64 | 65 | $1.xcodeopen: $1.xcode 66 | @open ${$1_XCODE_DIR}/$1.xcodeproj 67 | 68 | $1.coverage: 69 | @echo "### $1: " 70 | @longbow-coverage-report ` find ${$1_BUILD_DIR} -type f -name 'test_*' -not -name '*\.*' ` 71 | 72 | $1.average-coverage: 73 | @echo "### $1: " 74 | @longbow-coverage-report -a ` find ${$1_BUILD_DIR} -type f -name 'test_*' -not -name '*\.*' ` 75 | 76 | 77 | xcode: $1.xcode 78 | 79 | $1.documentation: 80 | @${MAKE} ${MAKE_BUILD_FLAGS} -C ${$1_BUILD_DIR} documentation 81 | 82 | endef 83 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013,2014,2015,2016, Xerox Corporation (Xerox) and Palo Alto Research Center, Inc (PARC) 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL XEROX OR PARC BE LIABLE FOR ANY 17 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 20 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | 24 | ################################################################################ 25 | # 26 | # PATENT NOTICE 27 | # 28 | # This software is distributed under the BSD 2-clause License (see LICENSE 29 | # file). This BSD License does not make any patent claims and as such, does 30 | # not act as a patent grant. The purpose of this section is for each contributor 31 | # to define their intentions with respect to intellectual property. 32 | # 33 | # Each contributor to this source code is encouraged to state their patent 34 | # claims and licensing mechanisms for any contributions made. At the end of 35 | # this section contributors may each make their own statements. Contributor's 36 | # claims and grants only apply to the pieces (source code, programs, text, 37 | # media, etc) that they have contributed directly to this software. 38 | # 39 | # There is no guarantee that this section is complete, up to date or accurate. It 40 | # is up to the contributors to maintain their portion of this section and up to 41 | # the user of the software to verify any claims herein. 42 | # 43 | # Do not remove this header notification. The contents of this section must be 44 | # present in all distributions of the software. You may only modify your own 45 | # intellectual property statements. Please provide contact information. 46 | 47 | - Palo Alto Research Center, Inc 48 | This software distribution does not grant any rights to patents owned by Palo 49 | Alto Research Center, Inc (PARC). Rights to these patents are available via 50 | various mechanisms. As of January 2016 PARC has committed to FRAND licensing any 51 | intellectual property used by its contributions to this software. You may 52 | contact PARC at cipo@parc.com for more information or visit http://www.ccnx.org 53 | -------------------------------------------------------------------------------- /dependencies/Makefile.downloader: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2014, Xerox Corporation (Xerox) and Palo Alto Research Center, Inc (PARC) 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # * Redistributions of source code must retain the above copyright 9 | # notice, this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright 11 | # notice, this list of conditions and the following disclaimer in the 12 | # documentation and/or other materials provided with the distribution. 13 | # 14 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | # DISCLAIMED. IN NO EVENT SHALL XEROX OR PARC BE LIABLE FOR ANY 18 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | # 25 | # ################################################################################ 26 | # # 27 | # # PATENT NOTICE 28 | # # 29 | # # This software is distributed under the BSD 2-clause License (see LICENSE 30 | # # file). This BSD License does not make any patent claims and as such, does 31 | # # not act as a patent grant. The purpose of this section is for each contributor 32 | # # to define their intentions with respect to intellectual property. 33 | # # 34 | # # Each contributor to this source code is encouraged to state their patent 35 | # # claims and licensing mechanisms for any contributions made. At the end of 36 | # # this section contributors may each make their own statements. Contributor's 37 | # # claims and grants only apply to the pieces (source code, programs, text, 38 | # # media, etc) that they have contributed directly to this software. 39 | # # 40 | # # There is no guarantee that this section is complete, up to date or accurate. It 41 | # # is up to the contributors to maintain their portion of this section and up to 42 | # # the user of the software to verify any claims herein. 43 | # # 44 | # # Do not remove this header notification. The contents of this section must be 45 | # # present in all distributions of the software. You may only modify your own 46 | # # intellectual property statements. Please provide contact information. 47 | # 48 | # - Palo Alto Research Center, Inc 49 | # This software distribution does not grant any rights to patents owned by Palo 50 | # Alto Research Center, Inc (PARC). Rights to these patents are available via 51 | # various mechanisms. As of January 2016 PARC has committed to FRAND licensing any 52 | # intellectual property used by its contributions to this software. You may 53 | # contact PARC at cipo@parc.com for more information or visit http://www.ccnx.org 54 | # 55 | 56 | # 57 | # We need something to download files 58 | # 59 | 60 | CURL_EXISTS := $(shell which curl) 61 | 62 | ifdef CURL_EXISTS 63 | DOWNLOADER=curl -O -L 64 | else 65 | DOWNLOADER=wget 66 | endif 67 | -------------------------------------------------------------------------------- /dependencies/Makefile.unix: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2014, Xerox Corporation (Xerox) and Palo Alto Research Center, Inc (PARC) 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # * Redistributions of source code must retain the above copyright 9 | # notice, this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright 11 | # notice, this list of conditions and the following disclaimer in the 12 | # documentation and/or other materials provided with the distribution. 13 | # 14 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | # DISCLAIMED. IN NO EVENT SHALL XEROX OR PARC BE LIABLE FOR ANY 18 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | # 25 | # ################################################################################ 26 | # # 27 | # # PATENT NOTICE 28 | # # 29 | # # This software is distributed under the BSD 2-clause License (see LICENSE 30 | # # file). This BSD License does not make any patent claims and as such, does 31 | # # not act as a patent grant. The purpose of this section is for each contributor 32 | # # to define their intentions with respect to intellectual property. 33 | # # 34 | # # Each contributor to this source code is encouraged to state their patent 35 | # # claims and licensing mechanisms for any contributions made. At the end of 36 | # # this section contributors may each make their own statements. Contributor's 37 | # # claims and grants only apply to the pieces (source code, programs, text, 38 | # # media, etc) that they have contributed directly to this software. 39 | # # 40 | # # There is no guarantee that this section is complete, up to date or accurate. It 41 | # # is up to the contributors to maintain their portion of this section and up to 42 | # # the user of the software to verify any claims herein. 43 | # # 44 | # # Do not remove this header notification. The contents of this section must be 45 | # # present in all distributions of the software. You may only modify your own 46 | # # intellectual property statements. Please provide contact information. 47 | # 48 | # - Palo Alto Research Center, Inc 49 | # This software distribution does not grant any rights to patents owned by Palo 50 | # Alto Research Center, Inc (PARC). Rights to these patents are available via 51 | # various mechanisms. As of January 2016 PARC has committed to FRAND licensing any 52 | # intellectual property used by its contributions to this software. You may 53 | # contact PARC at cipo@parc.com for more information or visit http://www.ccnx.org 54 | # 55 | 56 | # 57 | # We need something to detect Unixs 58 | # 59 | 60 | UNAME := $(shell uname) 61 | UNAME_M := $(shell uname -m) 62 | 63 | ifeq (${UNAME},Darwin) 64 | OPENSSL_CONFIGURE=./Configure darwin64-x86_64-cc 65 | else 66 | OPENSSL_CONFIGURE=./config 67 | endif 68 | -------------------------------------------------------------------------------- /config/modules/000-gitModule.mk: -------------------------------------------------------------------------------- 1 | ############################################################ 2 | # Distillery Git Module 3 | # 4 | # This is a framework for Distillery Git Modules. 5 | # 6 | # Modules can add themselves do distillery by calling the addGitModule 7 | # function. A module called Foo would do the following: 8 | # 9 | # $(eval $(call addGitModule,Foo)) 10 | # 11 | # Assumptions 12 | # - The source for Foo is in git, located at: ${DISTILLERY_GITHUB_URL}/Foo 13 | # You can change this via a variable, see bellow. 14 | # 15 | # Parameters: 16 | # This function can be modified by setting some variables for the specified 17 | # module. These variables must be set BEFORE you call the function. replace 18 | # "Module" by the parameter passed on to the funcion. 19 | # 20 | # - Module_GIT_REPOSITORY 21 | # URL to the Git repository of the source. 22 | # Defaults to: ${DISTILLERY_GITHUB_URL}${DISTILLERY_GITHUB_URL_USER}/Foo 23 | # You can modify this to point to a different repository. (git origin) 24 | # - Module_GIT_UPSTREAM_REPOSITORY 25 | # URL to the remote git repository to use as upstream. This defaults to 26 | # ${DISTILLERY_GITHUB_UPSTREAM_URL}/Module. The remote will be added to git 27 | # under the name ${DISTILLERY_GITHUB_UPSTREAM_NAME} 28 | # - Module_SOURCE_DIR 29 | # Location where the source will be downloaded. Don't change this unless you 30 | # have a very good reason to. 31 | # - Module_BUILD_DIR 32 | # Location where the source will be built. Don't change this unless you have 33 | # a very good reason to. 34 | 35 | 36 | define addGitModule 37 | $(eval $1_SOURCE_DIR?=${DISTILLERY_SOURCE_DIR}/$1) 38 | $(eval $1_BUILD_DIR?=${DISTILLERY_BUILD_DIR}/$1) 39 | $(eval $1_GIT_CONFIG?=${$1_SOURCE_DIR}/.git/config) 40 | $(eval $1_GIT_REPOSITORY?=${DISTILLERY_GITHUB_URL}${DISTILLERY_GITHUB_URL_USER}/$1) 41 | $(eval $1_GIT_UPSTREAM_REPOSITORY?=${DISTILLERY_GITHUB_UPSTREAM_URL}/$1) 42 | $(eval gitmodules+=$1) 43 | 44 | status: $1.status 45 | 46 | $1.status: tools/bin/getStatus 47 | @tools/bin/getStatus ${$1_SOURCE_DIR} 48 | 49 | fetch: $1.fetch 50 | 51 | $1.fetch: 52 | @echo -------------------------------------------- 53 | @echo $1 54 | @cd ${$1_SOURCE_DIR}; git fetch --all 55 | 56 | branch: $1.branch 57 | 58 | $1.branch: 59 | @echo -------------------------------------------- 60 | @echo $1 61 | @cd ${$1_SOURCE_DIR}; git branch -avv 62 | @echo 63 | 64 | nuke-all-modules: $1.nuke 65 | 66 | $1.nuke: 67 | @cd ${$1_SOURCE_DIR}; git clean -dfx && git reset --hard 68 | 69 | sync: $1.sync 70 | 71 | $1.sync: ${DISTILLERY_ROOT_DIR}/tools/bin/syncOriginMasterWithPARCUpstream 72 | @echo "-------------------------------------------------------------------" 73 | @echo $1 74 | @cd ${$1_SOURCE_DIR}; ${DISTILLERY_ROOT_DIR}/tools/bin/syncOriginMasterWithPARCUpstream 75 | 76 | update: $1.update 77 | 78 | $1.update: ${$1_GIT_CONFIG} 79 | @echo "-------------------------------------------------------------------" 80 | @echo "- Updating ${$1_SOURCE_DIR}" 81 | @cd ${$1_SOURCE_DIR} && git fetch --all && git pull 82 | @echo 83 | 84 | ${$1_GIT_CONFIG}: tools/bin/gitCloneOneOf tools/bin/gitAddUpstream 85 | @tools/bin/gitCloneOneOf $1 ${$1_SOURCE_DIR} ${$1_GIT_REPOSITORY} ${$1_GIT_UPSTREAM_REPOSITORY} 86 | @tools/bin/gitAddUpstream $1 ${$1_SOURCE_DIR} ${DISTILLERY_GITHUB_UPSTREAM_NAME} ${$1_GIT_UPSTREAM_REPOSITORY} 87 | 88 | info: $1.info 89 | 90 | $1.info: 91 | @echo "# $1 INFO " 92 | @echo "$1_SOURCE_DIR = ${$1_SOURCE_DIR}" 93 | @echo "$1_BUILD_DIR = ${$1_BUILD_DIR}" 94 | @echo "$1_GIT_REPOSITORY = ${$1_GIT_REPOSITORY}" 95 | @echo "$1_GIT_UPSTREAM_REPOSITORY = ${$1_GIT_UPSTREAM_REPOSITORY}" 96 | 97 | gitstatus: $1.gitstatus 98 | 99 | $1.gitstatus: tools/bin/gitStatus 100 | @tools/bin/gitStatus $1 ${$1_SOURCE_DIR} ${$1_GIT_REPOSITORY} \ 101 | ${DISTILLERY_GITHUB_UPSTREAM_NAME} ${$1_GIT_UPSTREAM_REPOSITORY} 102 | 103 | endef 104 | 105 | gitmodule.list: 106 | @echo ${gitmodules} 107 | -------------------------------------------------------------------------------- /tools/bin/syncOriginMasterWithPARCUpstream.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 2016, Xerox Corporation (Xerox) and Palo Alto Research Center, Inc (PARC) 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # 9 | # * Redistributions of source code must retain the above copyright 10 | # notice, this list of conditions and the following disclaimer. 11 | # * Redistributions in binary form must reproduce the above copyright 12 | # notice, this list of conditions and the following disclaimer in the 13 | # documentation and/or other materials provided with the distribution. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | # DISCLAIMED. IN NO EVENT SHALL XEROX OR PARC BE LIABLE FOR ANY 19 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | # 26 | # ################################################################################ 27 | # # 28 | # # PATENT NOTICE 29 | # # 30 | # # This software is distributed under the BSD 2-clause License (see LICENSE 31 | # # file). This BSD License does not make any patent claims and as such, does 32 | # # not act as a patent grant. The purpose of this section is for each contributor 33 | # # to define their intentions with respect to intellectual property. 34 | # # 35 | # # Each contributor to this source code is encouraged to state their patent 36 | # # claims and licensing mechanisms for any contributions made. At the end of 37 | # # this section contributors may each make their own statements. Contributor's 38 | # # claims and grants only apply to the pieces (source code, programs, text, 39 | # # media, etc) that they have contributed directly to this software. 40 | # # 41 | # # There is no guarantee that this section is complete, up to date or accurate. It 42 | # # is up to the contributors to maintain their portion of this section and up to 43 | # # the user of the software to verify any claims herein. 44 | # # 45 | # # Do not remove this header notification. The contents of this section must be 46 | # # present in all distributions of the software. You may only modify your own 47 | # # intellectual property statements. Please provide contact information. 48 | # 49 | # - Palo Alto Research Center, Inc 50 | # This software distribution does not grant any rights to patents owned by Palo 51 | # Alto Research Center, Inc (PARC). Rights to these patents are available via 52 | # various mechanisms. As of January 2016 PARC has committed to FRAND licensing any 53 | # intellectual property used by its contributions to this software. You may 54 | # contact PARC at cipo@parc.com for more information or visit http://www.ccnx.org 55 | # 56 | # @author Alan Walendowski, Palo Alto Research Center (PARC) 57 | # @copyright (c) 2016, Xerox Corporation (Xerox) and Palo Alto Research Center, Inc (PARC). All rights reserved. 58 | 59 | 60 | # This script is intended to sync origin/master with parc_upstream/master. 61 | # It will fetch the changes in parc_upstream, and merge them into to 62 | # origin/master. 63 | # If you were on a different branch than master, you should still be on 64 | # that branch when the script exits. 65 | 66 | CWD=`pwd` 67 | 68 | # The shortname of the repo dir we're syncing 69 | REPO_DIR_NAME=$(basename $CWD) 70 | 71 | # A place to send output to reduce the visual clutter 72 | OUTPUT=/dev/null 73 | 74 | echo "$REPO_DIR_NAME - merging parc_upstream/master into master and origin/master" 75 | 76 | ORIGIN=`git config --get remote.origin.url 2>$OUTPUT` 77 | if [ $? -ne 0 ]; then 78 | echo "Skipped [$REPO_DIR_NAME] No origin found." 79 | exit 0 80 | fi 81 | 82 | # Check if there is a parc_upstream remote at all 83 | PARC_UPSTREAM=`git config --get remote.parc_upstream.url 2>$OUTPUT` 84 | if [ $? -ne 0 ]; then 85 | echo "$REPO_DIR_NAME - No parc_upstream found." 86 | exit 0 87 | fi 88 | 89 | # Fetch ALL of the upstream remotes 90 | git fetch --all >> $OUTPUT 91 | 92 | BRANCH=`git symbolic-ref --short HEAD` 93 | 94 | if [ x'master' != x$BRANCH ]; then 95 | git checkout master &> $OUTPUT 96 | fi 97 | 98 | if [ $? -ne 0 ]; then 99 | echo "$REPO_DIR_NAME " 100 | echo "$REPO_DIR_NAME ##########################################################" 101 | echo "$REPO_DIR_NAME Could not switch to master. " 102 | echo "$REPO_DIR_NAME Please commit any unsaved changes in your branch." 103 | echo "$REPO_DIR_NAME ##########################################################" 104 | echo "$REPO_DIR_NAME " 105 | exit $? 106 | fi 107 | 108 | git merge parc_upstream/master >> $OUTPUT 109 | if [ $? -eq 0 ]; then 110 | echo "$REPO_DIR_NAME - parc_upstream/master successfully merged into master" 111 | 112 | if [ $PARC_UPSTREAM != $ORIGIN ]; then 113 | git push --porcelain 2>&1 >> $OUTPUT 114 | echo "$REPO_DIR_NAME - master pushed to origin/master" 115 | fi 116 | else 117 | echo "$REPO_DIR_NAME - WARNING - was not able to be synced with parc_upstream/master" 118 | fi 119 | 120 | if [ x'master' != x$BRANCH ]; then 121 | echo "$REPO_DIR_NAME - Switching back to branch <$BRANCH>" 122 | git checkout $BRANCH &> $OUTPUT 123 | fi 124 | 125 | exit $? 126 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Distillery 2.0 2 | 3 | This is the CCNx Distillery software distribution. It is in charge of pulling 4 | together all the necessary modules to build a full CCNx software suite. 5 | 6 | While Distillery brings a bunch of modules together; each module is 7 | independent. As such, each may be from a different author or institution and 8 | have it's own set of requirements. Please read their respective documentation. 9 | 10 | Distillery provices a set of features for building CCNx software as well as 11 | tools for writing, testing and evaluating code. 12 | 13 | For Distillery licensing information please read the LICENSE file. 14 | 15 | # Deprecated Code # 16 | This repository is no longer active. See the [Community ICN](https://wiki.fd.io/view/Cicn) project 17 | for the latest code. The [CICN Code Repository](https://github.com/FDio/cicn) should be used for all new projects. 18 | 19 | ## Quick Start ## 20 | 21 | ``` 22 | # Clone this distro 23 | git clone git@github.com:parc-ccnx-archive/CCNx_Distillery.git 24 | cd CCNx_Distillery 25 | 26 | # Install dependencies (if needed) 27 | make dependencies 28 | 29 | # Update each of the modules 30 | make update 31 | 32 | # Compile everything 33 | make all 34 | 35 | # Test everything 36 | make check 37 | ``` 38 | 39 | The CCNx software will be installed in `CCNx_Distillery/usr` 40 | 41 | ## Contents ## 42 | 43 | Distillery brings together a set of modules that are needed to build a full CCNx distribution. It checks each one out and compiles them in order. The modules used by Distillery can be configured and customized. By default the following modules are included: 44 | 45 | - [LongBow](https://github.com/parc-ccnx-archive/LongBow) 46 | - [Libparc](https://github.com/parc-ccnx-archive/Libparc) 47 | - [Libccnx-common](https://github.com/parc-ccnx-archive/Libccnx-common) 48 | - [Libccnx-transport-rta](https://github.com/parc-ccnx-archive/Libccnx-transport-rta) 49 | - [Libccnx-portal](https://github.com/parc-ccnx-archive/Libccnx-portal) 50 | - [Metis](https://github.com/parc-ccnx-archive/Metis) 51 | - [Athena](https://github.com/parc-ccnx-archive/Athena) 52 | 53 | ## Platforms ## 54 | 55 | - Ubuntu 14.04LTS 56 | - MacOS X 10.10 Yosemite 57 | - MacOS X 10.11 El Capitan 58 | 59 | We on Linux and Mac and spend most of our time in Ubuntu and El Capitan. The software does run on other environemnts, both other OSs and other architectures. However we don't do much testing on this. Distillery has been known to work on ARM and MIPS, Debian and Android. 60 | 61 | With time we expect portability will improve. 62 | 63 | ## Dependencies ## 64 | 65 | You can install dependencies from Distillery with the command: `make dependencies`. We keep the dependency install as up-to-date as possible but it may fall out of date every once in a while. 66 | 67 | For Ubuntu/Debian Linux systems you can install many of the dependencies via apt-get / aptitude or the relevant package manager. While we aim to keep our depedencies in sync with what's available with Ubuntu 14.04LTS this is not always possible. 68 | 69 | On Mac we install most of what we need by downloading and compiling the respective tarballs. 70 | 71 | Currently Distillery has the following main dependencies: 72 | 73 | - CMake 3.4.3 74 | - Libevent 2.0.22 75 | - OpenSSL 1.0.1q 76 | - pcre 8.38 77 | 78 | LongBow can also make use of the following tools: 79 | 80 | - uncrustify 0.61 81 | - doxygen 1.8.9.1 82 | 83 | 84 | ## Getting Started ## 85 | 86 | To get simple help run `make`. This will give you a list of possible targets to 87 | execute. You will basically want to download all the sources and compile. 88 | 89 | Here's a short summary: 90 | 91 | - `make dependencies` - Make the dependencies needed to build Distillery 92 | - `make update` - Update all the source modules (git clone / git pull) 93 | - `make all` - Compile all the software 94 | - `make check` - Run all unit tests 95 | - `make step` - Compile and test each module in sequence 96 | - `make info` - Show some of the environment variables used by Distillery 97 | - `make status` - Show the git status of each module 98 | - `make distclean` - Delete build directory (but not built executables) 99 | - `make clobber` - Delete build directory and install directories. WARNING - If you configure this to install on a system directory this may delete system files! 100 | 101 | 102 | ## Configuration ## 103 | 104 | Distillery can be configured in multiple ways. Please check the config directory (specifically `config/config.mk`) for more information. 105 | 106 | ## Contact ## 107 | 108 | You can find more information about CCNx at the main web page, [CCNx.org](http://www.ccnx.org). 109 | Discussion about CCNx Distillery takes place in the [CCNx mailing list](https://www.ccnx.org/mailman/listinfo/ccnx/), please join the discussion there. You can also file any issues you find on the [CCNx Distillery github](https://github.com/parc-ccnx-archive/CCNx_Distillery). 110 | 111 | 112 | ## License ## 113 | 114 | This software is distributed under the following license: 115 | 116 | ``` 117 | Copyright (c) 2013,2014,2015,2016, Xerox Corporation (Xerox) and Palo Alto Research Center, Inc (PARC) 118 | All rights reserved. 119 | 120 | Redistribution and use in source and binary forms, with or without 121 | modification, are permitted provided that the following conditions are met: 122 | 123 | * Redistributions of source code must retain the above copyright 124 | notice, this list of conditions and the following disclaimer. 125 | * Redistributions in binary form must reproduce the above copyright 126 | notice, this list of conditions and the following disclaimer in the 127 | documentation and/or other materials provided with the distribution. 128 | 129 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 130 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 131 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 132 | DISCLAIMED. IN NO EVENT SHALL XEROX OR PARC BE LIABLE FOR ANY 133 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 134 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 135 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 136 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 137 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 138 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 139 | 140 | ################################################################################ 141 | # 142 | # PATENT NOTICE 143 | # 144 | # This software is distributed under the BSD 2-clause License (see LICENSE 145 | # file). This BSD License does not make any patent claims and as such, does 146 | # not act as a patent grant. The purpose of this section is for each contributor 147 | # to define their intentions with respect to intellectual property. 148 | # 149 | # Each contributor to this source code is encouraged to state their patent 150 | # claims and licensing mechanisms for any contributions made. At the end of 151 | # this section contributors may each make their own statements. Contributor's 152 | # claims and grants only apply to the pieces (source code, programs, text, 153 | # media, etc) that they have contributed directly to this software. 154 | # 155 | # There is no guarantee that this section is complete, up to date or accurate. It 156 | # is up to the contributors to maintain their portion of this section and up to 157 | # the user of the software to verify any claims herein. 158 | # 159 | # Do not remove this header notification. The contents of this section must be 160 | # present in all distributions of the software. You may only modify your own 161 | # intellectual property statements. Please provide contact information. 162 | 163 | - Palo Alto Research Center, Inc 164 | This software distribution does not grant any rights to patents owned by Palo 165 | Alto Research Center, Inc (PARC). Rights to these patents are available via 166 | various mechanisms. As of January 2016 PARC has committed to FRAND licensing any 167 | intellectual property used by its contributions to this software. You may 168 | contact PARC at cipo@parc.com for more information or visit http://www.ccnx.org 169 | ``` 170 |
shopify visitor statistics
174 | -------------------------------------------------------------------------------- /config/config.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016, Xerox Corporation (Xerox) and Palo Alto Research Center, Inc (PARC) 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # * Redistributions of source code must retain the above copyright 9 | # notice, this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright 11 | # notice, this list of conditions and the following disclaimer in the 12 | # documentation and/or other materials provided with the distribution. 13 | # 14 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | # DISCLAIMED. IN NO EVENT SHALL XEROX OR PARC BE LIABLE FOR ANY 18 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | # 25 | # ################################################################################ 26 | # # 27 | # # PATENT NOTICE 28 | # # 29 | # # This software is distributed under the BSD 2-clause License (see LICENSE 30 | # # file). This BSD License does not make any patent claims and as such, does 31 | # # not act as a patent grant. The purpose of this section is for each contributor 32 | # # to define their intentions with respect to intellectual property. 33 | # # 34 | # # Each contributor to this source code is encouraged to state their patent 35 | # # claims and licensing mechanisms for any contributions made. At the end of 36 | # # this section contributors may each make their own statements. Contributor's 37 | # # claims and grants only apply to the pieces (source code, programs, text, 38 | # # media, etc) that they have contributed directly to this software. 39 | # # 40 | # # There is no guarantee that this section is complete, up to date or accurate. It 41 | # # is up to the contributors to maintain their portion of this section and up to 42 | # # the user of the software to verify any claims herein. 43 | # # 44 | # # Do not remove this header notification. The contents of this section must be 45 | # # present in all distributions of the software. You may only modify your own 46 | # # intellectual property statements. Please provide contact information. 47 | # 48 | # - Palo Alto Research Center, Inc 49 | # This software distribution does not grant any rights to patents owned by Palo 50 | # Alto Research Center, Inc (PARC). Rights to these patents are available via 51 | # various mechanisms. As of January 2016 PARC has committed to FRAND licensing any 52 | # intellectual property used by its contributions to this software. You may 53 | # contact PARC at cipo@parc.com for more information or visit http://www.ccnx.org 54 | # 55 | 56 | ############################################################################### 57 | # 58 | # Distillery default configuration 59 | # 60 | # DO NOT EDIT THIS FILE!! 61 | # 62 | # You can set your user configuration in the file ${HOME}/.ccnx/distillery/config.mk 63 | # You can set your local configuration in the file [DISTILLERY]/config/config.mk 64 | # You can use this file as a template. It will be included in the Makefile. 65 | # 66 | # Make will first parse the USER_CONFIG file. Later the LOCAL_CONFIG file. 67 | # Finally the DEFAULT_CONFIG file will be parsed. 68 | # 69 | # If variables are directly assigned (=), they will override previous definitions 70 | # If variables are conditionally assigned (?=) then the previous value will 71 | # carry. This default file will use conditional assignments for statements. So 72 | # if the variables are assigned in the USER_CONFIG or LOCAL_CONFIG files they 73 | # will NOT be overriden. Only in the case when a variable is not defined it 74 | # will be defined by this file. 75 | # 76 | # In the most typical situations the USER_CONFIG and LOCAL_CONFIG will use 77 | # direct assignment of variables. 78 | # 79 | ############################################################################### 80 | 81 | #DISTILLERY_GITHUB_URL 82 | # The base URL from where modules will be checked out. 83 | # Note that this must include the trailing character 84 | DISTILLERY_GITHUB_URL?=https://github.com/ 85 | 86 | #DISTILLERY_GITHUB_URL_USER=parc-ccnx-archive 87 | # The user where we check the repositories from 88 | DISTILLERY_GITHUB_URL_USER?=parc-ccnx-archive 89 | 90 | #DISTILLERY_GITHUB_UPSTREAM_URL=git://github.com/parc-ccnx-archive 91 | # The URL of the github upstream for the repositories 92 | DISTILLERY_GITHUB_UPSTREAM_URL?=git://github.com/parc-ccnx-archive 93 | 94 | #DISTILLERY_GITHUB_UPSTREAM_NAME?=parc_upstream 95 | # The name to give this upstream 96 | DISTILLERY_GITHUB_UPSTREAM_NAME?=parc_upstream 97 | 98 | # DISTILLERY_GITHUB_UPSTREAM_REPO=${DISTILLERY_GITHUB_UPSTREAM_URL}/CCNx_Distillery 99 | # The upstream that we expect on Distillery itself. 100 | DISTILLERY_GITHUB_UPSTREAM_REPO?=${DISTILLERY_GITHUB_UPSTREAM_URL}/CCNx_Distillery 101 | 102 | # DISTILLERY_ROOT_DIR=/path/to/root/dir 103 | # This is the root directory of the Distillery distribution. Many other paths depend 104 | # on this. This file assumes that make is being run from the DISTILLERY 105 | # directory. If this is not true, it's convenient to assign the variable at the 106 | # shell. 107 | DISTILLERY_ROOT_DIR?=$(shell pwd) 108 | 109 | # This is a variable that can be used to multiplex the build. 110 | # If you set this variable the default output directories will have this 111 | # appended to them 112 | DISTILLERY_BUILD_NAME?= 113 | 114 | # This is the directory where things are built. 115 | # Note that if some modules don't support off-tree builds you may have problems 116 | DISTILLERY_BUILD_DIR?=${DISTILLERY_ROOT_DIR}/build${DISTILLERY_BUILD_NAME} 117 | 118 | # This is the directory where the source is checked out. 119 | DISTILLERY_SOURCE_DIR?=${DISTILLERY_ROOT_DIR}/src 120 | 121 | # MAKE_BUILD_FLAGS 122 | # Flags to pass to make when building the projects. This is mostly used for 123 | # parallel builds. Disable by setting it to empty 124 | MAKE_BUILD_FLAGS?=-j8 125 | 126 | # DISTILLERY_INSTALL_DIR=/path/to/install/dir 127 | # This is the directory where all the ccn software will be installed. This 128 | # directory will be DELETED if you do a make clobber. Do not treat this the 129 | # same way you would treat a system install directory. 130 | DISTILLERY_INSTALL_DIR?=${DISTILLERY_ROOT_DIR}/usr${DISTILLERY_BUILD_NAME} 131 | 132 | # DISTILLERY_DEPENDENCIES_DIR=/path/to/dependencies/dir 133 | # This is the path to the dependencies directory. It is used as the base for 134 | # the dependencies install directories. (tools and libraries) 135 | # You should normally not edit this variable. 136 | DISTILLERY_DEPENDENCIES_DIR?=/usr/local/ccnx/dependencies 137 | 138 | # DISTILLERY_EXTERN_DIR=/path/to/dependencies/external/install/dir 139 | # This is the directory where the dependencies will be installed. This 140 | # directory is deleted and created as needed by the dependencies system. 141 | # It is used in gravy for includes and linking. This should be for the TARGET 142 | # architecture. 143 | DISTILLERY_EXTERN_DIR?=${DISTILLERY_DEPENDENCIES_DIR}/build 144 | CCNX_DEPENDENCIES?=${DISTILLERY_EXTERN_DIR} 145 | export CCNX_DEPENDENCIES 146 | 147 | # DISTILLERY_TOOLS_DIR=/path/to/dependency/tools/dir 148 | # This directory holds some of the tools needed to build libccnx. It should be 149 | # built for the HOST. The directory might be deleted and rebuilt by the 150 | # dependency system. The directory will be included in the execution PATH as 151 | # Distillery builds all the modules. 152 | DISTILLERY_TOOLS_DIR?=${DISTILLERY_DEPENDENCIES_DIR}/build-tools 153 | 154 | # DISTILLERY_XCODE_DIR?=${DISTILLERY_ROOT_DIR}/xcode 155 | # Directory where distillery will create the xcode project files. This is done 156 | # via cmake's build system. Modules that don't use cmake won't have a way to 157 | # create this unless the Makefile provides a way. 158 | DISTILLERY_XCODE_DIR?=${DISTILLERY_ROOT_DIR}/xcode 159 | 160 | # CMAKE_MAKE_TEST_ARGS="ARGS=-j16" 161 | # Tell CTest (via CMake) to run parallel tests (16) 162 | # To run only 1 test at a time run with -j1 or set it empty 163 | CMAKE_MAKE_TEST_ARGS?="ARGS=-j16" 164 | 165 | 166 | # CMAKE_BUILD_TYPE_FLAG=-DCMAKE_BUILD_TYPE=DEBUG 167 | # The type of build we are doing. 168 | # set it to RELEASE if you want an optimized build (-O3) 169 | # Options: 170 | # DEBUG eg. -O0 -g 171 | # RELEASE eg. -O3 -NDEBUG 172 | # RELWITHDEBINFO eg -O2 -g -NDEBUG 173 | #CMAKE_BUILD_TYPE_FLAG?=-DCMAKE_BUILD_TYPE=RELEASE 174 | 175 | # DISABLE_UBUNTU_PACKAGE_CHECK 176 | # This setting disables checking that the ubuntu packages are installed. In the default 177 | # mode the build will fail if the packages are not installed. 178 | # See the related setting DISABLE_UBUNTU_CHECK for system checks. 179 | # NOTE: Any value is considered true! 180 | #DISABLE_UBUNTU_PACKAGE_CHECK=True 181 | 182 | # DISABLE_UBUNTU_CHECK 183 | # This setting disables checking that the current system is the supported Ubuntu version 184 | # If you are on Linux, and it's not the supported ubuntu version the build will fail. 185 | # If you disable this setting the build system will not check. (For example if you wanted to build 186 | # on Debian. See the related setting DISABLE_UBUNTU_PACKAGE_CHECK 187 | # NOTE: Any value is considered true! 188 | #DISABLE_UBUNTU_CHECK=True 189 | 190 | # CCNX_HOME 191 | # These variables are used by scripts to know where to find the installed 192 | # CCNX software and libaries. They are also used by various packaging scripts. 193 | CCNX_HOME=${DISTILLERY_INSTALL_DIR} 194 | -------------------------------------------------------------------------------- /tools/bin/sanityCheck-FileTransfer.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # 3 | # Copyright (c) 2015, Xerox Corporation (Xerox) and Palo Alto Research Center, Inc (PARC) 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # 9 | # * Redistributions of source code must retain the above copyright 10 | # notice, this list of conditions and the following disclaimer. 11 | # * Redistributions in binary form must reproduce the above copyright 12 | # notice, this list of conditions and the following disclaimer in the 13 | # documentation and/or other materials provided with the distribution. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | # DISCLAIMED. IN NO EVENT SHALL XEROX OR PARC BE LIABLE FOR ANY 19 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | # 26 | # ################################################################################ 27 | # # 28 | # # PATENT NOTICE 29 | # # 30 | # # This software is distributed under the BSD 2-clause License (see LICENSE 31 | # # file). This BSD License does not make any patent claims and as such, does 32 | # # not act as a patent grant. The purpose of this section is for each contributor 33 | # # to define their intentions with respect to intellectual property. 34 | # # 35 | # # Each contributor to this source code is encouraged to state their patent 36 | # # claims and licensing mechanisms for any contributions made. At the end of 37 | # # this section contributors may each make their own statements. Contributor's 38 | # # claims and grants only apply to the pieces (source code, programs, text, 39 | # # media, etc) that they have contributed directly to this software. 40 | # # 41 | # # There is no guarantee that this section is complete, up to date or accurate. It 42 | # # is up to the contributors to maintain their portion of this section and up to 43 | # # the user of the software to verify any claims herein. 44 | # # 45 | # # Do not remove this header notification. The contents of this section must be 46 | # # present in all distributions of the software. You may only modify your own 47 | # # intellectual property statements. Please provide contact information. 48 | # 49 | # - Palo Alto Research Center, Inc 50 | # This software distribution does not grant any rights to patents owned by Palo 51 | # Alto Research Center, Inc (PARC). Rights to these patents are available via 52 | # various mechanisms. As of January 2016 PARC has committed to FRAND licensing any 53 | # intellectual property used by its contributions to this software. You may 54 | # contact PARC at cipo@parc.com for more information or visit http://www.ccnx.org 55 | # 56 | # @author Ignacio (Nacho) Solis, Palo Alto Research Center (PARC) 57 | # @copyright (c) 2015, Xerox Corporation (Xerox) and Palo Alto Research Center, Inc (PARC). All rights reserved. 58 | # 59 | 60 | import os, signal, shutil, sys 61 | import tempfile 62 | import hashlib 63 | import time 64 | import random 65 | import string 66 | 67 | ## 68 | ## A quick way to test metis and the ccnxSimpleFileTransfer_Server/ccnxSimpleFileTransfer_Client end to end. 69 | ## 70 | ## Starts a forwarder, creates a test data file in a temp directory, and tries to 71 | ## transfer the file using the ccnxSimpleFileTransfer example. It prints a message and returns 0 if 72 | ## successful. It prints another message and returns non-0 if there's a failure. 73 | ## 74 | ## Usage: sanityCheck-FileTransfer.py /path/to/build/bin 75 | ## e.g. > sanityCheck-FileTransfer.py /home/you/CCNx_Distillery/usr/bin 76 | ## 77 | ## It will timeout in MAX_SECONDS_TO_WAIT_FOR_COMPLETION seconds, so can be used 78 | ## in automation scripts. 79 | ## 80 | 81 | # Exit values 82 | STATUS_OK = 0 83 | STATUS_NEED_ARGUMENTS = 5 84 | STATUS_COPY_FAILED = 10 85 | STATUS_CHECKSUM_FAILED = 20 86 | STATUS_MISSING_BINARIES = 30 87 | STATUS_UNKNOWN_ERROR = 99 88 | 89 | # The size of the file to create and transfer 90 | TEST_FILE_SIZE = 1024 * 1024 * 2 # 2M 91 | 92 | # How long to wait before killing child processes 93 | MAX_SECONDS_TO_WAIT_FOR_COMPLETION = 55.0 # This is a function of file size and bandwidth 94 | 95 | FORWARDER = "athena" 96 | 97 | ## 98 | ## Generator to return bytes, in chunks, from a file 99 | ## 100 | def getBytesFromFile(filePath, chunksize=8192): 101 | with open(filePath, "rb") as f: 102 | while True: 103 | chunk = f.read(chunksize) 104 | if chunk: 105 | for b in chunk: 106 | yield b 107 | else: 108 | break 109 | 110 | ## 111 | ## Calculate the checksum of a given file 112 | ## 113 | def getChecksumOfFile(filePath): 114 | checksum = None 115 | hasher = hashlib.md5() 116 | 117 | for b in getBytesFromFile(filePath): 118 | hasher.update(b); 119 | 120 | checksum = hasher.hexdigest() 121 | return checksum 122 | 123 | ## 124 | ## Given two directories and a filename, check that the 125 | ## file exists in both directories and has the same 126 | ## contents. 127 | ## 128 | def verifyChecksums(sourceDir, sinkDir, fileName): 129 | sourceFile = '%s/%s' % (sourceDir, fileName) 130 | sinkFile = '%s/%s' % (sinkDir, fileName) 131 | 132 | sourceSize = os.path.getsize(sourceFile) 133 | sinkSize = os.path.getsize(sinkFile) 134 | 135 | print "Comparing original [%d bytes] to copy [%d bytes]" % (sourceSize, sinkSize) 136 | if (sinkSize != sourceSize): 137 | print "The size of the copy did not match the size of the original" 138 | return False 139 | 140 | print "Comparing\n [%s] to\n [%s] " % (sourceFile, sinkFile) 141 | 142 | result = False 143 | try: 144 | sourceSum = getChecksumOfFile(sourceFile) 145 | sinkSum = getChecksumOfFile(sinkFile) 146 | result = (sourceSum == sinkSum) 147 | except: 148 | result = False 149 | 150 | return result 151 | 152 | ## 153 | ## Create something to transfer around 154 | ## 155 | def createTestFile(dir, fileName): 156 | fullPath = '%s/%s' % (dir, fileName) 157 | 158 | print "Generating test file of size >= %d bytes ... " % TEST_FILE_SIZE 159 | 160 | testFile = open(fullPath, 'w+') 161 | numBytesWritten = 0 162 | 163 | while numBytesWritten < TEST_FILE_SIZE: 164 | #bytes = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' 165 | bytes = ''.join(random.choice(string.ascii_uppercase 166 | + string.digits) for _ in range(80)) 167 | testFile.write(bytes) 168 | numBytesWritten = numBytesWritten + len(bytes) 169 | #print "Wrote: ",bytes, numBytesWritten, len(bytes) 170 | 171 | testFile.close() 172 | 173 | return fullPath 174 | 175 | ## 176 | ## Create our temp directories and test file 177 | ## 178 | def createTestData(): 179 | testDir = tempfile.mkdtemp() 180 | sourceDir = '%s/sourceDir' % testDir 181 | sinkDir = '%s/sinkDir' % testDir 182 | 183 | os.mkdir(sourceDir) 184 | os.mkdir(sinkDir) 185 | 186 | fileName = 'testData.txt' 187 | fullNameOfData = createTestFile(sourceDir, fileName) 188 | 189 | return (testDir, sourceDir, sinkDir, fileName) 190 | 191 | 192 | ## 193 | ## Spawn a child process 194 | ## 195 | def spawnChildProcess(workingDir, path, name, args): 196 | pid = os.fork() 197 | 198 | if pid == 0: 199 | # In the child. 200 | print "Starting [%s]" % name 201 | os.chdir(workingDir) 202 | os.execv(path, ['SANITY-' + name] + args) 203 | 204 | return pid 205 | 206 | 207 | ## 208 | ## Spawn the tutorialClient, but wait for it to finish transferring the 209 | ## specified file. 210 | ## 211 | def transferData(binDir, sinkDir, fileName): 212 | result = False 213 | 214 | pid = None 215 | try: 216 | print "Starting ccnxSimpleFileTransfer_Client, in [%s]" % sinkDir 217 | childPID = spawnChildProcess(sinkDir, 218 | '%s/ccnxSimpleFileTransfer_Client' % binDir, 219 | 'ccnxSimpleFileTransfer_Client', ['fetch', fileName]) 220 | 221 | #os.waitpid(childPID, 0) 222 | waitSeconds = MAX_SECONDS_TO_WAIT_FOR_COMPLETION 223 | sleepTime = 1.0 224 | while waitSeconds > 0: 225 | time.sleep(sleepTime) 226 | print "Waiting for client to complete. Time out in %4.2f seconds..." % waitSeconds 227 | waitSeconds = waitSeconds - sleepTime 228 | pid, err_code = os.waitpid(childPID, os.WNOHANG) 229 | #print "pid, err", pid, err_code 230 | 231 | if pid != 0: # Child process finished 232 | childPID = None 233 | if err_code >> 8 == 0: 234 | result = True 235 | break; 236 | 237 | except(exc): 238 | print "Error running ccnxSimpleFileTransfer_Client", exc 239 | result = False 240 | 241 | finally: 242 | if childPID and childPID != 0: 243 | print "Killing ccnxSimpleFileTransfer_Client... (pid %d)" % childPID 244 | os.kill(childPID, signal.SIGTERM) 245 | 246 | return result 247 | 248 | 249 | ## 250 | ## Run the checks, given a directory in which to find metis and the tutorial binaries 251 | ## 252 | def runFileTransferSanityCheck(binDir): 253 | result = STATUS_UNKNOWN_ERROR 254 | forwarderPID = None 255 | serverPID = None 256 | testDir = None 257 | 258 | try: 259 | # Start a forwarder 260 | forwarderPID = spawnChildProcess('.', 261 | '%s/%s' % (binDir, FORWARDER), 262 | FORWARDER, []) 263 | 264 | # create some test data while it starts... 265 | testDir, sourceDir, sinkDir, dataFile = createTestData() 266 | 267 | # start the ccnxSimpleFileTransfer_Server 268 | serverPID = spawnChildProcess(sourceDir, 269 | '%s/ccnxSimpleFileTransfer_Server' % binDir, 270 | 'ccnxSimpleFileTransfer_Server', [sourceDir]) 271 | 272 | # wait for it... 273 | time.sleep(1) 274 | 275 | # Run the ccnxSimpleFileTransfer_Client and transfer the test file from the sourceDir 276 | # to the sinkDir. This will block until ccnxSimpleFileTransfer_Client finishes. 277 | if transferData(binDir, sinkDir, dataFile): 278 | 279 | # Verify that the copied file matches the source 280 | if verifyChecksums(sourceDir, sinkDir, dataFile): 281 | print "\n\n>>>> Looks good! <<<<\n\n" 282 | result = STATUS_OK 283 | else: 284 | print "\n\n>>>> Checksum test failed. <<<<\n\n" 285 | result = STATUS_CHECKSUM_FAILED 286 | 287 | else: 288 | print "\n\n>>>> File transfer failed. <<<<\n\n" 289 | result = STATUS_COPY_FAILED 290 | 291 | except: 292 | # Need to be more specific... 293 | print "Unexpected error:", sys.exc_info()[0] 294 | result = STATUS_UNKNOWN_ERROR 295 | 296 | finally: 297 | # kill ccnxSimpleFileTransfer_Server 298 | if serverPID: 299 | print "Killing ccnxSimpleFileTransfer_Server..." 300 | os.kill(serverPID, signal.SIGTERM) 301 | 302 | # kill metis 303 | if forwarderPID: 304 | print "Killing metis..." 305 | os.kill(forwarderPID, signal.SIGTERM) 306 | 307 | # remove the tmp directories and test data 308 | print "Removing generated test directories..." 309 | #os.removedirs(testDir) 310 | if testDir: 311 | shutil.rmtree(testDir) 312 | 313 | return result 314 | 315 | def checkBinariesExist(binDir): 316 | result = True 317 | apps = ['athena', 'metis_daemon', 318 | 'ccnxSimpleFileTransfer_Client', 319 | 'ccnxSimpleFileTransfer_Server'] 320 | for app in apps: 321 | appPath = '%s/%s' % (binDir, app) 322 | if not os.path.isfile(appPath): 323 | result = False 324 | print "Can't find:", appPath 325 | 326 | return result 327 | 328 | 329 | if __name__ == '__main__': 330 | 331 | result = STATUS_UNKNOWN_ERROR 332 | 333 | if (len(sys.argv) < 2): 334 | print "\nUsage: sanityCheck-FileTransfer.py /path/to/distillery/build/bin\n" 335 | result = STATUS_NEED_ARGUMENTS 336 | else: 337 | binDir = os.path.abspath(sys.argv[1]) 338 | if checkBinariesExist(binDir): 339 | result = runFileTransferSanityCheck(binDir) 340 | else: 341 | result = STATUS_MISSING_BINARIES 342 | 343 | if result == STATUS_OK: 344 | print "Test successful. Returning [%d]" % result 345 | else: 346 | print "Test failed. Returning [%d]" % result 347 | 348 | sys.exit(result) 349 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2015-2016, Xerox Corporation (Xerox) and Palo Alto Research Center, Inc (PARC) 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # * Redistributions of source code must retain the above copyright 9 | # notice, this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright 11 | # notice, this list of conditions and the following disclaimer in the 12 | # documentation and/or other materials provided with the distribution. 13 | # 14 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | # DISCLAIMED. IN NO EVENT SHALL XEROX OR PARC BE LIABLE FOR ANY 18 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | # 25 | # ################################################################################ 26 | # # 27 | # # PATENT NOTICE 28 | # # 29 | # # This software is distributed under the BSD 2-clause License (see LICENSE 30 | # # file). This BSD License does not make any patent claims and as such, does 31 | # # not act as a patent grant. The purpose of this section is for each contributor 32 | # # to define their intentions with respect to intellectual property. 33 | # # 34 | # # Each contributor to this source code is encouraged to state their patent 35 | # # claims and licensing mechanisms for any contributions made. At the end of 36 | # # this section contributors may each make their own statements. Contributor's 37 | # # claims and grants only apply to the pieces (source code, programs, text, 38 | # # media, etc) that they have contributed directly to this software. 39 | # # 40 | # # There is no guarantee that this section is complete, up to date or accurate. It 41 | # # is up to the contributors to maintain their portion of this section and up to 42 | # # the user of the software to verify any claims herein. 43 | # # 44 | # # Do not remove this header notification. The contents of this section must be 45 | # # present in all distributions of the software. You may only modify your own 46 | # # intellectual property statements. Please provide contact information. 47 | # 48 | # - Palo Alto Research Center, Inc 49 | # This software distribution does not grant any rights to patents owned by Palo 50 | # Alto Research Center, Inc (PARC). Rights to these patents are available via 51 | # various mechanisms. As of January 2016 PARC has committed to FRAND licensing any 52 | # intellectual property used by its contributions to this software. You may 53 | # contact PARC at cipo@parc.com for more information or visit http://www.ccnx.org 54 | # 55 | 56 | ############################################################## 57 | # 58 | # CCNx Distillery project 59 | # 60 | # See LICENSE FILE 61 | # Ignacio Solis 62 | # 63 | # This is the main Makefile for the Distillery CCNx distribution. 64 | # It is in charge of pulling in all necessary modules to build a full CCNx 65 | # system. 66 | # There is normally no need to modify this file. You can run "make help" to get 67 | # more information or you can go directly to the configuration files to modify 68 | # behavior. 69 | 70 | DISTILLERY_VERSION=2.0 71 | 72 | default.target: help 73 | 74 | all: install-all 75 | 76 | ############################################################## 77 | # Variables 78 | # 79 | # Set some variables 80 | DISTILLERY_STAMP=.distillery.stamp 81 | REBUILD_DEPENDS= 82 | 83 | ############################################################## 84 | # Load the configuration 85 | # 86 | # For more information please see config.default.mk 87 | # 88 | DISTILLERY_CONFIG_DIR ?= config 89 | DISTILLERY_USER_CONFIG_DIR ?= ${HOME}/.ccnx/distillery 90 | 91 | DISTILLERY_DEFAULT_CONFIG ?= ${DISTILLERY_CONFIG_DIR}/config.mk 92 | DISTILLERY_LOCAL_CONFIG ?= ${DISTILLERY_CONFIG_DIR}/local/config.mk 93 | DISTILLERY_USER_CONFIG ?= ${DISTILLERY_USER_CONFIG_DIR}/config.mk 94 | 95 | ifneq (,$(wildcard ${DISTILLERY_USER_CONFIG})) 96 | include ${DISTILLERY_USER_CONFIG} 97 | REBUILD_DEPENDS+=${DISTILLERY_USER_CONFIG} 98 | else 99 | DISTILLERY_USER_CONFIG+="[Not Found]" 100 | endif 101 | 102 | ifneq (,$(wildcard ${DISTILLERY_LOCAL_CONFIG})) 103 | include ${DISTILLERY_LOCAL_CONFIG} 104 | REBUILD_DEPENDS+=${DISTILLERY_LOCAL_CONFIG} 105 | endif 106 | 107 | include ${DISTILLERY_DEFAULT_CONFIG} 108 | 109 | 110 | ############################################################## 111 | # Set the paths 112 | # 113 | # PATH: add our install dir, build dependencies and system dependencies 114 | # LD_RUN_PATH: add our install dir 115 | 116 | export PATH := $(DISTILLERY_INSTALL_DIR)/bin:$(DISTILLERY_TOOLS_DIR)/bin:$(PATH) 117 | #export LD_RUN_PATH := $(DISTILLERY_INSTALL_DIR)/lib 118 | #export LD_LIBRARY_PATH := $(DISTILLERY_INSTALL_DIR)/lib 119 | export CCNX_HOME 120 | export FOUNDATION_HOME 121 | 122 | 123 | ############################################################## 124 | # Modules 125 | # 126 | # Load the modules config. Please refer to that file for more information 127 | DISTILLERY_MODULES_DIR=${DISTILLERY_CONFIG_DIR}/modules 128 | 129 | # The modules variable is a list of modules. It will be populated by the 130 | # modules config files. 131 | modules= 132 | modules_dir= 133 | 134 | include ${DISTILLERY_MODULES_DIR}/*.mk 135 | 136 | # Load user defined modules 137 | DISTILLERY_USER_MODULES_DIR=${DISTILLERY_USER_CONFIG_DIR}/modules 138 | ifneq (,$(wildcard ${DISTILLERY_USER_MODULES_DIR})) 139 | include ${DISTILLERY_USER_MODULES_DIR}/*.mk 140 | else 141 | DISTILLERY_USER_MODULES_DIR+="[Not Found]" 142 | endif 143 | 144 | ifdef ${DISTILLERY_LOCAL_MODULES_DIR} 145 | include ${DISTILLERY_LOCAL_MODULES_DIR}/*.mk 146 | else 147 | DISTILLERY_LOCAL_MODULES_DIR="[Undefined]" 148 | endif 149 | 150 | 151 | ############################################################## 152 | # Build variables and rules 153 | # 154 | 155 | # We're going to create lists of targets as convenience 156 | modules_clean=$(modules:=.clean) 157 | modules_check=$(modules:=.check) 158 | modules_step=$(modules:=.step) 159 | modules_average-coverage=$(modules:=.average-coverage) 160 | 161 | # These are the basic build rules. They will call the module specific rules 162 | install-all: install-directories pre-requisites ${modules} 163 | 164 | #distillery-sync: distillery-update ${DISTILLERY_ROOT_DIR}/tools/bin/syncOriginMasterWithPARCUpstream 165 | # @${DISTILLERY_ROOT_DIR}/tools/bin/syncOriginMasterWithPARCUpstream 166 | 167 | clobber: distclean 168 | @rm -rf ${CONFIGURE_CACHE_FILE} 169 | @rm -rf ${DISTILLERY_INSTALL_DIR}/bin 170 | @rm -rf ${DISTILLERY_INSTALL_DIR}/lib 171 | @rm -rf ${DISTILLERY_INSTALL_DIR}/include 172 | @rm -rf ${DISTILLERY_INSTALL_DIR}/share 173 | @rm -rf ${DISTILLERY_INSTALL_DIR}/etc 174 | @rm -rf ${DISTILLERY_XCODE_DIR} 175 | @rm -rf .*.stamp 176 | 177 | clean: ${modules_clean} 178 | @rm -rf report.txt 179 | 180 | distclean: 181 | @rm -rf ${DISTILLERY_BUILD_DIR} 182 | @rm -rf report.txt 183 | 184 | #distillery-update: 185 | # @echo "Fetching Distillery..." 186 | # @git fetch --all 187 | # @git pull 188 | 189 | distillery-upstream: 190 | git remote add ${DISTILLERY_GITHUB_UPSTREAM_NAME} ${DISTILLERY_GITHUB_UPSTREAM_REPO} 191 | 192 | check: ${modules_check} 193 | 194 | step: ${modules_step} 195 | 196 | # From Distillery, 'make coverage' actually runs the summary version of coverage 197 | # You can also run 'make .coverage' to get the output showing each file and its coverage. 198 | coverage: ${modules_average-coverage} 199 | 200 | dependencies: 201 | @${MAKE} -C dependencies 202 | 203 | dependencies.clean: 204 | @${MAKE} -C dependencies clean 205 | 206 | dependencies.clobber: 207 | @${MAKE} -C dependencies clobber 208 | 209 | pre-requisites: 210 | 211 | help: 212 | @echo "Simple instructions: run \"make update step\"" 213 | @echo 214 | @echo "---- Basic build targets ----" 215 | @echo "make help - This help message" 216 | @echo "make info - Show basic information" 217 | @echo "make status - Show status of modules" 218 | @echo "make update - git clone and pull the different modules to the head of master" 219 | @echo "make sync - fetch all remotes, merge upstream master, push to origin master" 220 | @echo "make step - Module by module: configure, compile and install all software" 221 | @echo " in the install directory (see make info) and run tests" 222 | @echo "make all - Configure, compile and install all software in DISTILLERY_INSTALL_DIR" 223 | @echo "make check - Run all the tests" 224 | @echo "make clobber - Clean the build, remove the install software" 225 | @echo 226 | @echo "make sanity - Run simple sanity checks to test that the build is functional" 227 | @echo 228 | @echo "make coverage - Show the average coverage of each module." 229 | @echo "make .coverage - Show the coverage of each file in the specified module." 230 | @echo 231 | @echo "---- Advanced targets ----" 232 | @echo "make nuke-all-modules - DANGEROUS! Clean all the modules to git checkout (git clean -dfx)" 233 | @echo " - You will lose all uncommitted changes" 234 | @echo "make clean - Clean the build" 235 | @echo "make distclean - Distclean the build" 236 | @echo "make *-debug - make a target with DEBUG on (e.g. all-debug or check-debug)" 237 | @echo "make *-release - make a target with RELEASE on (optimized)" 238 | @echo "make *-nopants - make a target with NOPANTS on (no validation - use at your own risk)" 239 | @echo 240 | @echo "---- IDE support targets ----" 241 | @echo "make xcode - Create xcode projects [only works on Mac]" 242 | @echo "make MasterIDE.xcode - Makes an xcode uber-project (based on all-debug) that contains" 243 | @echo " - the various sub-mdules" 244 | @echo "make MasterIDE.xcodeopen - Makes MasterIDE.xcode and the starts xcode" 245 | @echo "make MasterIDE.clionopen - Creates an uber CMakeLists.txt and starts CLion with the necessary" 246 | @echo " - environment for development" 247 | @echo 248 | @echo "---- Basic module targets ----" 249 | @echo "Module Directory = ${MODULES_DIRECTORY_DEFAULT}" 250 | @echo "Modules Loaded = ${modules}" 251 | @echo "GitModules Loaded = ${gitmodules}" 252 | @echo "Per-module targets: \"Module\" \"Module.distclean\" \"Module.nuke\" \"Module-debug\"" 253 | 254 | 255 | ${DISTILLERY_STAMP}: ${REBUILD_DEPENDS} 256 | touch $@ 257 | 258 | debug-%: export CMAKE_BUILD_TYPE_FLAG = -DCMAKE_BUILD_TYPE=DEBUG 259 | debug-%: export DISTILLERY_BUILD_NAME = -debug 260 | debug-%: 261 | @${MAKE} $* 262 | 263 | %-debug: debug-% ; 264 | 265 | release-%: export CMAKE_BUILD_TYPE_FLAG = "-DCMAKE_BUILD_TYPE=RELEASE" 266 | release-%: export DISTILLERY_BUILD_NAME = -release 267 | release-%: 268 | @${MAKE} $* 269 | 270 | %-release: release-% ; 271 | 272 | nopants-%: export CMAKE_BUILD_TYPE_FLAG = "-DCMAKE_BUILD_TYPE=NOPANTS" 273 | nopants-%: export DISTILLERY_BUILD_NAME = -nopants 274 | nopants-%: 275 | @${MAKE} $* 276 | 277 | %-nopants: nopants-% ; 278 | 279 | releasedebug-%: export CMAKE_BUILD_TYPE_FLAG = "-DCMAKE_BUILD_TYPE=RELWITHDEBINFO" 280 | releasedebug-%: export DISTILLERY_BUILD_NAME = -releasedebug 281 | releasedebug-%: 282 | @${MAKE} $* 283 | 284 | %-releasedebug: releasedebug-% ; 285 | 286 | install-directories: 287 | @mkdir -p ${DISTILLERY_INSTALL_DIR}/include 288 | @mkdir -p ${DISTILLERY_INSTALL_DIR}/lib 289 | @mkdir -p ${DISTILLERY_INSTALL_DIR}/bin 290 | 291 | Distillery.report: 292 | @echo '###################################' 293 | @echo 'Distillery report' 294 | @echo "#" `date "+%Y-%m-%d %H:%M:%S"` 295 | @echo "#" `uname -sr` "-" `uname -pm` 296 | @echo "#" `uname -n` 297 | @echo "#" PATH=${PATH} 298 | 299 | @git status 300 | @git log -1 301 | @git diff -U1 302 | 303 | report.txt: 304 | $(MAKE) report > report.txt 305 | @cat report.txt 306 | 307 | distillery.checkout.error: 308 | @echo 309 | @echo =========================================================== 310 | @echo 311 | @echo DISTILLERY ERROR: You have not checked out a repository! 312 | @echo Please make sure to run \"make update\" at least once 313 | @echo 314 | @echo Otherwise there is a misconfigured module, 315 | @echo please check the module config files at .distillery/modules 316 | @echo 317 | @echo =========================================================== 318 | @echo 319 | 320 | 321 | info: 322 | @echo "############ Distillery Info ##################" 323 | @${MAKE} env 324 | 325 | 326 | # env produces shell interpretable output. It is read by some scripts. 327 | # DO NOT ALTER THE FORMAT 328 | env: 329 | @echo DISTILLERY_ROOT_DIR=${DISTILLERY_ROOT_DIR} 330 | @echo DISTILLERY_SOURCE_DIR=${DISTILLERY_SOURCE_DIR} 331 | @echo DISTILLERY_BUILD_DIR=${DISTILLERY_BUILD_DIR} 332 | @echo DISTILLERY_DEFAULT_CONFIG=${DISTILLERY_DEFAULT_CONFIG} 333 | @echo DISTILLERY_LOCAL_CONFIG=${DISTILLERY_LOCAL_CONFIG} 334 | @echo DISTILLERY_USER_CONFIG=${DISTILLERY_USER_CONFIG} 335 | @echo DISTILLERY_MODULES_DIR=${DISTILLERY_MODULES_DIR} 336 | @echo DISTILLERY_LOCAL_MODULES_DIR=${DISTILLERY_LOCAL_MODULES_DIR} 337 | @echo DISTILLERY_USER_MODULES_DIR=${DISTILLERY_USER_MODULES_DIR} 338 | @echo DISTILLERY_INSTALL_DIR=${DISTILLERY_INSTALL_DIR} 339 | @echo DISTILLERY_DEPENDENCIES_DIR=${DISTILLERY_DEPENDENCIES_DIR} 340 | @echo DISTILLERY_EXTERN_DIR=${DISTILLERY_EXTERN_DIR} 341 | @echo DISTILLERY_TOOLS_DIR=${DISTILLERY_TOOLS_DIR} 342 | @echo DISTILLERY_GITHUB_URL=${DISTILLERY_GITHUB_URL} 343 | @echo DISTILLERY_GITHUB_URL_USER=${DISTILLERY_GITHUB_URL_USER} 344 | @echo DISTILLERY_GITHUB_UPSTREAM_URL=${DISTILLERY_GITHUB_UPSTREAM_URL} 345 | @echo CCNX_DEPENDENCIES=${CCNX_DEPENDENCIES} 346 | @echo LD_LIBRARY_PATH=${LD_LIBRARY_PATH} 347 | @echo LD_RUN_PATH=${LD_RUN_PATH} 348 | @echo CCNX_HOME=${CCNX_HOME} 349 | @echo PATH=${PATH} 350 | 351 | .PHONY: dependencies 352 | -------------------------------------------------------------------------------- /dependencies/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2014-2016, Xerox Corporation (Xerox) and Palo Alto Research Center, Inc (PARC) 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # * Redistributions of source code must retain the above copyright 9 | # notice, this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright 11 | # notice, this list of conditions and the following disclaimer in the 12 | # documentation and/or other materials provided with the distribution. 13 | # 14 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | # DISCLAIMED. IN NO EVENT SHALL XEROX OR PARC BE LIABLE FOR ANY 18 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | # 25 | # ################################################################################ 26 | # # 27 | # # PATENT NOTICE 28 | # # 29 | # # This software is distributed under the BSD 2-clause License (see LICENSE 30 | # # file). This BSD License does not make any patent claims and as such, does 31 | # # not act as a patent grant. The purpose of this section is for each contributor 32 | # # to define their intentions with respect to intellectual property. 33 | # # 34 | # # Each contributor to this source code is encouraged to state their patent 35 | # # claims and licensing mechanisms for any contributions made. At the end of 36 | # # this section contributors may each make their own statements. Contributor's 37 | # # claims and grants only apply to the pieces (source code, programs, text, 38 | # # media, etc) that they have contributed directly to this software. 39 | # # 40 | # # There is no guarantee that this section is complete, up to date or accurate. It 41 | # # is up to the contributors to maintain their portion of this section and up to 42 | # # the user of the software to verify any claims herein. 43 | # # 44 | # # Do not remove this header notification. The contents of this section must be 45 | # # present in all distributions of the software. You may only modify your own 46 | # # intellectual property statements. Please provide contact information. 47 | # 48 | # - Palo Alto Research Center, Inc 49 | # This software distribution does not grant any rights to patents owned by Palo 50 | # Alto Research Center, Inc (PARC). Rights to these patents are available via 51 | # various mechanisms. As of January 2016 PARC has committed to FRAND licensing any 52 | # intellectual property used by its contributions to this software. You may 53 | # contact PARC at cipo@parc.com for more information or visit http://www.ccnx.org 54 | # 55 | 56 | ######################################################################## 57 | # CCNx Distillery project 58 | # 59 | # Ignacio.Solis@parc.com 60 | # 61 | 62 | .PHONY: dir_check 63 | 64 | 65 | DEPENDENCIES_VERSION=20160131 66 | 67 | ######################################################################## 68 | # Define general variables to load dependencies 69 | 70 | # Initialize these lists to empty 71 | dep_clean= 72 | dep_clobber= 73 | 74 | all: system directories tools externs 75 | 76 | include Makefile.downloader 77 | include Makefile.unix 78 | 79 | ######################################################################## 80 | # We need a root dir for Distillery. If this is not in the environment, 81 | # assume it's in our parent directory 82 | DISTILLERY_ROOT_DIR?=$(shell pwd)/.. 83 | 84 | # Load our config variables, the default, and the locally defined 85 | ifneq (,$(wildcard ${HOME}/.ccnx/distillery/config.mk)) 86 | include ${HOME}/.ccnx/distillery/config.mk 87 | endif 88 | ifneq (,$(wildcard ${DISTILLERY_ROOT_DIR}/config/local/config.mk)) 89 | include ${DISTILLERY_ROOT_DIR}/config/local/config.mk 90 | endif 91 | include ${DISTILLERY_ROOT_DIR}/config/config.mk 92 | 93 | # Set our PATH to include our own tools directory 94 | export PATH := ${DISTILLERY_TOOLS_DIR}/bin:$(PATH) 95 | 96 | DOWNLOAD_DIR=${DISTILLERY_DEPENDENCIES_DIR}/download 97 | 98 | 99 | ############################################################################# 100 | # Dependency Modules 101 | 102 | 103 | ####################### 104 | # PCRE 105 | ####################### 106 | 107 | PCRE_DIR=pcre-8.38 108 | PCRE_TARGZ=${PCRE_DIR}.tar.gz 109 | PCRE_TARGZ_DOWNLOAD=${DOWNLOAD_DIR}/${PCRE_TARGZ} 110 | PCRE_SEMAPHORE=${DISTILLERY_EXTERN_DIR}/${PCRE_DIR}.sem 111 | PCRE_DOWNLOAD_URL=http://downloads.sourceforge.net/project/pcre/pcre/8.38 112 | 113 | ${PCRE_TARGZ_DOWNLOAD}: 114 | cd ${DOWNLOAD_DIR}; ${DOWNLOADER} ${PCRE_DOWNLOAD_URL}/${PCRE_TARGZ} 115 | 116 | ${PCRE_DIR}/Makefile.in: ${PCRE_TARGZ_DOWNLOAD} 117 | tar -xzf ${PCRE_TARGZ_DOWNLOAD} 118 | touch ${PCRE_DIR}/Makefile.in 119 | 120 | ${PCRE_DIR}/Makefile: ${PCRE_DIR}/Makefile.in 121 | cd ${PCRE_DIR}; CFLAGS=-O2 ./configure ${HOST_ENV} --prefix=${DISTILLERY_EXTERN_DIR} --disable-debug-mode; 122 | 123 | ${DISTILLERY_EXTERN_DIR}/include/pcre.h: 124 | $(MAKE) ${PCRE_DIR}/Makefile 125 | cd ${PCRE_DIR}; $(MAKE) $(MAKE_BUILD_FLAGS); $(MAKE) install 126 | touch ${PCRE_SEMAPHORE} 127 | 128 | pcre: ${DISTILLERY_EXTERN_DIR}/include/pcre.h 129 | 130 | dep_clean += pcre-clean 131 | dep_clobber += pcre-clobber 132 | 133 | pcre-clean: 134 | @rm -rf ${PCRE_SEMAPHORE} 135 | 136 | pcre-clobber: 137 | @rm -rf ${PCRE_DIR} 138 | @rm -rf ${PCRE_SEMAPHORE} 139 | 140 | 141 | 142 | ####################### 143 | # SWIG 144 | ####################### 145 | 146 | SWIG_DIR=swig-3.0.2 147 | SWIG_TARGZ=${SWIG_DIR}.tar.gz 148 | SWIG_TARGZ_DOWNLOAD=${DOWNLOAD_DIR}/${SWIG_TARGZ} 149 | SWIG_SEMAPHORE=${DISTILLERY_TOOLS_DIR}/${SWIG_DIR}.sem 150 | SWIG_DOWNLOAD_URL= 151 | 152 | ${SWIG_TARGZ_DOWNLOAD}: 153 | cd ${DOWNLOAD_DIR}; ${DOWNLOADER} ${SWIG_DOWNLOAD_URL}/${SWIG_TARGZ} 154 | 155 | ${SWIG_DIR}/Makefile.in: ${SWIG_TARGZ_DOWNLOAD} 156 | tar -xzf ${SWIG_TARGZ_DOWNLOAD} 157 | touch ${SWIG_DIR}/Makefile.in 158 | 159 | ${SWIG_DIR}/Makefile: ${SWIG_DIR}/Makefile.in 160 | cd ${SWIG_DIR}; CFLAGS=-O2 ./configure ${HOST_ENV} --prefix=${DISTILLERY_TOOLS_DIR} --disable-debug-mode ${WITH_PCRE_OPTION}; 161 | 162 | ${DISTILLERY_TOOLS_DIR}/share/swig/3.0.2/python/python.swg: 163 | $(MAKE) ${SWIG_DIR}/Makefile 164 | cd ${SWIG_DIR}; $(MAKE) $(MAKE_BUILD_FLAGS); $(MAKE) install 165 | touch ${SWIG_SEMAPHORE} 166 | 167 | swig: ${DISTILLERY_TOOLS_DIR}/share/swig/3.0.2/python/python.swg 168 | 169 | dep_clean += swig-clean 170 | dep_clobber += swig-clobber 171 | 172 | swig-clean: 173 | @rm -rf ${SWIG_SEMAPHORE} 174 | 175 | swig-clobber: 176 | @rm -rf ${SWIG_DIR} 177 | @rm -rf ${SWIG_SEMAPHORE} 178 | 179 | 180 | 181 | ####################### 182 | # LIBEVENT 183 | ####################### 184 | 185 | LIBEVENT_DIR=libevent-2.0.22-stable 186 | LIBEVENT_TARGZ=${LIBEVENT_DIR}.tar.gz 187 | LIBEVENT_TARGZ_DOWNLOAD=${DOWNLOAD_DIR}/${LIBEVENT_TARGZ} 188 | LIBEVENT_SEMAPHORE=${DISTILLERY_EXTERN_DIR}/${LIBEVENT_DIR}.sem 189 | LIBEVENT_DOWNLOAD_URL=https://github.com/libevent/libevent/releases/download/release-2.0.22-stable 190 | 191 | ${LIBEVENT_TARGZ_DOWNLOAD}: 192 | cd ${DOWNLOAD_DIR}; ${DOWNLOADER} ${LIBEVENT_DOWNLOAD_URL}/${LIBEVENT_TARGZ} 193 | 194 | ${LIBEVENT_DIR}/Makefile.in: ${LIBEVENT_TARGZ_DOWNLOAD} 195 | tar -xzf ${LIBEVENT_TARGZ_DOWNLOAD} 196 | touch ${LIBEVENT_DIR}/Makefile.in 197 | 198 | ${LIBEVENT_DIR}/Makefile: ${LIBEVENT_DIR}/Makefile.in 199 | cd ${LIBEVENT_DIR}; CFLAGS=-O2 ./configure ${HOST_ENV} --prefix=${DISTILLERY_EXTERN_DIR} \ 200 | --disable-debug-mode --disable-openssl; 201 | 202 | ${DISTILLERY_EXTERN_DIR}/include/event.h: 203 | $(MAKE) ${LIBEVENT_DIR}/Makefile 204 | cd ${LIBEVENT_DIR}; $(MAKE) $(MAKE_BUILD_FLAGS); $(MAKE) install 205 | touch ${LIBEVENT_SEMAPHORE} 206 | 207 | libevent: ${DISTILLERY_EXTERN_DIR}/include/event.h 208 | 209 | dep_clean += libevent-clean 210 | dep_clobber += libevent-clobber 211 | 212 | libevent-clean: 213 | @rm -rf ${LIBEVENT_SEMAPHORE} 214 | 215 | libevent-clobber: 216 | @rm -rf ${LIBEVENT_DIR} 217 | @rm -rf ${LIBEVENT_SEMAPHORE} 218 | 219 | 220 | ####################### 221 | # OPENSSL 222 | ####################### 223 | 224 | OPENSSL_TARGZ=openssl-1.0.1q.tar.gz 225 | OPENSSL_DIR=openssl-1.0.1q 226 | OPENSSL_TARGZ_DOWNLOAD=${DOWNLOAD_DIR}/${OPENSSL_TARGZ} 227 | OPENSSL_DOWNLOAD_URL=http://www.openssl.org/source 228 | OPENSSL_SEMAPHORE=${DISTILLERY_EXTERN_DIR}/${OPENSSL_DIR}.sem 229 | OPENSSL_URL=${OPENSSL_DOWNLOAD_URL}/${OPENSSL_TARGZ} 230 | 231 | ${OPENSSL_TARGZ_DOWNLOAD}: 232 | cd ${DOWNLOAD_DIR}; ${DOWNLOADER} ${OPENSSL_URL} 233 | 234 | ${OPENSSL_DIR}/Makefile.in: ${OPENSSL_TARGZ_DOWNLOAD} 235 | tar -xzf ${OPENSSL_TARGZ_DOWNLOAD} 236 | touch ${OPENSSL_DIR}/Makefile.in 237 | 238 | ${OPENSSL_DIR}/Makefile: ${OPENSSL_DIR}/Makefile.in 239 | ifeq (${CROSS_COMPILE_FLAG}, MIPS) 240 | cd ${OPENSSL_DIR}; patch < ../patches/openssl.patch ; ./Configure --prefix=${DISTILLERY_EXTERN_DIR} threads shared linux-octeon64 241 | else 242 | cd ${OPENSSL_DIR}; ${OPENSSL_CONFIGURE} --prefix=${DISTILLERY_EXTERN_DIR} threads shared 243 | endif 244 | 245 | ${DISTILLERY_EXTERN_DIR}/include/openssl/ssl.h: 246 | $(MAKE) ${OPENSSL_DIR}/Makefile 247 | cd ${OPENSSL_DIR}; $(MAKE) $(MAKE_BUILD_FLAGS); $(MAKE) install 248 | touch ${OPENSSL_SEMAPHORE} 249 | 250 | openssl: ${DISTILLERY_EXTERN_DIR}/include/openssl/ssl.h 251 | 252 | dep_clean += openssl-clean 253 | dep_clobber += openssl-clobber 254 | 255 | openssl-clean: 256 | @rm -rf ${OPENSSL_SEMAPHORE} 257 | 258 | openssl-clobber: 259 | @rm -rf ${OPENSSL_DIR} 260 | @rm -rf ${OPENSSL_SEMAPHORE} 261 | 262 | 263 | ####################### 264 | # CMAKE 265 | ####################### 266 | 267 | CMAKE_DIR=cmake-3.4.3 268 | CMAKE_TARGZ=${CMAKE_DIR}.tar.gz 269 | CMAKE_TARGZ_DOWNLOAD=${DOWNLOAD_DIR}/${CMAKE_TARGZ} 270 | CMAKE_SEMAPHORE=${DISTILLERY_TOOLS_DIR}/${CMAKE_DIR}.sem 271 | CMAKE_DOWNLOAD_URL=https://cmake.org/files/v3.4 272 | 273 | ${CMAKE_TARGZ_DOWNLOAD}: 274 | cd ${DOWNLOAD_DIR}; ${DOWNLOADER} ${CMAKE_DOWNLOAD_URL}/${CMAKE_TARGZ} 275 | 276 | ${CMAKE_DIR}/Makefile.in: ${CMAKE_TARGZ_DOWNLOAD} 277 | tar -xzf ${CMAKE_TARGZ_DOWNLOAD} 278 | touch ${CMAKE_DIR}/Makefile.in 279 | 280 | ${CMAKE_DIR}/Makefile: ${CMAKE_DIR}/Makefile.in 281 | cd ${CMAKE_DIR}; ./configure ${HOST_ENV} --prefix=${DISTILLERY_TOOLS_DIR} 282 | 283 | ${DISTILLERY_TOOLS_DIR}/bin/cmake: 284 | $(MAKE) ${CMAKE_DIR}/Makefile 285 | cd ${CMAKE_DIR}; $(MAKE) $(MAKE_BUILD_FLAGS); $(MAKE) install 286 | touch ${DISTILLERY_TOOLS_DIR}/bin/cmake 287 | touch ${CMAKE_SEMAPHORE} 288 | 289 | cmake: ${DISTILLERY_TOOLS_DIR}/bin/cmake 290 | 291 | dep_clean += cmake-clean 292 | dep_clobber += cmake-clobber 293 | 294 | cmake-clean: 295 | @rm -rf ${CMAKE_SEMAPHORE} 296 | 297 | cmake-clobber: 298 | @rm -rf ${CMAKE_DIR} 299 | @rm -rf ${CMAKE_SEMAPHORE} 300 | 301 | 302 | #---------------------------------------------------- 303 | # uncrustify 304 | 305 | UNCRUSTIFY_DIR=uncrustify-0.61 306 | UNCRUSTIFY_TARGZ=${UNCRUSTIFY_DIR}.tar.gz 307 | UNCRUSTIFY_SEMAPHORE=${DISTILLERY_TOOLS_DIR}/${UNCRUSTIFY_DIR}.sem 308 | UNCRUSTIFY_DOWNLOAD_URL=http://downloads.sourceforge.net/project/uncrustify/uncrustify/uncrustify-0.61 309 | 310 | dep_clean += uncrustify-clean 311 | dep_clobber += uncrustify-clobber 312 | 313 | uncrustify: ${DISTILLERY_TOOLS_DIR}/bin/uncrustify 314 | 315 | ${DISTILLERY_TOOLS_DIR}/bin/uncrustify: 316 | $(MAKE) ${DOWNLOAD_DIR}/${UNCRUSTIFY_TARGZ} 317 | tar xzf ${DOWNLOAD_DIR}/${UNCRUSTIFY_TARGZ} 318 | (cd ${UNCRUSTIFY_DIR} && ./configure --prefix=${DISTILLERY_TOOLS_DIR} && make) 319 | (cd ${UNCRUSTIFY_DIR} && make install ) 320 | touch ${UNCRUSTIFY_SEMAPHORE} 321 | 322 | uncrustify-clean: 323 | @rm -rf ${UNCRUSTIFY_SEMAPHORE} 324 | 325 | uncrustify-clobber: 326 | @rm -rf ${UNCRUSTIFY_DIR} 327 | @rm -rf ${UNCRUSTIFY_SEMAPHORE} 328 | 329 | ${DOWNLOAD_DIR}/${UNCRUSTIFY_TARGZ}: 330 | cd ${DOWNLOAD_DIR}; ${DOWNLOADER} ${UNCRUSTIFY_DOWNLOAD_URL}/${UNCRUSTIFY_TARGZ} 331 | 332 | 333 | #---------------------------------------------------- 334 | # doxygen 335 | 336 | DOXYGEN_DIR=doxygen-1.8.11 337 | DOXYGEN_TARGZ=${DOXYGEN_DIR}.src.tar.gz 338 | DOXYGEN_SEMAPHORE=${DISTILLERY_TOOLS_DIR}/${DOXYGEN_DIR}.sem 339 | DOXYGEN_DOWNLOAD_URL=http://downloads.sourceforge.net/project/doxygen/rel-1.8.11 340 | 341 | 342 | dep_clean += doxygen-clean 343 | dep_clobber += doxygen-clobber 344 | 345 | doxygen: ${DISTILLERY_TOOLS_DIR}/bin/doxygen 346 | 347 | ${DISTILLERY_TOOLS_DIR}/bin/doxygen: 348 | $(MAKE) ${DOWNLOAD_DIR}/${DOXYGEN_TARGZ} 349 | tar xzf ${DOWNLOAD_DIR}/${DOXYGEN_TARGZ} 350 | (cd ${DOXYGEN_DIR} && cmake -DCMAKE_INSTALL_PREFIX=${DISTILLERY_TOOLS_DIR} && make) 351 | (cd ${DOXYGEN_DIR} && make install) 352 | touch ${DOXYGEN_SEMAPHORE} 353 | 354 | ${DOWNLOAD_DIR}/${DOXYGEN_TARGZ}: 355 | cd ${DOWNLOAD_DIR}; ${DOWNLOADER} ${DOXYGEN_DOWNLOAD_URL}/${DOXYGEN_TARGZ} 356 | 357 | doxygen-clean: 358 | @rm -rf ${DOXYGEN_SEMAPHORE} 359 | 360 | doxygen-clobber: 361 | @rm -rf ${DOXYGEN_DIR} 362 | @rm -rf ${DOXYGEN_SEMAPHORE} 363 | 364 | 365 | ############################################################################# 366 | # Figure out what we actually need 367 | 368 | LONGBOW_EXTERNS= 369 | LONGBOW_SEMAPHORES= 370 | 371 | ifeq (${UNAME},Darwin) 372 | system_fix_as_root= 373 | DARWIN_LIBRARIES=libevent openssl 374 | DARWIN_SEMAPHORES=${LIBEVENT_SEMAPHORE} 375 | DARWIN_TOOLS=pcre 376 | DARWIN_TOOLS_SEMAPHORES=${PCRE_SEMAPHORE} ${AUTOCONF_SEMAPHORE} ${AUTOMAKE_SEMAPHORE} ${LIBTOOL_SEMAPHORE} 377 | WITH_PCRE_OPTION=--with-pcre-prefix=${DISTILLERY_EXTERN_DIR} 378 | LONGBOW_EXTERNS+=doxygen uncrustify 379 | LONGBOW_SEMAPHORES+=${DOXYGEN_SEMAPHORE} ${UNCRUSTIFY_SEMAPHORE} 380 | endif 381 | 382 | ifeq (${UNAME},Linux) 383 | system_fix_as_root=ubuntu.install.packages 384 | LINUX_SYSTEM= 385 | ifndef DISABLE_UBUNTU_CHECK 386 | LINUX_SYSTEM += ubuntu-check-system 387 | endif 388 | ifndef DISABLE_UBUNTU_PACKAGE_CHECK 389 | LINUX_SYSTEM += ubuntu-check-packages 390 | endif 391 | endif 392 | 393 | ifdef HOST_ENV 394 | CROSS_COMPILE_LIBRARIES = libevent openssl 395 | CROSS_COMPILE_SEMAPHORES = ${LIBEVENT_SEMAPHORE} ${OPENSSL_SEMAPHORE} 396 | endif 397 | 398 | system: ${DARWIN_SYSTEM} ${LINUX_SYSTEM} 399 | 400 | tools: ${DARWIN_TOOLS} cmake 401 | 402 | tools_semaphores=${DARWIN_TOOLS_SEMAPHORES} 403 | 404 | ifdef ENABLE_PYTHON_BINDINGS 405 | tools: swig 406 | tools_semaphores+=${SWIG_SEMAPHORE} 407 | endif 408 | 409 | externs: ${DARWIN_LIBRARIES} ${LINUX_LIBRARIES} ${LONGBOW_EXTERNS} ${CROSS_COMPILE_LIBRARIES} 410 | externs_semaphores=${DARWIN_SEMAPHORES} ${LINUX_SEMAPHORES} ${LONGBOW_SEMAPHORES} ${CROSS_COMPILE_SEMAPHORES} 411 | 412 | # In order to allow dependencies to change over time we have implemented 413 | # a simple system of semaphores. If the semaphore files are present, we 414 | # have already installed the required software. 415 | # 416 | # If the semaphores are not present we are either new, or we have a missing 417 | # dependency. If we do have a missing dependency then we must delete all the 418 | # existing dependencies and start again. (This is so we don't keep track of 419 | # inter-dependency dependencies and specific installed files. 420 | 421 | DEPENDENCIES_SEMAPHORE=${DISTILLERY_EXTERN_DIR}/dependency-version-${DEPENDENCIES_VERSION} 422 | 423 | DIRECTORIES_NEEDED=${DISTILLERY_TOOLS_DIR} ${DISTILLERY_EXTERN_DIR} ${DISTILLERY_DEPENDENCIES_DIR} ${DOWNLOAD_DIR} 424 | 425 | directories: ${DEPENDENCIES_SEMAPHORE} ${tools_semaphores} ${externs_semaphores} ${DIRECTORIES_NEEDED} 426 | @touch ${DEPENDENCIES_SEMAPHORE} 427 | 428 | 429 | ${DIRECTORIES_NEEDED}: 430 | $(MAKE) directory_warning 431 | @mkdir -p ${DIRECTORIES_NEEDED} && touch ${DIRECTORIES_NEEDED} 432 | 433 | directory_warning: 434 | @echo "**********************************************************************************" 435 | @echo Distillery will attempt to create the dependency directories if they don\'t exist. 436 | @echo If this fails you should create the directories yourself with the following commands: 437 | @echo 438 | @echo sudo mkdir -p ${DIRECTORIES_NEEDED} 439 | @echo sudo chown `whoami` ${DIRECTORIES_NEEDED} 440 | @echo sudo chmod 755 ${DIRECTORIES_NEEDED} 441 | @echo 442 | @echo OR 443 | @echo 444 | @echo make -C dependencies fix-as-root 445 | @echo 446 | 447 | fix-as-root: $(system_fix_as_root) 448 | sudo mkdir -p ${DIRECTORIES_NEEDED} 449 | sudo chown `whoami` ${DIRECTORIES_NEEDED} 450 | sudo chmod 755 ${DIRECTORIES_NEEDED} 451 | 452 | ${tools_semaphores}: 453 | @make clobber 454 | 455 | ${externs_semaphores}: 456 | @make clobber 457 | 458 | ${DEPENDENCIES_SEMAPHORE}: 459 | @make clobber 460 | 461 | ubuntu.install.packages: 462 | @./ubuntu-install-packages.sh 463 | 464 | ubuntu-check-system: 465 | @./ubuntu-check-system.sh 466 | 467 | ubuntu-check-packages: 468 | @./ubuntu-check-packages.sh 469 | 470 | clean: $(dep_clean) 471 | 472 | clobber: $(dep_clobber) 473 | @rm -rf ${DISTILLERY_TOOLS_DIR} 474 | @rm -rf ${DISTILLERY_EXTERN_DIR} 475 | --------------------------------------------------------------------------------