From cb9c81e8f9fbbd093d9fe4cb3aabfe883eb7582d Mon Sep 17 00:00:00 2001 From: Bruno Raoult Date: Fri, 29 Dec 2023 08:31:30 +0100 Subject: [PATCH] edit env.sh --- Makefile | 6 +++--- env.sh | 1 - scripts/env.sh | 26 ++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 4 deletions(-) delete mode 100644 env.sh create mode 100755 scripts/env.sh diff --git a/Makefile b/Makefile index dfea2f4..2d04e5b 100644 --- a/Makefile +++ b/Makefile @@ -55,7 +55,7 @@ LIBS := -l$(LIB) -lreadline -lncurses ##################################### pre-processor flags CPPFLAGS := -I$(INCDIR) -CPPFLAGS += -DDEBUG # global +#CPPFLAGS += -DDEBUG # global CPPFLAGS += -DDEBUG_DEBUG # enable log() functions #CPPFLAGS += -DDEBUG_DEBUG_C # enable verbose log() settings CPPFLAGS += -DDEBUG_POOL # memory pools management @@ -70,7 +70,7 @@ CPPFLAGS := $(strip $(CPPFLAGS)) ##################################### compiler flags CFLAGS := -std=gnu11 -#CFLAGS += -O2 +#CFLAGS += -O2 CFLAGS += -g CFLAGS += -Wall CFLAGS += -Wextra @@ -89,7 +89,7 @@ LDFLAGS := -L$(LIBDIR) DEPFLAGS = -MMD -MP -MF $(DEPDIR)/$*.d ##################################### General targets -.PHONY: all clean cleanall +.PHONY: all compile clean cleanall all: $(TARGET) diff --git a/env.sh b/env.sh deleted file mode 100644 index 87ed12e..0000000 --- a/env.sh +++ /dev/null @@ -1 +0,0 @@ -export LD_LIBRARY_PATH=./lib diff --git a/scripts/env.sh b/scripts/env.sh new file mode 100755 index 0000000..2a64335 --- /dev/null +++ b/scripts/env.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# +# env.sh - set environment for brchess developer. +# +# Copyright (C) 2023 Bruno Raoult ("br") +# Licensed under the GNU General Public License v3.0 or later. +# Some rights reserved. See COPYING. +# +# You should have received a copy of the GNU General Public License along with this +# program. If not, see . +# +# SPDX-License-Identifier: GPL-3.0-or-later +# +# USAGE: source env.sh [arg] +# +# This file will actually be sourced if it was never sourced in current bash +# environment. + +if [[ ! -v _BRCHESS_ENV_ ]]; then + export _BRCHESS_ENV_=1 BRCHESS_ROOT BRLIB_DIR LD_LIBRARY_PATH + BRCHESS_ROOT=$(realpath -L "$(dirname "${BASH_SOURCE[0]}")/..") + BRLIB_DIR="$BRCHESS_ROOT/brlib/lib" + LD_LIBRARY_PATH=/mypath${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} + #printf "R=%s L=%s LD=%s\n" "$BRCHESS_ROOT" "$BRLIB_DIR" "$LD_LIBRARY_PATH" + printf "Chess environment complete.\n" +fi