regexis024-build-system/install.sh

32 lines
983 B
Bash
Raw Normal View History

#!/bin/sh
H_FILE="regexis024_build_system.h"
if [ \! \( -f "$H_FILE" \) ]; then echo "Change cwd to root of build system source code root directory"; exit 1; fi
usage(){
echo "Usage: ./install.sh [header installation dir path] [pkg-config file installation path]"
}
if [ $# -gt 2 ]; then usage; exit 1; fi
H_INST_DIR="/usr/include"
PC_INST_FILE="/usr/lib/pkgconfig/regexis024-build-system.pc"
if [ $# -ge 1 ]; then H_INST_DIR="$1"; fi
if [ $# -ge 2 ]; then PC_INST_FILE="$2"; fi
cp "$H_FILE" "$H_INST_DIR/$H_FILE"
if [ $? != 0 ]; then echo "Can't install"; exit 1; fi
echo "Name: regexis024-build-system" > "$PC_INST_FILE"
echo "Description: Cool C++ build system" >> "$PC_INST_FILE"
COOL_FLAGS="-Wall -pedantic -Wno-unused-variable -Wno-unused-but-set-variable -Werror=return-type -Wno-reorder"
COOL_FLAGS="$COOL_FLAGS -D _GLIBCXX_DEBUG -D _POSIX_C_SOURCE=200809L"
COOL_FLAGS="$COOL_FLAGS -g --std c++14"
echo "Cflags: $COOL_FLAGS -I $H_INST_DIR" >> "$PC_INST_FILE"