Print this page
10080 smatch Makefile changes for usr/src/cmd
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/file/Makefile
+++ new/usr/src/cmd/file/Makefile
1 1 #
2 2 # CDDL HEADER START
3 3 #
4 4 # The contents of this file are subject to the terms of the
5 5 # Common Development and Distribution License (the "License").
6 6 # You may not use this file except in compliance with the License.
7 7 #
8 8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 # or http://www.opensolaris.org/os/licensing.
10 10 # See the License for the specific language governing permissions
11 11 # and limitations under the License.
12 12 #
13 13 # When distributing Covered Code, include this CDDL HEADER in each
14 14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 # If applicable, add the following below this CDDL HEADER, with the
16 16 # fields enclosed by brackets "[]" replaced with your own identifying
17 17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 18 #
19 19 # CDDL HEADER END
20 20 #
21 21 #
22 22 # Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 23 # Use is subject to license terms.
24 24 #
25 +# Copyright (c) 2018, Joyent, Inc.
25 26
26 27 PROG= file
27 28 XPG4PROG= file
28 29 MAGIC= magic
29 30
30 31 ELFCAP= $(SRC)/common/elfcap
31 32 SGSRTCID= $(SRC)/common/sgsrtcid
32 33
33 34 LOBJS= file.o elf_read32.o elf_read64.o magicutils.o
34 35 OBJS= $(LOBJS) elfcap.o
35 36 XPG4OBJS= $(OBJS:%.o=xpg4_%.o)
↓ open down ↓ |
1 lines elided |
↑ open up ↑ |
36 37 SRCS= file.c elf_read.c magicutils.c $(ELFCAP)/elfcap.c
37 38
38 39 include ../Makefile.cmd
39 40
40 41 CSTD= $(CSTD_GNU99)
41 42 C99LMODE= -Xc99=%all
42 43
43 44 CERRWARN += -_gcc=-Wno-uninitialized
44 45 CERRWARN += -_gcc=-Wno-type-limits
45 46
47 +# not linted
48 +SMATCH=off
49 +
46 50 POFILE= file_all.po
47 51 POFILES= $(SRCS:%.c=%.po)
48 52
49 53 # The debug binary can be built using the flag
50 54 # -D COPTFLAG=-g CGLOBALSTATIC=
51 55 # This will avoid the multiple symbols definition error
52 56 # for static global variables in elf_read32.o and elf_read64.o
53 57
54 58 LDLIBS += -lelf
55 59 CPPFLAGS += -I$(ELFCAP) -I$(SGSRTCID)
56 60 $(XPG4) := CFLAGS += -DXPG4
57 61
58 62 ROOTETCMAGIC= $(MAGIC:%=$(ROOTETC)/%)
59 63
60 64 $(ROOTETCMAGIC) := FILEMODE = $(LIBFILEMODE)
61 65
62 66 .PARALLEL: $(OBJS) $(XPG4OBJS) $(POFILES)
63 67
64 68 .KEEP_STATE:
65 69
66 70 all: $(PROG) $(XPG4) $(MAGIC)
67 71
68 72 $(PROG) : $(OBJS)
69 73 $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
70 74 $(POST_PROCESS)
71 75
72 76 $(XPG4) : $(XPG4OBJS)
73 77 $(LINK.c) $(XPG4OBJS) -o $@ $(LDLIBS)
74 78 $(POST_PROCESS)
75 79
76 80 %.o: %.c
77 81 $(COMPILE.c) -o $@ $<
78 82
79 83 %32.o: %.c
80 84 $(COMPILE.c) -o $@ $<
81 85
82 86 %64.o: %.c
83 87 $(COMPILE.c) -D_ELF64 -o $@ $<
84 88
85 89 xpg4_%.o: %.c
86 90 $(COMPILE.c) -o $@ $<
87 91
88 92 xpg4_%32.o: %.c
89 93 $(COMPILE.c) -o $@ $<
90 94
91 95 xpg4_%64.o: %.c
92 96 $(COMPILE.c) -D_ELF64 -o $@ $<
93 97
94 98 elfcap.o: $(ELFCAP)/elfcap.c
95 99 $(COMPILE.c) -o $@ $(ELFCAP)/elfcap.c
96 100
97 101 xpg4_elfcap.o: $(ELFCAP)/elfcap.c
98 102 $(COMPILE.c) -o $@ $(ELFCAP)/elfcap.c
99 103
100 104 $(POFILE): $(POFILES)
101 105 $(RM) $@
102 106 cat $(POFILES) > $@
103 107
104 108 install: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTETCMAGIC)
105 109
106 110 clean:
107 111 $(RM) $(OBJS) $(XPG4OBJS)
108 112
109 113 lint: lint_SRCS
110 114
111 115 include ../Makefile.targ
↓ open down ↓ |
56 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX