Theos - symlink fixer iterations Makefile
# 2nd iteration ifneq (,$(filter $(shell uname -s)-$(shell uname -p),Darwin-arm Darwin-arm64)) __DIR = var else __DIR = opt endif T := $(shell if [[ ! -f theos || ! "/$(__DIR)/theos" == `readlink theos` ]]; then rm -f theos; ln -s /$(__DIR)/theos theos; fi) # 3rd iteration __SYMLINK := /$(if $(filter $(shell uname -s)-$(shell uname -p),Darwin-arm Darwin-arm64),var,opt)/theos T := $(shell if [[ ! -f theos || ! "$(__SYMLINK)" == `readlink theos` ]]; then rm -f theos; ln -s $(__SYMLINK) theos; fi) # 4th iteration __SYMLINK := /$(if $(filter $(shell uname -s)-$(shell uname -p),Darwin-arm Darwin-arm64),var,opt)/theos T := $(shell [[ "$(__SYMLINK)" != `readlink theos` ]] && { rm -f theos; ln -s $(__SYMLINK) theos; }) # 5th iteration - doesn't work T := $(shell $(substr __SYMLINK,/$(if $(filter $(shell uname -s)-$(shell uname -p),Darwin-arm Darwin-arm64),var,opt)/theos,[[ "__SYMLINK" != `readlink theos` ]] && { rm -f theos; ln -s $(__SYMLINK) theos; }))