summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkhali <khali>2010-10-11 14:08:16 +0000
committerkhali <khali>2010-10-11 14:08:16 +0000
commit327901d0a49c63eb3cd4074f744d7f00324b4cfb (patch)
tree4865934e1db75b82772697b623b8cdb5a1483fe0
parent44e5d085383e1574f31c19efc12e7bf05760e466 (diff)
downloaddmidecode-327901d0a49c63eb3cd4074f744d7f00324b4cfb.tar.gz
Rework BSD make compatibility trick. The previous trick would break
GNU make 3.82.
-rw-r--r--Makefile18
1 files changed, 12 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 0bc8662..55378bb 100644
--- a/Makefile
+++ b/Makefile
@@ -38,12 +38,18 @@ INSTALL_DIR := $(INSTALL) -m 755 -d
INSTALL_PROGRAM := $(INSTALL) -m 755
RM := rm -f
-PROGRAMS := dmidecode
-PROGRAMS += $(shell test `uname -m 2>/dev/null` != ia64 && echo biosdecode ownership vpddecode)
-# BSD make doesn't understand the $(shell) syntax above, it wants the !=
-# syntax below. GNU make ignores the line below so in the end both BSD
-# make and GNU make are happy.
-PROGRAMS != echo dmidecode ; test `uname -m 2>/dev/null` != ia64 && echo biosdecode ownership vpddecode
+# BSD make provides $MACHINE, but GNU make doesn't
+MACHINE ?= $(shell uname -m 2>/dev/null)
+
+# These programs are only useful on x86
+PROGRAMS-i386 := biosdecode ownership vpddecode
+PROGRAMS-i486 := $(PROGRAMS-i386)
+PROGRAMS-i586 := $(PROGRAMS-i386)
+PROGRAMS-i686 := $(PROGRAMS-i386)
+PROGRAMS-x86_64 := biosdecode ownership vpddecode
+PROGRAMS-amd64 := $(PROGRAMS-x86_64)
+
+PROGRAMS := dmidecode $(PROGRAMS-$(MACHINE))
all : $(PROGRAMS)