The general idea of what I am trying to be accomplished can hopefully be summed up by this small script.
DIRS = dir1 dir2 dir3 dir4 ...
OBJS =
all: GENERATE_OBJECT_FILES
GENERATE_OBJECT_FILES:
for curr_dir in $(DIRS); \
do \
$(join $(OBJS), `ls $${curr_dir}/*.o`); \
done
echo $(OBJS);
How could I accomplish this with a script within a Makefile?
I'd do it this way:
DIRS = dir1 dir2 dir3 dir4 ...
OBJS = $(wildcard $(DIRS:=/*.o))
GENERATE_OBJECT_FILES:
@echo $(OBJS);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With