#!/bin/bash #--help [-v] [-f] # Builds the LOGICMOO Binaries (Optionally Verbose and Forced) RDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd ) ( cd $RDIR source ./logicmoo_env.sh $1 $2 #return 0 2>/dev/null ; exit 0 BINARY=$LOGICMOO_WS/bin/lmoo-clif VERBOSITY="2>&1 | grep -1 -i 'WARN\|ERROR' " [ "$1" = "-v" ] && VERBOSITY="" && shift 1 if [ "$1" = "-f" ]; then rm -f ${BINARY} $LOGICMOO_WS/bin/lmoo-pfc $LOGICMOO_WS/bin/lmoo-swipl shift 1 fi [ "$1" = "-v" ] && VERBOSITY="" && shift 1 if [ -x "${BINARY}" ]; then #-not -name "logicmoo_test_header.pl" NEWER_FILES=`find $LOGICMOO_WS/docker/rootfs/usr/local/lib/swipl/ $LOGICMOO_WS/packs_??*/*/prolog/ -type f -newer ${BINARY} -name "*.pl" ` if [ -z "${NEWER_FILES}" ]; then return 0 2>/dev/null ; exit 0 fi echo "Warning: NEWER_FILES than ${BINARY}: $NEWER_FILES" fi COMPILE="swipl --pce=false -t halt -g 'use_module(library(logicmoo_clif))' $*" rm -f ${BINARY} $LOGICMOO_WS/bin/lmoo-pfc ( echo "$COMPILE $VERBOSITY" eval "$COMPILE $VERBOSITY" chmod 777 ${BINARY} $LOGICMOO_WS/bin/lmoo-pfc ) ( #COMPILE="cd $LOGICMOO_WS/prologmud_server && swipl --pce=false -x ${BINARY} compile_mud_server.pl" COMPILE="cd $LOGICMOO_WS/prologmud_server && swipl --pce=false compile_mud_server.pl" echo "$COMPILE $VERBOSITY" #echo SKIPPING eval "$COMPILE $VERBOSITY" # echo SKIPPING chmod 777 $LOGICMOO_WS/bin/lmoo-swipl $LOGICMOO_WS/bin/lmoo-mud ) )