Skip to content

Commit 1c0d661

Browse files
committed
Do not build biosdecode, ownership and vpddecode on IA-64, as IA-64
systems have no BIOS. This was quite tricky to keep both GNU make and BSD make happy, but it seems that I finally succeeded.
1 parent 6d8234b commit 1c0d661

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

Makefile

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,14 @@ INSTALL_DIR := $(INSTALL) -m 755 -d
3434
INSTALL_PROGRAM := $(INSTALL) -m 755
3535
RM := rm -f
3636

37-
all : dmidecode biosdecode ownership vpddecode
37+
PROGRAMS := dmidecode
38+
PROGRAMS += $(shell test `uname -m 2>/dev/null` != ia64 && echo biosdecode ownership vpddecode)
39+
# BSD make doesn't understand the $(shell) syntax above, it wants the !=
40+
# syntax below. GNU make ignores the line below so in the end both BSD
41+
# make and GNU make are happy.
42+
PROGRAMS != echo dmidecode ; test `uname -m 2>/dev/null` != ia64 && echo biosdecode ownership vpddecode
43+
44+
all : $(PROGRAMS)
3845

3946
#
4047
# Programs
@@ -85,38 +92,30 @@ util.o : util.c types.h util.h config.h
8592
# Commands
8693
#
8794

88-
strip : all
89-
strip dmidecode biosdecode ownership vpddecode
95+
strip : $(PROGRAMS)
96+
strip $(PROGRAMS)
9097

9198
install : install-bin install-man install-doc
9299

93100
uninstall : uninstall-bin uninstall-man uninstall-doc
94101

95-
install-bin : all
102+
install-bin : $(PROGRAMS)
96103
$(INSTALL_DIR) $(DESTDIR)$(sbindir)
97-
$(INSTALL_PROGRAM) dmidecode $(DESTDIR)$(sbindir)
98-
$(INSTALL_PROGRAM) biosdecode $(DESTDIR)$(sbindir)
99-
$(INSTALL_PROGRAM) ownership $(DESTDIR)$(sbindir)
100-
$(INSTALL_PROGRAM) vpddecode $(DESTDIR)$(sbindir)
104+
for program in $(PROGRAMS) ; do \
105+
$(INSTALL_PROGRAM) $$program $(DESTDIR)$(sbindir) ; done
101106

102107
uninstall-bin :
103-
$(RM) $(DESTDIR)$(sbindir)/dmidecode
104-
$(RM) $(DESTDIR)$(sbindir)/biosdecode
105-
$(RM) $(DESTDIR)$(sbindir)/ownership
106-
$(RM) $(DESTDIR)$(sbindir)/vpddecode
108+
for program in $(PROGRAMS) ; do \
109+
$(RM) $(DESTDIR)$(sbindir)/$$program ; done
107110

108111
install-man :
109112
$(INSTALL_DIR) $(DESTDIR)$(man8dir)
110-
$(INSTALL_DATA) man/dmidecode.8 $(DESTDIR)$(man8dir)
111-
$(INSTALL_DATA) man/biosdecode.8 $(DESTDIR)$(man8dir)
112-
$(INSTALL_DATA) man/ownership.8 $(DESTDIR)$(man8dir)
113-
$(INSTALL_DATA) man/vpddecode.8 $(DESTDIR)$(man8dir)
113+
for program in $(PROGRAMS) ; do \
114+
$(INSTALL_DATA) man/$$program.8 $(DESTDIR)$(man8dir) ; done
114115

115116
uninstall-man :
116-
$(RM) $(DESTDIR)$(man8dir)/dmidecode.8
117-
$(RM) $(DESTDIR)$(man8dir)/biosdecode.8
118-
$(RM) $(DESTDIR)$(man8dir)/ownership.8
119-
$(RM) $(DESTDIR)$(man8dir)/vpddecode.8
117+
for program in $(PROGRAMS) ; do \
118+
$(RM) $(DESTDIR)$(man8dir)/$$program.8
120119

121120
install-doc :
122121
$(INSTALL_DIR) $(DESTDIR)$(docdir)
@@ -128,4 +127,4 @@ uninstall-doc :
128127
$(RM) -r $(DESTDIR)$(docdir)
129128

130129
clean :
131-
$(RM) *.o dmidecode biosdecode ownership vpddecode core
130+
$(RM) *.o $(PROGRAMS) core

README

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ this version.
121121
** MISCELLANEOUS TOOLS **
122122

123123
Three other tools come along with dmidecode: biosdecode, ownership and
124-
vpddecode.
124+
vpddecode. These tools are only useful on systems with a BIOS, so they
125+
are not built on IA-64 by default.
125126

126127
BIOSDECODE
127128

0 commit comments

Comments
 (0)