xref: /titanic_50/usr/src/cmd/pools/poolcfg/Makefile (revision dfb96a4f56fb431b915bc67e5d9d5c8d4f4f6679)
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 (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
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#
22# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25#ident	"%Z%%M%	%I%	%E% SMI"
26#
27# cmd/pools/poolbind/Makefile
28
29PROG =		poolcfg
30OBJS =		poolcfg_lex.o poolcfg_grammar.o
31SRCS =		$(OBJS:%.o=%.c) $(COMMON_SRCS)
32POFILES = 	$(OBJS:.o=.po)
33POFILE =	poolcfg.po
34
35include ../../Makefile.cmd
36include ../Makefile.pools
37
38LFLAGS =	-t
39YFLAGS =	-d
40CFLAGS +=	-I$(POOLSCOMMONDIR)
41LDFLAGS +=	$(MAPFILE.NGB:%=-M%)
42LDLIBS +=	-lpool -ll
43XGETFLAGS =	-a
44CLOBBERFILES +=	poolcfg_lex.c poolcfg_grammar.c poolcfg_grammar.h
45
46.KEEP_STATE:
47
48all: $(PROG)
49
50$(PROG): $(OBJS) $(COMMON_OBJS) $(MAPFILE.NGB)
51	$(LINK.c) -o $@ $(OBJS) $(COMMON_OBJS) $(LDLIBS)
52	$(POST_PROCESS)
53
54%.o : $(POOLSCOMMONDIR)/%.c
55	$(COMPILE.c) -o $@ $<
56	$(POST_PROCESS_O)
57
58install: all $(ROOTUSRSBINPROG)
59
60poolcfg_lex.c: poolcfg.l poolcfg_grammar.h
61	$(LEX) $(LFLAGS) poolcfg.l > $@
62
63poolcfg_grammar.h poolcfg_grammar.c: poolcfg.y
64	$(YACC) $(YFLAGS) poolcfg.y
65	@$(MV) y.tab.h poolcfg_grammar.h
66	@$(MV) y.tab.c poolcfg_grammar.c
67
68poolcfg_lex.o poolcfg_grammar.o := CCVERBOSE =
69
70clean:
71	$(RM) $(OBJS) $(COMMON_OBJS) $(POFILES)
72
73$(POFILE):	$(POFILES)
74	$(RM) $@; cat $(POFILES) > $@
75
76#
77# We don't do lint of lex- and yacc- generated source files
78#
79lint:
80
81include ../../Makefile.targ
82