 <p>I propose two solutions. The first mimics what NetBeans IDE generates:</p> <pre><code>CC=gcc .PHONY: all clean all: post-build pre-build: @echo PRE post-build: main-build @echo POST main-build: pre-build @$(MAKE) --no-print-directory target target: $(OBJS) $(CC) -o $@ $(OBJS) clean: rm -f $(OBJS) target </code></pre> <p>The second one is inpired by what Eclipse IDE generates:</p> <pre><code>CC=gcc .PHONY: all clean .SECONDARY: main-build all: pre-build main-build pre-build: @echo PRE post-build: @echo POST main-build: target target: $(OBJS) $(CC) -o $@ $(OBJS) @$(MAKE) --no-print-directory post-build clean: rm -f $(OBJS) target </code></pre> <p>Note that in the first one, pre and post builds are always called regardless of whether the main build is determined to be up to date or not.</p> <p>In the second one, the post-build step is not executed if the state of the main build is up to date. While the pre-build step is always executed in both.</p>