22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
24 #
25 # Copyright 2017 RackTop Systems.
26 #
27
28 PROG = ucodeadm
29
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)
36
37 include ../Makefile.cmd
38
39 POFILE = ucodeadm_all.po
40 POFILES = $(PROG_OBJS:%.o=%.po)
41
42 INTEL_UCODE_FILE = intel-ucode.txt
43 AMD_UCODE_FILE = amd-ucode.bin
44
45 ROOTUCODEPATH = $(ROOT)/platform/i86pc/ucode
46 ROOTINTELUCODE = $(INTEL_UCODE_FILE:%=$(ROOTUCODEPATH)/%)
47 ROOTAMDUCODE = $(AMD_UCODE_FILE:%=$(ROOTUCODEPATH)/%)
48
49 CPPFLAGS = -I../../common -I../../uts/common
50 CFLAGS += $(CCVERBOSE)
51 CERRWARN += $(CNOWARN_UNINIT)
52 CERRWARN += -_gcc=-Wno-type-limits
53 LINTFLAGS += -errtags -erroff=E_NAME_DEF_NOT_USED2
54 LINTFLAGS += -erroff=E_INCONS_ARG_DECL2,E_INCONS_VAL_TYPE_DECL2
55 LDLIBS += -lgen
56
57 DIRMODE = 0755
58 FILEMODE = 0555
59
60 $(ROOTINTELUCODE) := FILEMODE = 0444
61 $(ROOTAMDUCODE) := FILEMODE = 0444
62
63 install := TARGET = install
64 clobber := TARGET = clobber
65
66 CLEANFILES += $(PROG) $(OBJS) ucode_errno.c $(POFILES) $(POFILE)
67
68 .KEEP_STATE:
69
70 all: $(PROG)
71
72 install: all $(ROOTUSRSBINPROG) $(ROOTUCODEPATH) $(ROOTINTELUCODE) $(ROOTAMDUCODE)
73
74 _msg: ucodeadm_all.po
75
76 %.o: $(COMMON_SRCDIR)/%.c
77 $(COMPILE.c) -o $@ $<
78 $(POST_PROCESS_O)
79
80 $(PROG): $(OBJS) ucode_errno.c
81 $(LINK.c) -o $(PROG) $(OBJS) $(LDLIBS)
82 $(POST_PROCESS)
83
84 $(ROOTUCODEPATH):
85 $(INS.dir)
86
87 $(ROOTUCODEPATH)/%: %
88 $(INS.file)
89
90 clean:
91 -$(RM) $(CLEANFILES)
92
93 lint: lint_SRCS
94
95
96 include ../Makefile.targ
97
98 ucode_errno.c: $(COMMON_SRCDIR)/mkerrno.sh $(ERROR_HEADER)
99 sh $(COMMON_SRCDIR)/mkerrno.sh $(ERROR_HEADER) > $@
100
101 ucode_errno.po := XGETFLAGS += -a
102
103 $(POFILE): $(POFILES)
104 $(RM) $@
105 $(CAT) $(POFILES) > $@
106
107 FRC:
|
22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
24 #
25 # Copyright 2017 RackTop Systems.
26 #
27
28 PROG = ucodeadm
29
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)
36
37 include ../Makefile.cmd
38
39 POFILE = ucodeadm_all.po
40 POFILES = $(PROG_OBJS:%.o=%.po)
41
42 CPPFLAGS = -I../../common -I../../uts/common
43 CFLAGS += $(CCVERBOSE)
44 CERRWARN += $(CNOWARN_UNINIT)
45 CERRWARN += -_gcc=-Wno-type-limits
46 LINTFLAGS += -errtags -erroff=E_NAME_DEF_NOT_USED2
47 LINTFLAGS += -erroff=E_INCONS_ARG_DECL2,E_INCONS_VAL_TYPE_DECL2
48 LDLIBS += -lgen
49
50 DIRMODE = 0755
51 FILEMODE = 0555
52
53 install := TARGET = install
54 clobber := TARGET = clobber
55
56 CLEANFILES += $(PROG) $(OBJS) ucode_errno.c $(POFILES) $(POFILE)
57
58 .KEEP_STATE:
59
60 all: $(PROG)
61
62 install: all $(ROOTUSRSBINPROG)
63
64 _msg: ucodeadm_all.po
65
66 %.o: $(COMMON_SRCDIR)/%.c
67 $(COMPILE.c) -o $@ $<
68 $(POST_PROCESS_O)
69
70 $(PROG): $(OBJS) ucode_errno.c
71 $(LINK.c) -o $(PROG) $(OBJS) $(LDLIBS)
72 $(POST_PROCESS)
73
74 clean:
75 -$(RM) $(CLEANFILES)
76
77 lint: lint_SRCS
78
79
80 include ../Makefile.targ
81
82 ucode_errno.c: $(COMMON_SRCDIR)/mkerrno.sh $(ERROR_HEADER)
83 sh $(COMMON_SRCDIR)/mkerrno.sh $(ERROR_HEADER) > $@
84
85 ucode_errno.po := XGETFLAGS += -a
86
87 $(POFILE): $(POFILES)
88 $(RM) $@
89 $(CAT) $(POFILES) > $@
90
91 FRC:
|