From 907c8bebbf52aad2c21ff569a70fb41a4e777f30 Mon Sep 17 00:00:00 2001 From: Giovanni La Mura <giovanni.lamura@inaf.it> Date: Mon, 13 Nov 2023 14:26:12 +0100 Subject: [PATCH] Add cluster / sphere switch to code entry point --- src/np_sphere.cpp | 7 ++++++- src/sphere/Makefile | 7 +++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/np_sphere.cpp b/src/np_sphere.cpp index ac985ac4..b6ba389e 100644 --- a/src/np_sphere.cpp +++ b/src/np_sphere.cpp @@ -3,10 +3,13 @@ #include <cstdio> #include <string> +#ifndef INCLUDE_CONFIGURATION_H_ #include "include/Configuration.h" +#endif using namespace std; +extern void cluster(); extern void sphere(); /*! \brief Main program entry point. @@ -18,6 +21,8 @@ extern void sphere(); * the configuration and runs the main program. */ int main(int argc, char **argv) { - sphere(); + bool is_sphere = true; + if (is_sphere) sphere(); + else cluster(); return 0; } diff --git a/src/sphere/Makefile b/src/sphere/Makefile index c42d9b04..76e16f0b 100644 --- a/src/sphere/Makefile +++ b/src/sphere/Makefile @@ -14,8 +14,8 @@ edfb: edfb.o sph: sph.o $(FC) $(FCFLAGS) -o $(BUILDDIR)/sph $(BUILDDIR)/sph.o $(LFLAGS) -np_sphere: $(BUILDDIR)/np_sphere.o $(BUILDDIR)/Commons.o $(BUILDDIR)/Configuration.o $(BUILDDIR)/Parsers.o $(BUILDDIR)/sphere.o - $(CXX) $(CXXFLAGS) $(CXXLFLAGS) -o $(BUILDDIR)/np_sphere $(BUILDDIR)/np_sphere.o $(BUILDDIR)/Commons.o $(BUILDDIR)/Configuration.o $(BUILDDIR)/Parsers.o $(BUILDDIR)/sphere.o +np_sphere: $(BUILDDIR)/np_sphere.o $(BUILDDIR)/Commons.o $(BUILDDIR)/Configuration.o $(BUILDDIR)/Parsers.o $(BUILDDIR)/sphere.o $(BUILDDIR)/cluster.o + $(CXX) $(CXXFLAGS) $(CXXLFLAGS) -o $(BUILDDIR)/np_sphere $(BUILDDIR)/np_sphere.o $(BUILDDIR)/Commons.o $(BUILDDIR)/Configuration.o $(BUILDDIR)/Parsers.o $(BUILDDIR)/sphere.o $(BUILDDIR)/cluster.o $(BUILDDIR)/np_sphere.o: $(CXX) $(CXXFLAGS) -c ../np_sphere.cpp -o $(BUILDDIR)/np_sphere.o @@ -29,6 +29,9 @@ $(BUILDDIR)/Configuration.o: $(BUILDDIR)/Parsers.o: $(CXX) $(CXXFLAGS) -c ../libnptm/Parsers.cpp -o $(BUILDDIR)/Parsers.o +$(BUILDDIR)/cluster.o: + $(CXX) $(CXXFLAGS) -c ../cluster/cluster.cpp -o $(BUILDDIR)/cluster.o + $(BUILDDIR)/sphere.o: $(CXX) $(CXXFLAGS) -c sphere.cpp -o $(BUILDDIR)/sphere.o -- GitLab