xref: /titanic_50/usr/src/cmd/fm/fminject/Makefile.com (revision 0167b58cea98965c58fab4be4e690b6e456f7440)
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#ident	"%Z%%M%	%I%	%E% SMI"
27
28.KEEP_STATE:
29.SUFFIXES:
30
31SRCS += \
32	inj_cmds.c \
33	inj_decl.c \
34	inj_defn.c \
35	inj_err.c \
36	inj_hash.c \
37	inj_list.c \
38	inj_log.c \
39	inj_main.c \
40	inj_string.c \
41	inj_umem.c \
42	inj_util.c
43
44PROG = fminject
45ROOTPDIR = $(ROOT)/usr/lib/fm/fmd
46ROOTPROG = $(ROOTPDIR)/$(PROG)
47OBJS = $(SRCS:%.c=%.o) inj_grammar.o inj_lex.o
48LINTFILES = $(SRCS:%.c=%.ln)
49CLEANFILES += inj_grammar.c inj_grammar.h inj_lex.c y.tab.h y.tab.c
50
51CPPFLAGS += -I. -I../common
52CFLAGS += $(CCVERBOSE) $(CTF_FLAGS)
53LDLIBS += -L$(ROOT)/usr/lib/fm -lfmd_log -lsysevent -lnvpair -lumem
54LDFLAGS += -R/usr/lib/fm
55LINTFLAGS = -mnux
56STRIPFLAG =
57
58LFLAGS = -t -v
59YFLAGS = -d
60
61.PARALLEL: $(OBJS) $(LINTFILES)
62
63all: $(PROG)
64
65$(PROG): $(OBJS)
66	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
67	$(CTFMERGE) -L VERSION -o $@ $(OBJS)
68	$(POST_PROCESS)
69
70inj_lex.c: ../common/inj_lex.l inj_grammar.c
71	$(LEX) $(LFLAGS) ../common/inj_lex.l > $@
72
73inj_grammar.c: ../common/inj_grammar.y
74	$(YACC) $(YFLAGS) ../common/inj_grammar.y
75	$(MV) y.tab.c inj_grammar.c
76	$(MV) y.tab.h inj_grammar.h
77
78%.o: %.c
79	$(COMPILE.c) $<
80	$(CTFCONVERT_O)
81
82%.o: ../common/%.c
83	$(COMPILE.c) $<
84	$(CTFCONVERT_O)
85
86clean:
87	$(RM) $(OBJS) $(LINTFILES) $(CLEANFILES)
88
89clobber: clean
90	$(RM) $(PROG)
91
92%.ln: %.c
93	$(LINT.c) -c $<
94
95%.ln: ../common/%.c
96	$(LINT.c) -c $<
97
98lint: $(LINTFILES)
99	$(LINT.c) $(LINTFILES) $(LDLIBS)
100
101$(ROOT)/usr/lib/fm:
102	$(INS.dir)
103
104$(ROOTPDIR): $(ROOT)/usr/lib/fm
105	$(INS.dir)
106
107$(ROOTPDIR)/%: %
108	$(INS.file)
109
110install_h:
111
112install: all $(ROOTPDIR) $(ROOTPROG)
113