diff --git a/src/stub/Makefile b/src/stub/Makefile index 920c421a..a85d8ab3 100644 --- a/src/stub/Makefile +++ b/src/stub/Makefile @@ -29,8 +29,10 @@ endif # // # ************************************************************************/ -srcdir = . -top_srcdir = ../.. +ifndef srcdir +srcdir := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) +srcdir := $(shell echo '$(srcdir)' | sed 's,/*$$,,') +endif STUBS += amd64-linux.elf-entry.h STUBS += amd64-linux.elf-fold.h