my source files are not inside of one directory which I need to do ../ or ../../ stuff.
after that, I need to change source file name for example: ../ex/test.c to obj/test.o
with this: command:
$(OBJDIR) $(notdir $(SOURCECODE:.c=.o))
however only first filename in $(SOURCECODE) (../ex/test.c) is correctly renamed to obj/test.o, the rest all look like *.o, without directory information.
That’s because you prepend
$(OBJDIR)to the list as is:obj/+foo.c bar.c baz.cgivesobj/foo.c bar.c baz.c, which is not what you want.To add directory to each file in your list use
addprefixfunction: