Sorry I left this out, Yes I had a filter function for comment lines in with # and empty lines:
GREP = egrep -v '^ *$|#'
first I had the line:
MODULES = $(shell cat ../bin/module.hier | egrep -v '^$|#' )
But then make complained about missing ).
I thought that # in a shell function was allowed but it seems that make is interpreting
everything after # as comment even if it is in a shell function??
MODULES = $(shell cat ../bin/module.hier | $(GREP) )
It seemed to work correctly.
Although I just found out that commentlines starting with # will still give an error and are
not filtered out, but lines starting with a space and then a # are filtered. Can you explain this?
Would there be a better way to filter #-lines in make?
hpvl> TOP_MOD = $(word $(words $(MODULES)),$(MODULES) ) #determine last module from list
pds>You're adding all kinds of whitespace here. By putting whitespace at
pds>the end of the line (separating the function from the comment at the end
pds>of the line) you're adding whitespace.
OK I see that now.
hpvl> When I do an echo of $(TOP_MOD) I do not see these spaces!
pds>Anyway, make invokes a shell and the shell will strip extra whitespace
pds>before it invokes the echo.
Good point, that will explain I did not see spaces.