In my makefile I would like to print a process message (something like “Build $(PROJ_NAME) project…”) before building the dependencies of a target. For example my target look like this one below:
$(PROJ_NAME): $(OBJS)
echo "Build $(PROJ_NAME) project..."
$(LD) $(LDFLAGS) --gc-sections "-T$(MISC_DIR)/$(PROJ_NAME).ld" ...
Executing this target my build message is printed after building the dependencies in $(OBJS). Is there any possibility to print a message before doing anything creating the target?
You could add another dependency before the object files, that is always made. Something like this:
This
pre_buildtarget will (in most normal cases) always be executed before the targets in$(OBJS).