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