xref: /illumos-gate/usr/src/cmd/fs.d/udfs/fsdb/Makefile (revision 287247a826fa2ab8d01f6c8f276d405eb08420f8)
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 : ud_lib.c ud_lib.h
64	$(COMPILE.c) -o $@ ud_lib.c
65	$(POST_PROCESS_O)
66
67ud_lib.c : ../fstyp/ud_lib.c
68	$(RM) $@
69	$(CP) ../fstyp/ud_lib.c $@
70
71ud_lib.h : ../fstyp/ud_lib.h
72	$(RM) $@
73	$(CP) ../fstyp/ud_lib.h $@
74
75y.tab.c : fsdb_yacc.y
76	$(YACC.y) fsdb_yacc.y
77
78fsdb_yacc.o : y.tab.c
79	$(COMPILE.c) -o $@ y.tab.c
80	$(POST_PROCESS_O)
81
82lex.yy.c : fsdb_lex.l
83	$(LEX) -e fsdb_lex.l
84
85fsdb_lex.o : lex.yy.c
86	$(COMPILE.c) -o $@ lex.yy.c
87	$(POST_PROCESS_O)
88
89clean :
90	$(RM) ud_lib.c ud_lib.h fsdb.o ud_lib.o fsdb_yacc.o fsdb_lex.o
91	$(RM) fsdb_yacc.c fsdb_lex.c y.tab.c y.tab.h lex.yy.c
92
93# for messaging catalog
94#
95POFILE= fsdb.po
96
97# for messaging catalog
98#
99catalog:        $(POFILE)
100
101CATSRCS=	$(SRCS) lex.yy.c y.tab.c
102
103$(POFILE):      $(CATSRCS)
104	$(RM) $@
105	$(COMPILE.cpp) $(CATSRCS)   > $(POFILE).i
106	$(XGETTEXT) $(XGETFLAGS)        $(POFILE).i
107	$(SED) "/^domain/d" messages.po >  $@
108	$(RM) $(POFILE).i messages.po
109
110lint: y.tab.c lex.yy.c ud_lib.c ud_lib.h
111	$(LINT.c) -mu $(SRCS)
112
113putback :
114	-cstyle -p fsdb.c
115	-keywords fsdb.c
116	-keywords Makefile
117
118