xref: /titanic_41/usr/src/cmd/fs.d/udfs/fsdb/Makefile (revision f52e84dfce89ba2ea0ebb6a191b4466da3012efd)
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#pragma ident	"%Z%%M%	%I%	%E% SMI"
23#
24# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
25# Use is subject to license terms.
26#
27
28FSTYPE=		udfs
29LIBPROG=	fsdb
30
31include		../../Makefile.fstype
32
33# fsdb has a name clash with main() and libl.so.1.  However, fsdb must
34# still export a number of "yy*" (libl) interfaces.  Reduce all other symbols
35# to local scope.
36MAPFILES +=	$(MAPFILE.INT) $(MAPFILE.LEX) $(MAPFILE.NGB)
37MAPOPTS =	$(MAPFILES:%=-M%)
38
39CPPFLAGS +=	-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
40LDLIBS +=	-lmalloc -ll -ladm
41LDFLAGS +=	$(MAPOPTS)
42YFLAGS =	"-d"
43
44LINTFLAGS +=	-erroff=E_STATIC_UNUSED
45LINTFLAGS64 +=	-erroff=E_STATIC_UNUSED
46
47SRCS=	fsdb.c ud_lib.c
48
49fsdb : fsdb_yacc.o fsdb_lex.o ud_lib.o fsdb.o $(MAPFILES)
50	$(LINK.c) -o $@ fsdb.o fsdb_yacc.o fsdb_lex.o \
51			ud_lib.o $(LDLIBS)
52	$(POST_PROCESS)
53
54fsdb.o : fsdb.c
55	$(COMPILE.c) -o $@ fsdb.c
56	$(POST_PROCESS_O)
57
58ud_lib.o : ../fstyp/ud_lib.c
59	$(RM) ud_lib.c
60	$(CP) ../fstyp/ud_lib.c ud_lib.c
61	$(RM) ud_lib.h
62	$(CP) ../fstyp/ud_lib.h ud_lib.h
63	$(COMPILE.c) -o $@ ud_lib.c
64	$(POST_PROCESS_O)
65
66y.tab.c : fsdb_yacc.y
67	$(YACC.y) fsdb_yacc.y
68
69fsdb_yacc.o : y.tab.c
70	$(COMPILE.c) -o $@ y.tab.c
71	$(POST_PROCESS_O)
72
73lex.yy.c : fsdb_lex.l
74	$(LEX) -e fsdb_lex.l
75
76fsdb_lex.o : lex.yy.c
77	$(COMPILE.c) -o $@ lex.yy.c
78	$(POST_PROCESS_O)
79
80clean :
81	$(RM) ud_lib.c ud_lib.h fsdb.o ud_lib.o fsdb_yacc.o fsdb_lex.o
82	$(RM) fsdb_yacc.c fsdb_lex.c y.tab.c y.tab.h lex.yy.c
83
84# for messaging catalog
85#
86POFILE= fsdb.po
87
88# for messaging catalog
89#
90catalog:        $(POFILE)
91
92CATSRCS=	$(SRCS) lex.yy.c y.tab.c
93
94$(POFILE):      $(CATSRCS)
95	$(RM) $@
96	$(COMPILE.cpp) $(CATSRCS)   > $(POFILE).i
97	$(XGETTEXT) $(XGETFLAGS)        $(POFILE).i
98	$(SED) "/^domain/d" messages.po >  $@
99	$(RM) $(POFILE).i messages.po
100
101lint: y.tab.c lex.yy.c
102	$(RM) ud_lib.h
103	$(CP) ../fstyp/ud_lib.h ud_lib.h
104	$(RM) ud_lib.c
105	$(CP) ../fstyp/ud_lib.c ud_lib.c
106	$(LINT.c) -mu $(SRCS)
107
108putback :
109	-cstyle -p fsdb.c
110	-keywords fsdb.c
111	-keywords Makefile
112
113