16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 #
19 # CDDL HEADER END
20 #
21 # Copyright (c) 2012 Joyent Inc.
22 #
23
24 include ../Makefile.defs
25
26 PROG = cpp$(STRAP)
27 PROGDIR = /usr/lib
28
29 OBJS = \
30 cpp.o$(STRAP) \
31 y.tab.o$(STRAP)
32
33 CLEANFILES += \
34 y.tab.c$(STRAP)
35
36 CFLAGS += -O2
37 LD = $(GCC)
38
39 COMPILE.c = $(GCC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
40 LINK.prog = $(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
41 PROTOFILES = $(DESTDIR)$(PROGDIR)/$(PROG)
42
43 all: $(PROG)
44
45 install: $(PROTOFILES)
46
47 clean:
48 -rm -f $(OBJS) $(CLEANFILES) $(PROG) *strap
49
50 $(PROG): $(OBJS)
51 $(LINK.prog)
52
53 %.o$(STRAP): %.c
54 $(COMPILE.c)
55
56 y.tab.o$(STRAP): yylex.c
|
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 #
19 # CDDL HEADER END
20 #
21 # Copyright (c) 2012 Joyent Inc.
22 #
23
24 include ../Makefile.defs
25
26 PROG = cpp$(STRAP)
27 PROGDIR = /usr/lib
28
29 OBJS = \
30 cpp.o$(STRAP) \
31 y.tab.o$(STRAP)
32
33 CLEANFILES += \
34 y.tab.c$(STRAP)
35
36 CERRWARN= -Wall -Wextra
37 CERRWARN += -Wno-unknown-pragmas
38 CERRWARN += -Wno-sign-compare
39 CERRWARN += -Wno-unused-label
40 CFLAGS += -O2 $(CERRWARN)
41 LD = $(GCC)
42
43 COMPILE.c = $(GCC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
44 LINK.prog = $(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
45 PROTOFILES = $(DESTDIR)$(PROGDIR)/$(PROG)
46
47 all: $(PROG)
48
49 install: $(PROTOFILES)
50
51 clean:
52 -rm -f $(OBJS) $(CLEANFILES) $(PROG) *strap
53
54 $(PROG): $(OBJS)
55 $(LINK.prog)
56
57 %.o$(STRAP): %.c
58 $(COMPILE.c)
59
60 y.tab.o$(STRAP): yylex.c
|