File: Makefile

package info (click to toggle)
intel-microcode 3.20150121.1
  • links: PTS, VCS
  • area: non-free
  • in suites: jessie-kfreebsd
  • size: 9,968 kB
  • sloc: sh: 148; makefile: 109
file content (103 lines) | stat: -rw-r--r-- 3,763 bytes parent folder | download
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
PATH := $(PATH):/sbin:/usr/sbin
IUCODE_TOOL ?= iucode_tool
IUC_FLAGS := -vv
IUC_QUIET_FLAGS := -q
IUC_FINAL_FLAGS := -vv

# CUTDATE RANGE
# This filter selects what we consider to be old microcode which
# should still be shipped even if Intel dropped them.  Note that
# it is useless to ship microcodes for anything the distro doesn't
# really support anymore
#
# Watch out: check in the changelog, if this filter will add
# microcodes that look like they've been recalled, use IUC_EXCLUDE
# below to avoid shipping the probably recalled microcode.
# Last manual check: up to 2008-01-01
IUC_OLDIES_SELECT := "--date-before=2008-01-01"

# EXCLUDING MICROCODES:
# Always document reason.  See iucode_tool(8) for -s !<sig> syntax
# Recalls might require use of .fw overrides to retain old version,
# instead of exclusions.  Exclusions have the highest priority, and
# will remove microcode added by any other means, including override
# files (.fw files).
IUC_EXCLUDE :=

# 0x106c0: alpha hardware, seen in a very very old microcode data file
IUC_EXCLUDE += -s !0x106c0

# INCLUDING MICROCODES:
# This should be used to add a microcode from any of the microcode
# bundles, without the need for an override file. See iucode_tool(8)
# for -s <sig> syntax.  Always document the reason, as per IUC_EXCLUDE.
IUC_INCLUDE :=

# ##EXAMPLE ## DO NOT ENABLE##
# 0x106a5: Xeon X55xx: Intel recalled some errata fixes for unknown
# reasons, and then stopped shipping the microcode at rev 0x15.  HP ships
# revision 0x16 for their DL360/DL380 G6/G7 servers.  Supermicro ships
# revision 0x16 for their X8SAX/C7X58 motherboard.
#
# IUC_INCLUDE += -s 0x000106a5
# ##EXAMPLE##

# Keep sorting order predictable or things will break
export LC_COLLATE=C

MICROCODE_SOURCES   := $(sort $(wildcard microcode-*.dat microcode-*.bin))
MICROCODE_OVERRIDES := $(wildcard *.fw)

MICROCODE_FINAL_SOURCES := 
ifneq ($(IUC_OLDIES_SELECT),)
	MICROCODE_FINAL_SOURCES += microcode-oldies.pbin
endif
ifneq ($(IUC_INCLUDE),)
	MICROCODE_FINAL_SOURCES += microcode-extras.pbin
endif
MICROCODE_FINAL_SOURCES += $(lastword $(MICROCODE_SOURCES))
ifneq ($(MICROCODE_OVERRIDES),)
	MICROCODE_FINAL_SOURCES += microcode-overrides.pbin
endif

all: intel-microcode.bin intel-microcode-64.bin

#
# We have to build a list of microcode signatures for very old microcode
# that is likely to be droped as legacy from newer bundles, and then
# select the newest microcode available for each such signature.
#
microcode-oldies.pbin: $(MICROCODE_SOURCES)
	@echo
	@echo Building microcode bundle for older microcode...
	@$(IUCODE_TOOL) $(IUC_FLAGS) $(IUC_OLDIES_SELECT) \
		--loose-date-filtering --downgrade --overwrite -w "$@" $^

microcode-extras.pbin: $(MICROCODE_SOURCES)
	@echo
	@echo Building microcode bundle for extra microcode...
	@$(IUCODE_TOOL) $(IUC_FLAGS) -s! $(IUC_INCLUDE) --downgrade --overwrite -w "$@" $^

# The microcode overrides are bundled together to sort out any
# duplication and revision level issues.
microcode-overrides.pbin: $(MICROCODE_OVERRIDES)
	@echo
	@echo Preprocessing microcode overrides...
	@$(IUCODE_TOOL) $(IUC_FLAGS) --overwrite -w "$@" $^

# Final target
intel-microcode.bin: $(MICROCODE_FINAL_SOURCES)
	@echo
	@echo Building final microcode bundle...
	@$(IUCODE_TOOL) $(IUC_FINAL_FLAGS) $(IUC_EXCLUDE) --downgrade --overwrite -w "$@" $^

intel-microcode-64.bin: intel-microcode.bin
	@echo
	@echo Building stripped-down microcode bundle for x86-64 and x32...
	@$(IUCODE_TOOL) $(IUC_FINAL_FLAGS) $(shell sed -n -r -e '/^i.86/ { s/^[^ ]+ +/-s !/;s/ +\#.*//;p}' cpu-signatures.txt) $(IUC_EXCLUDE) --overwrite -w "$@" $^

distclean: clean
clean:
	rm -f intel-microcode-64.bin intel-microcode.bin microcode-overrides.pbin microcode-oldies.pbin microcode-extras.pbin

.PHONY: clean