I'm using the GNU make implicit rule for linking together my binary as follows:
foo : foo.o bar.o
However, I also want to be able to compile the resulting binary foo
with UPX (by invoking upx ultra-brute foo
) on it afterwards. I can, of course, do something like this:
foo : foo.o bar.o
$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
upx --ultra-brute $@
However, this is basically forcing me to repeat the implicit rule, while all I really want to do is just also call upx ultra-brute
after what it already does anyway. Is there a way to get what I want without basically having to manually write the implicit rule into the recipe anyway?