blob: 5e641b36df9025da67ee6e63e542d57d48c3c193 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
#
# DMI Decode
# BIOS Decode
#
# (C) 2000-2002 Alan Cox <alan@redhat.com>
# (C) 2002-2005 Jean Delvare <khali@linux-fr.org>
#
# Licensed under the GNU Public License.
#
CC = gcc
CFLAGS = -W -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual \
-Wcast-align -Wwrite-strings -Wmissing-prototypes -Winline
#CFLAGS += -DBIGENDIAN
#CFLAGS += -DALIGNMENT_WORKAROUND
# When debugging, disable -O2 and enable -g.
CFLAGS += -O2
#CFLAGS += -g
# Pass linker flags here
LDFLAGS =
DESTDIR =
prefix = /usr/local
sbindir = $(prefix)/sbin
mandir = $(prefix)/share/man
man8dir = $(mandir)/man8
docdir = $(prefix)/share/doc/dmidecode
all : dmidecode biosdecode ownership vpddecode
#
# Programs
#
dmidecode : dmidecode.o util.o
$(CC) $(LDFLAGS) dmidecode.o util.o -o $@
biosdecode : biosdecode.o util.o
$(CC) $(LDFLAGS) biosdecode.o util.o -o $@
ownership : ownership.o util.o
$(CC) $(LDFLAGS) ownership.o util.o -o $@
vpddecode : vpddecode.o util.o
$(CC) $(LDFLAGS) vpddecode.o util.o -o $@
#
# Objects
#
dmidecode.o : dmidecode.c version.h types.h util.h config.h
$(CC) $(CFLAGS) -c $< -o $@
biosdecode.o : biosdecode.c version.h types.h util.h config.h
$(CC) $(CFLAGS) -c $< -o $@
ownership.o : ownership.c version.h types.h util.h config.h
$(CC) $(CFLAGS) -c $< -o $@
vpddecode.o : vpddecode.c version.h types.h util.h config.h
$(CC) $(CFLAGS) -c $< -o $@
util.o : util.c types.h util.h config.h
$(CC) $(CFLAGS) -c $< -o $@
#
# Commands
#
strip : all
strip dmidecode biosdecode ownership vpddecode
install : install-bin install-man install-doc
uninstall : uninstall-bin uninstall-man uninstall-doc
install-bin : all
install -d $(DESTDIR)$(sbindir)
install -m 755 dmidecode $(DESTDIR)$(sbindir)
install -m 755 biosdecode $(DESTDIR)$(sbindir)
install -m 755 ownership $(DESTDIR)$(sbindir)
install -m 755 vpddecode $(DESTDIR)$(sbindir)
uninstall-bin :
rm -f $(DESTDIR)$(sbindir)/dmidecode
rm -f $(DESTDIR)$(sbindir)/biosdecode
rm -f $(DESTDIR)$(sbindir)/ownership
rm -f $(DESTDIR)$(sbindir)/vpddecode
install-man :
install -d $(DESTDIR)$(man8dir)
install -m 644 man/dmidecode.8 $(DESTDIR)$(man8dir)
install -m 644 man/biosdecode.8 $(DESTDIR)$(man8dir)
install -m 644 man/ownership.8 $(DESTDIR)$(man8dir)
install -m 644 man/vpddecode.8 $(DESTDIR)$(man8dir)
uninstall-man :
rm -f $(DESTDIR)$(man8dir)/dmidecode.8
rm -f $(DESTDIR)$(man8dir)/biosdecode.8
rm -f $(DESTDIR)$(man8dir)/ownership.8
rm -f $(DESTDIR)$(man8dir)/vpddecode.8
install-doc :
install -d $(DESTDIR)$(docdir)
install -m 644 README $(DESTDIR)$(docdir)
install -m 644 CHANGELOG $(DESTDIR)$(docdir)
install -m 644 AUTHORS $(DESTDIR)$(docdir)
uninstall-doc :
rm -rf $(DESTDIR)$(docdir)
clean :
rm -f *.o dmidecode biosdecode ownership vpddecode core
|