hi, I am in the process of learning makefile creation.
Current target is to scan the $(SOURCEDIR)
for .c
files and create (according to that lise of .c
file paths in the format of /path/file.c
) a nice $(VPATH)
so I do not need to use recursive makefiles (aka pain in the a..).
Atm I am stuck with this, where $(SOURCETREE)
will be empty on $(ECHO)
SOURCES := $(shell find $(SOURCEDIR) -name '*.c')
SOURCETREE := $(dir $(SOURCES))
SOURCETREE := $(shell $(ECHO) $(SOURCETREE) | $(SED) -e "s/[[:space:]]/\n/g" | uniq | $(SED) -e "s/\n/[[:space:]]/g");
Maybe I just do not get the point (got late again :/ )
Thanks for any help.
Note: In a bash shell it works perfectly on my linux workbox (I replace thevariables accordingly) Note: I am no sed pro, so please explain if you do an voodoo with sed, thank you