installboot: fix stage2 size check for MBR
[unleashed.git] / usr / src / cmd / ucodeadm / Makefile
blobe1f4b8602c993a912206b9493d5d1b2c260974a2
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.
26 PROG = ucodeadm
28 PROG_OBJS = ucodeadm.o ucode_errno.o
29 COMMON_OBJS = ucode_utils.o
30 OBJS = $(PROG_OBJS) $(COMMON_OBJS)
31 COMMON_SRCDIR = ../../common/ucode
32 ERROR_HEADER = $(COMMON_SRCDIR)/ucode_errno.h
33 SRCS = $(PROG_OBJS:%.o=%.c) $(COMMON_OBJS:%.o=$(COMMON_SRCDIR)/%.c)
35 include ../Makefile.cmd
37 POFILE = ucodeadm_all.po
38 POFILES = $(PROG_OBJS:%.o=%.po)
40 INTEL_UCODE_FILE = intel-ucode.txt
41 AMD_UCODE_FILE = amd-ucode.bin
43 ROOTUCODEPATH = $(ROOT)/platform/i86pc/ucode
44 ROOTINTELUCODE = $(INTEL_UCODE_FILE:%=$(ROOTUCODEPATH)/%)
45 ROOTAMDUCODE = $(AMD_UCODE_FILE:%=$(ROOTUCODEPATH)/%)
47 CPPFLAGS = -I../../common -I../../uts/common
48 CERRWARN += -_gcc=-Wno-uninitialized
49 CERRWARN += -_gcc=-Wno-type-limits
50 LDLIBS = -lgen
52 DIRMODE = 0755
53 FILEMODE = 0555
55 $(ROOTINTELUCODE) := FILEMODE = 0444
56 $(ROOTAMDUCODE) := FILEMODE = 0444
58 install := TARGET = install
59 clobber := TARGET = clobber
61 CLEANFILES += $(PROG) $(OBJS) ucode_errno.c $(POFILES) $(POFILE)
63 .KEEP_STATE:
65 all: $(PROG)
67 install: all $(ROOTUSRSBINPROG) $(ROOTUCODEPATH) $(ROOTINTELUCODE) $(ROOTAMDUCODE)
69 _msg: ucodeadm_all.po
71 %.o: $(COMMON_SRCDIR)/%.c
72 $(COMPILE.c) -o $@ $<
73 $(POST_PROCESS_O)
75 $(PROG): $(OBJS) ucode_errno.c
76 $(LINK.c) -o $(PROG) $(OBJS) $(LDLIBS)
77 $(POST_PROCESS)
79 $(ROOTUCODEPATH):
80 $(INS.dir)
82 $(ROOTUCODEPATH)/%: %
83 $(INS.file)
85 clean:
86 -$(RM) $(CLEANFILES)
90 include ../Makefile.targ
92 ucode_errno.c: $(COMMON_SRCDIR)/mkerrno.sh $(ERROR_HEADER)
93 sh $(COMMON_SRCDIR)/mkerrno.sh $(ERROR_HEADER) > $@
95 ucode_errno.po := XGETFLAGS += -a
97 $(POFILE): $(POFILES)
98 $(RM) $@
99 $(CAT) $(POFILES) > $@
101 FRC: