Need help from a C++ makefile guru

hello,

i'm recompiling some c++ code for OSX and there are some bugs as the configure is not picking up some libs like atlas, pastix, etc, it should be finding either in standard path or with pkgconfig but it's not so i'm rewriting the Makefile. C++ territory is a bit of a stretch with all of the preprocessing that needs to be done then linked.

i usually use rules to keep makefiles simple but i don't know if I'll break something with my bash inside the makefile?

there are 2 binaries and a static lib as a result, each has different flags with some common source elements so the object files are renamed so they are aren't overwritten.

someone else has a better way to do this?

anyway there are a LOT of lines in the file like this which i'd like to safely reduce to rules

------------as is --------

$(STATICLIB)_la_OBJECTS = libtest_la-c_evl ...+30 more.
$(STATICLIB)_SOURCES = c_evl.cpp .....+30 more
test-c_geo.o: c_geo.cpp
	$(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CXXFLAGS) $(CXXFLAGS) -c -o test-c_geo.o c_geo.cpp
libtest_la-c_evl.lo: c_evl.cpp
	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(LOTS_OF_FLAGS) $(libtest_la_CXXFLAGS) $(CXXFLAGS) -c -o libtest_la-c_evlcom.lo c_evl.cpp

---------- will this work ? --------

maybe it is just easier to dump the object files for each into a separate director and then use implicit rules?

---------- Post updated 01-23-16 at 02:31 AM ---------- Previous update was 01-22-16 at 06:29 PM ----------

FYI, it was just easier to dump the object files into separate directories and compile.

whoever thought libtool/autoconf is a good thing? i turned about 6000 lines of bloated code into about 200. compiles libraries in 1/3 the time.