From 5d4b5232ce256defeef8560207c4b625a6d6402b Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Mon, 30 Jan 2023 14:54:14 +0100 Subject: [PATCH] Add compile script for creating a ngspicexx-tar.gz distribution file, using 'make dist'. --- Makefile.am | 2 +- compile_linux_dist.sh | 49 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 compile_linux_dist.sh diff --git a/Makefile.am b/Makefile.am index 93a45d0df..6b40d10aa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,7 +13,7 @@ EXTRA_DIST = FAQ autogen.sh Stuarts_Poly_Notes \ compile_min.sh compile_linux.sh compile_min_shared.sh \ compile_linux_shared.sh compile_cyg_make_short_check_64.sh \ compile_macos_clang.sh compile_macos_gcc.sh \ - ngspice.pc.in .gitignore + compile_linux_dist.sh ngspice.pc.in .gitignore MAINTAINERCLEANFILES = Makefile.in aclocal.m4 ar-lib compile config.guess \ src/include/ngspice/config.h.in config.sub configure install-sh \ diff --git a/compile_linux_dist.sh b/compile_linux_dist.sh new file mode 100644 index 000000000..fb49f61c1 --- /dev/null +++ b/compile_linux_dist.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# ngspice build script for Linux distributable, 64 bit +# compile_linux_dist.sh + +# Procedure: +# Install gcc, bison, flex, libtool, autoconf, automake, +# libx11 and libx11-dev (headers), libXaw and libXaw-dev, libreadline and dev +# Declare 'compile_linux_dist.sh' executable and start compiling with +# './compile_linux_dist.sh' from the ngspice directory. + +SECONDS=0 + + +if [ ! -d "release" ]; then + mkdir release + if [ $? -ne 0 ]; then echo "mkdir release failed"; exit 1 ; fi +fi + + +# If compiling sources from git, you may need to uncomment the following two lines: +./autogen.sh +if [ $? -ne 0 ]; then echo "./autogen.sh failed"; exit 1 ; fi + +echo +cd release +if [ $? -ne 0 ]; then echo "cd release failed"; exit 1 ; fi +echo "configuring for 64 bit release" +echo + +../configure --with-x --enable-xspice --enable-cider --with-readline=yes --enable-openmp --enable-osdi --disable-debug CFLAGS="-m64 -O2" LDFLAGS="-m64 -s" + +if [ $? -ne 0 ]; then echo "../configure failed"; exit 1 ; fi + +echo +# make clean is required for properly making the code models +echo "cleaning (see make_clean.log)" +make clean 2>&1 -j8 | tee make_clean.log +exitcode=${PIPESTATUS[0]} +if [ $exitcode -ne 0 ]; then echo "make clean failed"; exit 1 ; fi +echo "generate distribution (see make_dist.log)" +make dist 2>&1 -j8 | tee make_dist.log +exitcode=${PIPESTATUS[0]} +if [ $exitcode -ne 0 ]; then echo "make dist failed"; exit 1 ; fi + +ELAPSED="Elapsed compile time: $(($SECONDS / 3600))hrs $((($SECONDS / 60) % 60))min $(($SECONDS % 60))sec" +echo +echo $ELAPSED +echo "success" +exit 0