From 982447e8824a4bc453ae101d604d2f2ae6ab06a6 Mon Sep 17 00:00:00 2001
From: Giovanni La Mura <giovanni.lamura@inaf.it>
Date: Mon, 8 Jul 2024 18:38:56 +0200
Subject: [PATCH] Move configuration script in build folder

---
 .gitignore                  | 17 ++++++++---------
 build/Makefile.am           | 16 ++++++++++++++++
 {src => build}/configure.ac |  4 ++--
 src/Makefile.am             | 16 ----------------
 4 files changed, 26 insertions(+), 27 deletions(-)
 create mode 100644 build/Makefile.am
 rename {src => build}/configure.ac (91%)
 delete mode 100644 src/Makefile.am

diff --git a/.gitignore b/.gitignore
index 4868b2d3..f20a6c9f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,20 +1,19 @@
+build/aclocal.m4
+build/autom4te.cache
 build/aux/*
+build/config.*
+build/configure
+build/configure~
 build/cluster/*
+build/libtool
+build/Makefile
+build/Makefile.in
 build/sphere/*
 build/testing/*
 build/trapping/*
 build/libnptm/*
 containers/singularity/*.sif
 doc/build/*
-src/aclocal.m4
-src/autom4te.cache
-src/config.*
-src/configure
-src/configure~
-src/libtool
-src/m4
-src/Makefile
-src/Makefile.in
 src/*/.deps
 src/*/objects/*
 src/*/dynobjects/*
diff --git a/build/Makefile.am b/build/Makefile.am
new file mode 100644
index 00000000..de0719e4
--- /dev/null
+++ b/build/Makefile.am
@@ -0,0 +1,16 @@
+AUTOMAKE_OPTIONS=subdir-objects
+lib_LTLIBRARIES=libnptm.la
+libnptm_la_SOURCES=../src/libnptm/algebraic.cpp ../src/libnptm/clu_subs.cpp ../src/libnptm/Commons.cpp ../src/libnptm/Configuration.cpp ../src/libnptm/file_io.cpp ../src/libnptm/lapack_calls.cpp ../src/libnptm/logging.cpp ../src/libnptm/magma_calls.cpp ../src/libnptm/Parsers.cpp ../src/libnptm/sph_subs.cpp ../src/libnptm/tfrfme.cpp ../src/libnptm/TransitionMatrix.cpp ../src/libnptm/tra_subs.cpp ../src/libnptm/types.cpp
+bin_PROGRAMS=edfb_clu clu np_cluster edfb_sph sph np_sphere frfme lffft np_trapping
+edfb_clu_SOURCES=../src/cluster/edfb_clu.f
+clu_SOURCES=../src/cluster/clu.f
+np_cluster_SOURCES=../src/cluster/np_cluster.cpp ../src/cluster/cluster.cpp
+edfb_sph_SOURCES=../src/sphere/edfb_sph.f
+sph_SOURCES=../src/sphere/sph.f
+np_sphere_SOURCES=../src/sphere/np_sphere.cpp ../src/sphere/sphere.cpp
+frfme_SOURCES=../src/trapping/frfme.f
+lffft_SOURCES=../src/trapping/lffft.f
+np_trapping_SOURCES=../src/trapping/np_trapping.cpp ../src/trapping/cfrfme.cpp ../src/trapping/clffft.cpp
+check_PROGRAMS=test_TEDF test_TTMS
+test_TEDF_SOURCES=../src/testing/test_TEDF.cpp
+test_TTMS_SOURCES=../src/testing/test_TTMS.cpp
diff --git a/src/configure.ac b/build/configure.ac
similarity index 91%
rename from src/configure.ac
rename to build/configure.ac
index 57f5b735..14554b15 100644
--- a/src/configure.ac
+++ b/build/configure.ac
@@ -6,10 +6,10 @@
 AC_INIT([np_tmcode], [8.04], [giovanni.lamura@inaf.it])
 
 # Folder structure safety check
-AC_CONFIG_SRCDIR([libnptm/TransitionMatrix.cpp])
+AC_CONFIG_SRCDIR([../src/libnptm/TransitionMatrix.cpp])
 
 # Auxiliary build folder
-AC_CONFIG_AUX_DIR([../build/aux])
+AC_CONFIG_AUX_DIR([aux])
 
 # automake initialization
 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
diff --git a/src/Makefile.am b/src/Makefile.am
deleted file mode 100644
index 037d6dc3..00000000
--- a/src/Makefile.am
+++ /dev/null
@@ -1,16 +0,0 @@
-AUTOMAKE_OPTIONS=subdir-objects
-lib_LTLIBRARIES=libnptm.la
-libnptm_la_SOURCES=libnptm/algebraic.cpp libnptm/clu_subs.cpp libnptm/Commons.cpp libnptm/Configuration.cpp libnptm/file_io.cpp libnptm/lapack_calls.cpp libnptm/logging.cpp libnptm/magma_calls.cpp libnptm/Parsers.cpp libnptm/sph_subs.cpp libnptm/tfrfme.cpp libnptm/TransitionMatrix.cpp libnptm/tra_subs.cpp libnptm/types.cpp
-bin_PROGRAMS=edfb_clu clu np_cluster edfb_sph sph np_sphere frfme lffft np_trapping
-edfb_clu_SOURCES=cluster/edfb_clu.f
-clu_SOURCES=cluster/clu.f
-np_cluster_SOURCES=cluster/np_cluster.cpp cluster/cluster.cpp
-edfb_sph_SOURCES=sphere/edfb_sph.f
-sph_SOURCES=sphere/sph.f
-np_sphere_SOURCES=sphere/np_sphere.cpp sphere/sphere.cpp
-frfme_SOURCES=trapping/frfme.f
-lffft_SOURCES=trapping/lffft.f
-np_trapping_SOURCES=trapping/np_trapping.cpp trapping/cfrfme.cpp trapping/clffft.cpp
-check_PROGRAMS=test_TEDF test_TTMS
-test_TEDF_SOURCES=testing/test_TEDF.cpp
-test_TTMS_SOURCES=testing/test_TTMS.cpp
-- 
GitLab