xref: /illumos-gate/usr/src/cmd/fm/fminject/Makefile.com (revision fd71220ba0fafcc9cf5ea0785db206f3f31336e7)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26
27.KEEP_STATE:
28.SUFFIXES:
29
30SRCS += \
31	inj_cmds.c \
32	inj_decl.c \
33	inj_defn.c \
34	inj_err.c \
35	inj_hash.c \
36	inj_list.c \
37	inj_log.c \
38	inj_main.c \
39	inj_string.c \
40	inj_umem.c \
41	inj_util.c
42
43PROG = fminject
44ROOTPDIR = $(ROOT)/usr/lib/fm/fmd
45ROOTPROG = $(ROOTPDIR)/$(PROG)
46OBJS = $(SRCS:%.c=%.o) inj_grammar.o inj_lex.o
47CLEANFILES += inj_grammar.c inj_grammar.h inj_lex.c y.tab.h y.tab.c
48
49CPPFLAGS += -I. -I../common
50CFLAGS += $(CCVERBOSE) $(CTF_FLAGS)
51CERRWARN += -_gcc=-Wno-switch
52CERRWARN += $(CNOWARN_UNINIT)
53CERRWARN += -_gcc=-Wno-type-limits
54CERRWARN += -_gcc=-Wno-unused-variable
55LDLIBS += -L$(ROOT)/usr/lib/fm -lfmd_log -lsysevent -lnvpair -lumem
56LDFLAGS += -R/usr/lib/fm
57STRIPFLAG =
58
59# because of labels from yacc
60inj_grammar.o inj_lex.o := CERRWARN += -_gcc=-Wno-unused-label
61
62LFLAGS = -t -v
63YFLAGS = -d
64
65.PARALLEL: $(OBJS)
66
67all: $(PROG)
68
69$(PROG): $(OBJS)
70	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
71	$(CTFMERGE) -L VERSION -o $@ $(OBJS)
72	$(POST_PROCESS)
73
74inj_lex.c: ../common/inj_lex.l inj_grammar.c
75	$(LEX) $(LFLAGS) ../common/inj_lex.l > $@
76
77inj_grammar.c: ../common/inj_grammar.y
78	$(YACC) $(YFLAGS) ../common/inj_grammar.y
79	$(MV) y.tab.c inj_grammar.c
80	$(MV) y.tab.h inj_grammar.h
81
82%.o: %.c
83	$(COMPILE.c) $<
84	$(CTFCONVERT_O)
85
86%.o: ../common/%.c
87	$(COMPILE.c) $<
88	$(CTFCONVERT_O)
89
90clean:
91	$(RM) $(OBJS) $(LINTFILES) $(CLEANFILES)
92
93clobber: clean
94	$(RM) $(PROG)
95
96$(ROOT)/usr/lib/fm:
97	$(INS.dir)
98
99$(ROOTPDIR): $(ROOT)/usr/lib/fm
100	$(INS.dir)
101
102$(ROOTPDIR)/%: %
103	$(INS.file)
104
105install_h:
106
107install: all $(ROOTPDIR) $(ROOTPROG)
108