我想创建一个makefile,它可以编译我的对象并根据Linux发行版(例如Suse、RedHat或Ubuntu)为它们命名。我如何检测操作系统是否为Ubuntu?
cat /etc/lsb-release
来识别Ubuntu版本。sh-3.2$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.04
DISTRIB_CODENAME=hardy
DISTRIB_DESCRIPTION="Ubuntu 8.04.4 LTS"
ls /etc/*release
OS=$(shell lsb_release -si)
ARCH=$(shell uname -m | sed 's/x86_//;s/i[3-6]86/32/')
VER=$(shell lsb_release -sr)