xref: /illumos-gate/usr/src/cmd/fm/fminject/Makefile.com (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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 2004 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)
53LDLIBS += -L$(ROOT)/usr/lib/fm -lfmd_log -lsysevent -lnvpair -lumem
54LDFLAGS += -R/usr/lib/fm
55LINTFLAGS = -mnux
56
57LFLAGS = -t -v
58YFLAGS = -d
59
60.PARALLEL: $(OBJS) $(LINTFILES)
61
62all: $(PROG)
63
64$(PROG): $(OBJS)
65	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
66	$(POST_PROCESS)
67
68inj_lex.c: ../common/inj_lex.l inj_grammar.c
69	$(LEX) $(LFLAGS) ../common/inj_lex.l > $@
70
71inj_grammar.c: ../common/inj_grammar.y
72	$(YACC) $(YFLAGS) ../common/inj_grammar.y
73	$(MV) y.tab.c inj_grammar.c
74	$(MV) y.tab.h inj_grammar.h
75
76%.o: %.c
77	$(COMPILE.c) $<
78
79%.o: ../common/%.c
80	$(COMPILE.c) $<
81
82clean:
83	$(RM) $(OBJS) $(LINTFILES) $(CLEANFILES)
84
85clobber: clean
86	$(RM) $(PROG)
87
88%.ln: %.c
89	$(LINT.c) -c $<
90
91%.ln: ../common/%.c
92	$(LINT.c) -c $<
93
94lint: $(LINTFILES)
95	$(LINT.c) $(LINTFILES) $(LDLIBS)
96
97$(ROOT)/usr/lib/fm:
98	$(INS.dir)
99
100$(ROOTPDIR): $(ROOT)/usr/lib/fm
101	$(INS.dir)
102
103$(ROOTPDIR)/%: %
104	$(INS.file)
105
106install_h:
107
108install: all $(ROOTPDIR) $(ROOTPROG)
109