OBJCOPY ?= objcopy CFLAGS += -g -Wall -O2 -pipe LDFLAGS += -Wl,-z,relro LDFLAGS += -Wl,-O1 LDFLAGS += -Wl,--enable-new-dtags LDFLAGS += -Wl,--hash-style=both #LDFLAGS += -Wl,--disable-new-dtags #LDFLAGS += -Wl,--hash-style=sysv def: $(MAKE) clean all all: foo.dbg $(OBJCOPY) --strip-debug foo $(OBJCOPY) --add-gnu-debuglink=foo.dbg foo foo.dbg: foo $(OBJCOPY) --only-keep-debug foo foo.dbg clean: rm -f foo foo.dbg .PHONY: all clean