From 2622684ed53ea5dd44558a257684b6b9a935576b Mon Sep 17 00:00:00 2001 From: Roland Lutz Date: Sun, 1 Mar 2015 15:46:36 +0100 Subject: [PATCH] Force object renaming to avoid constraint.o being overwritten The GUI application and library share some object files but don't enable object renaming resulting in the second compilation overwriting the results of the first compilation. This can be fixed by setting explicit preprocessor flags for one compilation. The actual problem, however, is that recursive make is used in an inappropriate way; two Makefiles shouldn't refer to the same source files. In this case, libslvs should be under src/ and handled by the same Makefile, in which case the issue would have been obvious when the Makefile was written in the first place. --- exposed/Makefile.am | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exposed/Makefile.am b/exposed/Makefile.am index 77b7dc29..7fefc1a9 100644 --- a/exposed/Makefile.am +++ b/exposed/Makefile.am @@ -11,6 +11,10 @@ noinst_LIBRARIES = libslvs.a CDemo_SOURCES = CDemo.c +# Set explicit CPPFLAGS to force renaming of the object files. +# Otherwise, the object files for the GUI application will be overwritten. +libslvs_a_CPPFLAGS = $(AM_CPPFLAGS) + libslvs_a_SOURCES = \ slvs.h \ lib.cpp \