When trying to solve the question posted here: __start_section and __stop_section symbols missing when linking to library I've determined it would be best if I could get my C autotools project to compile a list of objects without generating a library (or I can ignore the library as long as the intermediate objects are present). Here is my current Makefile.am:
AM_CFLAGS = -I$(top_srcdir)/drivers/include
lib_LIBRARIES = libdriver.a
libdriver_a_SOURCES = $(STATIC_DRIVER_FILES)
STATIC_DRIVER_FILES = src/driver.c
if FLASH_SIM
STATIC_DRIVER_FILES += flash/flash_sim.c
endif
if UART_SIM
STATIC_DRIVER_FILES += uart/uart_sim.c
endif
This works fine and creates libdriver.a. What I need is a variable STATIC_DRIVER_OBJS that contains a list of all the compiled objects I can link to from the main application. The question posted above explains why I can't just link the the library directly.