[PATCH 08/13] samples: Avoid build system defined defines

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Nov 8 14:02:56 UTC 2019


Update #3818.
---
 testsuites/samples/Makefile.am                    | 10 +++++-----
 testsuites/samples/base_mp/init1.c                |  2 ++
 testsuites/samples/base_mp/init2.c                |  2 ++
 testsuites/samples/base_mp/{init.c => initimpl.h} |  0
 testsuites/samples/paranoia/paranoia.c            |  4 ++++
 5 files changed, 13 insertions(+), 5 deletions(-)
 create mode 100644 testsuites/samples/base_mp/init1.c
 create mode 100644 testsuites/samples/base_mp/init2.c
 rename testsuites/samples/base_mp/{init.c => initimpl.h} (100%)

diff --git a/testsuites/samples/Makefile.am b/testsuites/samples/Makefile.am
index f05c9a3689..1944d90ccc 100644
--- a/testsuites/samples/Makefile.am
+++ b/testsuites/samples/Makefile.am
@@ -19,14 +19,14 @@ if TEST_base_mp
 samples += base_mp_node1
 sample_screens += base_mp/base_mp-node1.scn
 sample_docs += base_mp/base_mp-node1.doc
-base_mp_node1_SOURCES = base_mp/init.c base_mp/apptask.c base_mp/system.h
-base_mp_node1_CPPFLAGS = -DNODE_NUMBER=1 $(AM_CPPFLAGS) $(TEST_FLAGS_base_mp) \
+base_mp_node1_SOURCES = base_mp/init1.c base_mp/apptask.c base_mp/system.h
+base_mp_node1_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_base_mp) \
 	$(support_includes)
 samples += base_mp_node2
 sample_screens += base_mp/base_mp-node2.scn
 sample_docs += base_mp/base_mp-node2.doc
-base_mp_node2_SOURCES = base_mp/init.c base_mp/apptask.c base_mp/system.h
-base_mp_node2_CPPFLAGS = -DNODE_NUMBER=2 $(AM_CPPFLAGS) $(TEST_FLAGS_base_mp) \
+base_mp_node2_SOURCES = base_mp/init2.c base_mp/apptask.c base_mp/system.h
+base_mp_node2_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_base_mp) \
 	$(support_includes)
 endif
 endif
@@ -120,7 +120,7 @@ sample_docs += paranoia/paranoia.doc
 paranoia_SOURCES = paranoia/init.c paranoia/paranoia.c \
 	paranoia/system.h
 paranoia_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_paranoia) \
-	$(support_includes) -DCYGNUS -DNOMAIN -DNOSIGNAL
+	$(support_includes)
 paranoia_LDADD = -lm $(LDADD)
 endif
 
diff --git a/testsuites/samples/base_mp/init1.c b/testsuites/samples/base_mp/init1.c
new file mode 100644
index 0000000000..cfe033db60
--- /dev/null
+++ b/testsuites/samples/base_mp/init1.c
@@ -0,0 +1,2 @@
+#define CONFIGURE_MP_NODE_NUMBER 1
+#include "initimpl.h"
diff --git a/testsuites/samples/base_mp/init2.c b/testsuites/samples/base_mp/init2.c
new file mode 100644
index 0000000000..40c2c81592
--- /dev/null
+++ b/testsuites/samples/base_mp/init2.c
@@ -0,0 +1,2 @@
+#define CONFIGURE_MP_NODE_NUMBER 2
+#include "initimpl.h"
diff --git a/testsuites/samples/base_mp/init.c b/testsuites/samples/base_mp/initimpl.h
similarity index 100%
rename from testsuites/samples/base_mp/init.c
rename to testsuites/samples/base_mp/initimpl.h
diff --git a/testsuites/samples/paranoia/paranoia.c b/testsuites/samples/paranoia/paranoia.c
index 0c207533f4..2f2d1943fe 100644
--- a/testsuites/samples/paranoia/paranoia.c
+++ b/testsuites/samples/paranoia/paranoia.c
@@ -3,6 +3,10 @@
 #endif
 
 #include <bsp.h>
+#define CYGNUS
+#define NOMAIN
+#define NOSIGNAL
+
 /*
  *      A C version of Kahan's Floating Point Test "Paranoia"
  *
-- 
2.16.4



More information about the devel mailing list