xref: /titanic_41/usr/src/cmd/ucodeadm/Makefile (revision 7014882c6a3672fd0e5d60200af8643ae53c5928)
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#
252449e17fSsherrym
262449e17fSsherrymPROG = ucodeadm
272449e17fSsherrym
282449e17fSsherrymPROG_OBJS = ucodeadm.o ucode_errno.o
292449e17fSsherrymCOMMON_OBJS = ucode_utils.o
302449e17fSsherrymOBJS = $(PROG_OBJS) $(COMMON_OBJS)
312449e17fSsherrymCOMMON_SRCDIR = ../../common/ucode
322449e17fSsherrymERROR_HEADER = $(COMMON_SRCDIR)/ucode_errno.h
332449e17fSsherrymSRCS = $(PROG_OBJS:%.o=%.c) $(COMMON_OBJS:%.o=$(COMMON_SRCDIR)/%.c)
342449e17fSsherrym
352449e17fSsherryminclude	../Makefile.cmd
362449e17fSsherrym
372449e17fSsherrymPOFILE = ucodeadm_all.po
382449e17fSsherrymPOFILES = $(PROG_OBJS:%.o=%.po)
392449e17fSsherrym
402449e17fSsherrymINTEL_UCODE_FILE = intel-ucode.txt
410ba6f73dSMark JohnsonAMD_UCODE_FILE = amd-ucode.bin
422449e17fSsherrym
432449e17fSsherrymROOTUCODEPATH = $(ROOT)/platform/i86pc/ucode
442449e17fSsherrymROOTINTELUCODE = $(INTEL_UCODE_FILE:%=$(ROOTUCODEPATH)/%)
450ba6f73dSMark JohnsonROOTAMDUCODE = $(AMD_UCODE_FILE:%=$(ROOTUCODEPATH)/%)
462449e17fSsherrym
472449e17fSsherrymCPPFLAGS = -I../../common -I../../uts/common
48*7014882cSRichard LoweCFLAGS	+= $(CCVERBOSE)
49*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-uninitialized
50*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-type-limits
512449e17fSsherrymLINTFLAGS += -errtags -erroff=E_NAME_DEF_NOT_USED2
522449e17fSsherrymLINTFLAGS += -erroff=E_INCONS_ARG_DECL2,E_INCONS_VAL_TYPE_DECL2
532449e17fSsherrymLDLIBS = -lgen
542449e17fSsherrym
552449e17fSsherrymDIRMODE = 0755
562449e17fSsherrymFILEMODE = 0555
572449e17fSsherrym
582449e17fSsherrym$(ROOTINTELUCODE) := FILEMODE = 0444
590ba6f73dSMark Johnson$(ROOTAMDUCODE) := FILEMODE = 0444
602449e17fSsherrym
612449e17fSsherryminstall := TARGET = install
622449e17fSsherrymclobber := TARGET = clobber
632449e17fSsherrym
642449e17fSsherrymCLEANFILES += $(PROG) $(OBJS) ucode_errno.c $(POFILES) $(POFILE)
652449e17fSsherrym
662449e17fSsherrym.KEEP_STATE:
672449e17fSsherrym
682449e17fSsherrymall: $(PROG)
692449e17fSsherrym
700ba6f73dSMark Johnsoninstall: all $(ROOTUSRSBINPROG) $(ROOTUCODEPATH) $(ROOTINTELUCODE) $(ROOTAMDUCODE)
712449e17fSsherrym
722449e17fSsherrym_msg: ucodeadm_all.po
732449e17fSsherrym
742449e17fSsherrym%.o: $(COMMON_SRCDIR)/%.c
752449e17fSsherrym	$(COMPILE.c) -o $@ $<
762449e17fSsherrym	$(POST_PROCESS_O)
772449e17fSsherrym
782449e17fSsherrym$(PROG): $(OBJS) ucode_errno.c
792449e17fSsherrym	$(LINK.c) -o $(PROG) $(OBJS) $(LDLIBS)
802449e17fSsherrym	$(POST_PROCESS)
812449e17fSsherrym
822449e17fSsherrym$(ROOTUCODEPATH):
832449e17fSsherrym	$(INS.dir)
842449e17fSsherrym
852449e17fSsherrym$(ROOTUCODEPATH)/%: %
862449e17fSsherrym	$(INS.file)
872449e17fSsherrym
882449e17fSsherrymclean:
892449e17fSsherrym	-$(RM) $(CLEANFILES)
902449e17fSsherrym
912449e17fSsherrymlint:	lint_SRCS
922449e17fSsherrym
932449e17fSsherrym
942449e17fSsherryminclude	../Makefile.targ
952449e17fSsherrym
962449e17fSsherrymucode_errno.c: $(COMMON_SRCDIR)/mkerrno.sh $(ERROR_HEADER)
972449e17fSsherrym	sh $(COMMON_SRCDIR)/mkerrno.sh $(ERROR_HEADER) > $@
982449e17fSsherrym
992449e17fSsherrymucode_errno.po := XGETFLAGS += -a
1002449e17fSsherrym
1012449e17fSsherrym$(POFILE): $(POFILES)
1022449e17fSsherrym	$(RM) $@
1032449e17fSsherrym	$(CAT) $(POFILES) > $@
1042449e17fSsherrym
1052449e17fSsherrymFRC:
106