Unleashed v1.4
[unleashed.git] / usr / src / cmd / ucodeadm / Makefile
blob531820dfca5b4600b7ca4a26a34f80bad264e820
2 # CDDL HEADER START
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.
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.
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]
19 # CDDL HEADER END
22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
25 # Copyright 2017 RackTop Systems.
28 PROG = ucodeadm
30 PROG_OBJS = ucodeadm.o ucode_errno.o
31 COMMON_OBJS = ucode_utils.o
32 OBJS = $(PROG_OBJS) $(COMMON_OBJS)
33 COMMON_SRCDIR = ../../common/ucode
34 ERROR_HEADER = $(COMMON_SRCDIR)/ucode_errno.h
35 SRCS = $(PROG_OBJS:%.o=%.c) $(COMMON_OBJS:%.o=$(COMMON_SRCDIR)/%.c)
37 include ../Makefile.cmd
39 POFILE = ucodeadm_all.po
40 POFILES = $(PROG_OBJS:%.o=%.po)
42 INTEL_UCODE_FILE = intel-ucode.txt
43 AMD_UCODE_FILE = amd-ucode.bin
45 ROOTUCODEPATH = $(ROOT)/platform/ucode
46 ROOTINTELUCODE = $(INTEL_UCODE_FILE:%=$(ROOTUCODEPATH)/%)
47 ROOTAMDUCODE = $(AMD_UCODE_FILE:%=$(ROOTUCODEPATH)/%)
49 CPPFLAGS = -I../../common -I../../uts/common
50 CERRWARN += -Wno-uninitialized
51 CERRWARN += -Wno-type-limits
52 LDLIBS += -lgen
54 DIRMODE = 0755
55 FILEMODE = 0555
57 $(ROOTINTELUCODE) := FILEMODE = 0444
58 $(ROOTAMDUCODE) := FILEMODE = 0444
60 install := TARGET = install
61 clobber := TARGET = clobber
63 CLEANFILES += $(PROG) $(OBJS) ucode_errno.c $(POFILES) $(POFILE)
65 .KEEP_STATE:
67 all: $(PROG)
69 install: all $(ROOTUSRSBINPROG) $(ROOTUCODEPATH) $(ROOTINTELUCODE) $(ROOTAMDUCODE)
71 _msg: ucodeadm_all.po
73 %.o: $(COMMON_SRCDIR)/%.c
74 $(COMPILE.c) -o $@ $<
75 $(POST_PROCESS_O)
77 $(PROG): $(OBJS) ucode_errno.c
78 $(LINK.c) -o $(PROG) $(OBJS) $(LDLIBS)
79 $(POST_PROCESS)
81 $(ROOTUCODEPATH):
82 $(INS.dir)
84 $(ROOTUCODEPATH)/%: %
85 $(INS.file)
87 clean:
88 -$(RM) $(CLEANFILES)
92 include ../Makefile.targ
94 ucode_errno.c: $(COMMON_SRCDIR)/mkerrno.sh $(ERROR_HEADER)
95 sh $(COMMON_SRCDIR)/mkerrno.sh $(ERROR_HEADER) > $@
97 ucode_errno.po := XGETFLAGS += -a
99 $(POFILE): $(POFILES)
100 $(RM) $@
101 $(CAT) $(POFILES) > $@
103 FRC: