On Sun, Apr 13, 2014 at 2:47 AM, Jonas Thiem <jonasth...@googlemail.com> wrote: > # ------------- > # Unit test section > # ------------- > TESTS= > testd = ctests > TEST_CFLAGS= $(AM_CFLAGS) -DUNITTEST > > # ------------- > # C tests > # ------------- > check_PROGRAMS = $(testd)/test-imgloader $(testd)/test-texman-1 > $(testd)/test-imgloader-colors > __testd__test_imgloader_SOURCES = $(testd)/test-imgloader.c > $(source_code_files) > __testd__test_imgloader_LDFLAGS = $(FINAL_LD_FLAGS) > __testd__test_imgloader_CFLAGS = $(TEST_CFLAGS) > __testd__test_imgloader_colors_SOURCES = > $(testd)/test-imgloader-colors.c $(source_code_files) > __testd__test_imgloader_colors_LDFLAGS = $(FINAL_LD_FLAGS) > __testd__test_imgloader_colors_CFLAGS = $(TEST_CFLAGS) > __testd__test_texman_1_SOURCES = $(testd)/test-texman-1.c > $(source_code_files) > __testd__test_texman_1_LDFLAGS = $(FINAL_LD_FLAGS) > __testd__test_texman_1_CFLAGS = $(TEST_CFLAGS) > TESTS += $(testd)/test-imgloader $(testd)/test-texman-1 > $(testd)/test-imgloader-colors > > > Basically, I want to link the tests in the "ctests/" subdirectory > (referenced with $(testd)/ in most places) together with the main > object files of the main program (as listed in $source_code_files). >
Is support for setting variables with names of source directories after automake is run (with configure scripts, or on the command line when make is run) is needed? If not, could variables in the paths of source files ("$(testd)") above could be expanded when automake is run? So Makefile currently has lines like include $(testd)/test-imgloader.Po and this would become include ctests/test-imgloader.Po with no opportunity to change the value of testd. Then config.status could read the name of the file from Makefile and create it properly.