Print this page
cpp: enable as many warnings as practical
Split |
Close |
Expand all |
Collapse all |
--- old/cpp/Makefile
+++ new/cpp/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, Version 1.0 only
6 6 # (the "License"). You may not use this file except in compliance
7 7 # with the License.
8 8 #
9 9 # You can obtain a copy of the license at COPYING
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 COPYING.
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 # Copyright (c) 2012 Joyent Inc.
22 22 #
23 23
24 24 include ../Makefile.defs
25 25
↓ open down ↓ |
25 lines elided |
↑ open up ↑ |
26 26 PROG = cpp$(STRAP)
27 27 PROGDIR = /usr/lib
28 28
29 29 OBJS = \
30 30 cpp.o$(STRAP) \
31 31 y.tab.o$(STRAP)
32 32
33 33 CLEANFILES += \
34 34 y.tab.c$(STRAP)
35 35
36 -CFLAGS += -O2
36 +CERRWARN= -Wall -Wextra
37 +CERRWARN += -Wno-unknown-pragmas
38 +CERRWARN += -Wno-sign-compare
39 +CERRWARN += -Wno-unused-label
40 +CFLAGS += -O2 $(CERRWARN)
37 41 LD = $(GCC)
38 42
39 43 COMPILE.c = $(GCC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
40 44 LINK.prog = $(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
41 45 PROTOFILES = $(DESTDIR)$(PROGDIR)/$(PROG)
42 46
43 47 all: $(PROG)
44 48
45 49 install: $(PROTOFILES)
46 50
47 51 clean:
48 52 -rm -f $(OBJS) $(CLEANFILES) $(PROG) *strap
49 53
50 54 $(PROG): $(OBJS)
51 55 $(LINK.prog)
52 56
53 57 %.o$(STRAP): %.c
54 58 $(COMPILE.c)
55 59
56 60 y.tab.o$(STRAP): yylex.c
57 61
58 62 #
59 63 # We need to distinguish between the cpp build in the bootstrap and the cpp
60 64 # built normally. However, when we install it, they need to have the same name.
61 65 # To handle this we add a small bit of shell logic. Note that the mv bit is
62 66 # explicitly ignored and instead we do a final check to make sure we have
63 67 # something called cpp at the very end which will either be because of install
64 68 # or because of the later mv.
65 69 #
66 70 $(DESTDIR)$(PROGDIR)/%: %
67 71 mkdir -p $(DESTDIR)$(PROGDIR)
68 72 /usr/sbin/install -m 0755 -f $(DESTDIR)$(PROGDIR) $(PROG)
69 73 -[ "$(PROG)" == "cppstrap" ] && mv -f $(DESTDIR)$(PROGDIR)/$(PROG) \
70 74 $(DESTDIR)$(PROGDIR)/cpp
71 75 [ -f "$(DESTDIR)$(PROGDIR)/cpp" ]
72 76
73 77 y.tab.c: cpy.y
74 78 $(YACC) cpy.y
↓ open down ↓ |
28 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX