This seems like a reasonable expectation:
SOURCES= $(SOURCES) file.c
SOURCES= $(SOURCES) file1.c
SOME_CONDITIONAL=0
!if $(SOME_CONDITIONAL)==1
SOURCES= $(SOURCES) file2.c
!endif
In other words, add file2.c to the list of source files when some
conditional expression is true. In all cases, file2.c will be in the list
of source files.
If I do this, which is not all that dissimilar, I get expected behavior:
NTTARGETFILE0= somefile
!if $(SOME_CONDITIONAL)==1
NTTARGETFILE0= $(NTTARGETFILE0) someadditionalfile
!endif
Is there a way to include a file in the list of files to be compiled ‘some
of the time’?
Thanks,
Mike