hi,
I am trying to create subdirectories under my ../objs directory within a make file.
my ../src directory has the following subdirectories:
source-a
source.1.1
so, I want to label the subdirectories under my ../objs directory with the same names as those in the ../src directory, so that I have:
../objs/source-a
../objs/source.1.1
I have written the following code:
SRCDIR = $(shell echo ../src/*)
OBJDIR = ../objs
subdirname :=$(notdir $(basename $(SRCDIR)))
objdirs := $(addprefix $(OBJDIR)/, $(subdirname))
all: makedir
makedir: $(objdirs)
mkdir $^
but that is not working, I get an error message as follows:
make: *** No rule to make target `../objs/source-a', needed by `makedir'. Stop.
How do I fix this?
thanks!