1# 2# CDDL HEADER START 3# 4# The contents of this file are subject to the terms of the 5# Common Development and Distribution License (the "License"). 6# You may not use this file except in compliance with the License. 7# 8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9# or http://www.opensolaris.org/os/licensing. 10# See the License for the specific language governing permissions 11# and limitations under the License. 12# 13# When distributing Covered Code, include this CDDL HEADER in each 14# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15# If applicable, add the following below this CDDL HEADER, with the 16# fields enclosed by brackets "[]" replaced with your own identifying 17# information: Portions Copyright [yyyy] [name of copyright owner] 18# 19# CDDL HEADER END 20# 21# 22# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23# Use is subject to license terms. 24# 25# Copyright 2017 RackTop Systems. 26# Copyright 2022 OmniOS Community Edition (OmniOSce) Association. 27# Copyright 2025 Oxide Computer Company 28# 29 30PROG = ucodeadm 31 32PROG_OBJS = ucodeadm.o ucode_errno.o 33COMMON_OBJS = ucode_utils_intel.o ucode_utils_amd.o bitext.o 34OBJS = $(PROG_OBJS) $(COMMON_OBJS) 35COMMON_SRCDIR = ../../common/ucode 36ERROR_HEADER = $(COMMON_SRCDIR)/ucode_errno.h 37 38include ../Makefile.cmd 39include ../Makefile.ctf 40 41POFILE = ucodeadm_all.po 42POFILES = $(PROG_OBJS:%.o=%.po) 43 44CSTD = $(CSTD_GNU17) 45CPPFLAGS += -I$(SRC)/common 46CFLAGS += $(CCVERBOSE) 47LDLIBS += -lgen 48 49DIRMODE = 0755 50FILEMODE = 0555 51 52install := TARGET = install 53clobber := TARGET = clobber 54 55CLEANFILES += $(PROG) $(OBJS) ucode_errno.c $(POFILES) $(POFILE) 56 57.KEEP_STATE: 58 59all: $(PROG) 60 61install: all $(ROOTUSRSBINPROG) 62 63_msg: ucodeadm_all.po 64 65%.o: $(COMMON_SRCDIR)/%.c 66 $(COMPILE.c) -o $@ $< 67 $(POST_PROCESS_O) 68 69%.o: $(SRC)/common/bitext/%.c 70 $(COMPILE.c) $< 71 $(POST_PROCESS_O) 72 73$(PROG): $(OBJS) ucode_errno.c 74 $(LINK.c) -o $(PROG) $(OBJS) $(LDLIBS) 75 $(POST_PROCESS) 76 77clean: 78 -$(RM) $(CLEANFILES) 79 80include ../Makefile.targ 81 82ucode_errno.c: $(COMMON_SRCDIR)/mkerrno.sh $(ERROR_HEADER) 83 sh $(COMMON_SRCDIR)/mkerrno.sh $(ERROR_HEADER) > $@ 84 85ucode_errno.po := XGETFLAGS += -a 86 87$(POFILE): $(POFILES) 88 $(RM) $@ 89 $(CAT) $(POFILES) > $@ 90 91FRC: 92