12449e17fSsherrym# 22449e17fSsherrym# CDDL HEADER START 32449e17fSsherrym# 42449e17fSsherrym# The contents of this file are subject to the terms of the 52449e17fSsherrym# Common Development and Distribution License (the "License"). 62449e17fSsherrym# You may not use this file except in compliance with the License. 72449e17fSsherrym# 82449e17fSsherrym# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 92449e17fSsherrym# or http://www.opensolaris.org/os/licensing. 102449e17fSsherrym# See the License for the specific language governing permissions 112449e17fSsherrym# and limitations under the License. 122449e17fSsherrym# 132449e17fSsherrym# When distributing Covered Code, include this CDDL HEADER in each 142449e17fSsherrym# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 152449e17fSsherrym# If applicable, add the following below this CDDL HEADER, with the 162449e17fSsherrym# fields enclosed by brackets "[]" replaced with your own identifying 172449e17fSsherrym# information: Portions Copyright [yyyy] [name of copyright owner] 182449e17fSsherrym# 192449e17fSsherrym# CDDL HEADER END 202449e17fSsherrym# 212449e17fSsherrym# 220ba6f73dSMark Johnson# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 232449e17fSsherrym# Use is subject to license terms. 242449e17fSsherrym# 2502dc24bdSAndrew Stormont# Copyright 2017 RackTop Systems. 2602dc24bdSAndrew Stormont# 272449e17fSsherrym 282449e17fSsherrymPROG = ucodeadm 292449e17fSsherrym 302449e17fSsherrymPROG_OBJS = ucodeadm.o ucode_errno.o 312449e17fSsherrymCOMMON_OBJS = ucode_utils.o 322449e17fSsherrymOBJS = $(PROG_OBJS) $(COMMON_OBJS) 332449e17fSsherrymCOMMON_SRCDIR = ../../common/ucode 342449e17fSsherrymERROR_HEADER = $(COMMON_SRCDIR)/ucode_errno.h 352449e17fSsherrymSRCS = $(PROG_OBJS:%.o=%.c) $(COMMON_OBJS:%.o=$(COMMON_SRCDIR)/%.c) 362449e17fSsherrym 372449e17fSsherryminclude ../Makefile.cmd 382449e17fSsherrym 392449e17fSsherrymPOFILE = ucodeadm_all.po 402449e17fSsherrymPOFILES = $(PROG_OBJS:%.o=%.po) 412449e17fSsherrym 422449e17fSsherrymINTEL_UCODE_FILE = intel-ucode.txt 430ba6f73dSMark JohnsonAMD_UCODE_FILE = amd-ucode.bin 442449e17fSsherrym 452449e17fSsherrymROOTUCODEPATH = $(ROOT)/platform/i86pc/ucode 462449e17fSsherrymROOTINTELUCODE = $(INTEL_UCODE_FILE:%=$(ROOTUCODEPATH)/%) 470ba6f73dSMark JohnsonROOTAMDUCODE = $(AMD_UCODE_FILE:%=$(ROOTUCODEPATH)/%) 482449e17fSsherrym 492449e17fSsherrymCPPFLAGS = -I../../common -I../../uts/common 507014882cSRichard LoweCFLAGS += $(CCVERBOSE) 51*d3b5f563SJohn LevonCERRWARN += $(CNOWARN_UNINIT) 527014882cSRichard LoweCERRWARN += -_gcc=-Wno-type-limits 532449e17fSsherrymLINTFLAGS += -errtags -erroff=E_NAME_DEF_NOT_USED2 542449e17fSsherrymLINTFLAGS += -erroff=E_INCONS_ARG_DECL2,E_INCONS_VAL_TYPE_DECL2 5502dc24bdSAndrew StormontLDLIBS += -lgen 562449e17fSsherrym 572449e17fSsherrymDIRMODE = 0755 582449e17fSsherrymFILEMODE = 0555 592449e17fSsherrym 602449e17fSsherrym$(ROOTINTELUCODE) := FILEMODE = 0444 610ba6f73dSMark Johnson$(ROOTAMDUCODE) := FILEMODE = 0444 622449e17fSsherrym 632449e17fSsherryminstall := TARGET = install 642449e17fSsherrymclobber := TARGET = clobber 652449e17fSsherrym 662449e17fSsherrymCLEANFILES += $(PROG) $(OBJS) ucode_errno.c $(POFILES) $(POFILE) 672449e17fSsherrym 682449e17fSsherrym.KEEP_STATE: 692449e17fSsherrym 702449e17fSsherrymall: $(PROG) 712449e17fSsherrym 720ba6f73dSMark Johnsoninstall: all $(ROOTUSRSBINPROG) $(ROOTUCODEPATH) $(ROOTINTELUCODE) $(ROOTAMDUCODE) 732449e17fSsherrym 742449e17fSsherrym_msg: ucodeadm_all.po 752449e17fSsherrym 762449e17fSsherrym%.o: $(COMMON_SRCDIR)/%.c 772449e17fSsherrym $(COMPILE.c) -o $@ $< 782449e17fSsherrym $(POST_PROCESS_O) 792449e17fSsherrym 802449e17fSsherrym$(PROG): $(OBJS) ucode_errno.c 812449e17fSsherrym $(LINK.c) -o $(PROG) $(OBJS) $(LDLIBS) 822449e17fSsherrym $(POST_PROCESS) 832449e17fSsherrym 842449e17fSsherrym$(ROOTUCODEPATH): 852449e17fSsherrym $(INS.dir) 862449e17fSsherrym 872449e17fSsherrym$(ROOTUCODEPATH)/%: % 882449e17fSsherrym $(INS.file) 892449e17fSsherrym 902449e17fSsherrymclean: 912449e17fSsherrym -$(RM) $(CLEANFILES) 922449e17fSsherrym 932449e17fSsherrymlint: lint_SRCS 942449e17fSsherrym 952449e17fSsherrym 962449e17fSsherryminclude ../Makefile.targ 972449e17fSsherrym 982449e17fSsherrymucode_errno.c: $(COMMON_SRCDIR)/mkerrno.sh $(ERROR_HEADER) 992449e17fSsherrym sh $(COMMON_SRCDIR)/mkerrno.sh $(ERROR_HEADER) > $@ 1002449e17fSsherrym 1012449e17fSsherrymucode_errno.po := XGETFLAGS += -a 1022449e17fSsherrym 1032449e17fSsherrym$(POFILE): $(POFILES) 1042449e17fSsherrym $(RM) $@ 1052449e17fSsherrym $(CAT) $(POFILES) > $@ 1062449e17fSsherrym 1072449e17fSsherrymFRC: 108