Print this page
10476 file(1) could be smatch clean
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.
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 25 # Copyright (c) 2018, Joyent, Inc.
26 26
27 27 PROG= file
28 28 XPG4PROG= file
29 29 MAGIC= magic
30 30
31 31 ELFCAP= $(SRC)/common/elfcap
32 32 SGSRTCID= $(SRC)/common/sgsrtcid
33 33
34 34 LOBJS= file.o elf_read32.o elf_read64.o magicutils.o
35 35 OBJS= $(LOBJS) elfcap.o
36 36 XPG4OBJS= $(OBJS:%.o=xpg4_%.o)
↓ open down ↓ |
36 lines elided |
↑ open up ↑ |
37 37 SRCS= file.c elf_read.c magicutils.c $(ELFCAP)/elfcap.c
38 38
39 39 include ../Makefile.cmd
40 40
41 41 CSTD= $(CSTD_GNU99)
42 42 C99LMODE= -Xc99=%all
43 43
44 44 CERRWARN += -_gcc=-Wno-uninitialized
45 45 CERRWARN += -_gcc=-Wno-type-limits
46 46
47 -# not linted
48 -SMATCH=off
49 -
50 47 POFILE= file_all.po
51 48 POFILES= $(SRCS:%.c=%.po)
52 49
53 50 # The debug binary can be built using the flags
54 51 # SOURCEDEBUG=yes CGLOBALSTATIC=
55 52 # This will avoid the multiple symbols definition error
56 53 # for static global variables in elf_read32.o and elf_read64.o
57 54
58 55 LDLIBS += -lelf
59 56 CPPFLAGS += -I$(ELFCAP) -I$(SGSRTCID)
60 57 $(XPG4) := CFLAGS += -DXPG4
61 58
62 59 ROOTETCMAGIC= $(MAGIC:%=$(ROOTETC)/%)
63 60
64 61 $(ROOTETCMAGIC) := FILEMODE = $(LIBFILEMODE)
65 62
66 63 .PARALLEL: $(OBJS) $(XPG4OBJS) $(POFILES)
67 64
68 65 .KEEP_STATE:
69 66
70 67 all: $(PROG) $(XPG4) $(MAGIC)
71 68
72 69 $(PROG) : $(OBJS)
73 70 $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
74 71 $(POST_PROCESS)
75 72
76 73 $(XPG4) : $(XPG4OBJS)
77 74 $(LINK.c) $(XPG4OBJS) -o $@ $(LDLIBS)
78 75 $(POST_PROCESS)
79 76
80 77 %.o: %.c
81 78 $(COMPILE.c) -o $@ $<
82 79
83 80 %32.o: %.c
84 81 $(COMPILE.c) -o $@ $<
85 82
86 83 %64.o: %.c
87 84 $(COMPILE.c) -D_ELF64 -o $@ $<
88 85
89 86 xpg4_%.o: %.c
90 87 $(COMPILE.c) -o $@ $<
91 88
92 89 xpg4_%32.o: %.c
93 90 $(COMPILE.c) -o $@ $<
94 91
95 92 xpg4_%64.o: %.c
96 93 $(COMPILE.c) -D_ELF64 -o $@ $<
97 94
98 95 elfcap.o: $(ELFCAP)/elfcap.c
99 96 $(COMPILE.c) -o $@ $(ELFCAP)/elfcap.c
100 97
101 98 xpg4_elfcap.o: $(ELFCAP)/elfcap.c
102 99 $(COMPILE.c) -o $@ $(ELFCAP)/elfcap.c
103 100
104 101 $(POFILE): $(POFILES)
105 102 $(RM) $@
106 103 cat $(POFILES) > $@
107 104
108 105 install: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTETCMAGIC)
109 106
110 107 clean:
111 108 $(RM) $(OBJS) $(XPG4OBJS)
112 109
113 110 lint: lint_SRCS
114 111
115 112 include ../Makefile.targ
↓ open down ↓ |
56 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX