xref: /illumos-gate/usr/src/cmd/fs.d/udfs/fsdb/Makefile (revision c023f651c0471d0024cb0a436d1f77bf37350180)
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# Copyright (c) 2018, Joyent, Inc.
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
40CPPFLAGS +=	-I../fstyp
41LDLIBS +=	-lmalloc -ll -ladm
42LDFLAGS +=	$(MAPOPTS)
43YFLAGS =	"-d"
44
45LINTFLAGS +=	-erroff=E_STATIC_UNUSED
46LINTFLAGS64 +=	-erroff=E_STATIC_UNUSED
47
48CERRWARN +=	-_gcc=-Wno-implicit-function-declaration
49CERRWARN +=	-_gcc=-Wno-unused-label
50CERRWARN +=	-_gcc=-Wno-unused-variable
51CERRWARN +=	-_gcc=-Wno-uninitialized
52CERRWARN +=	-_gcc=-Wno-unused-value
53CERRWARN +=	-_gcc=-Wno-unused-function
54
55
56# not linted
57SMATCH=off
58
59SRCS=	fsdb.c ../fstyp/ud_lib.c
60
61fsdb : fsdb_yacc.o fsdb_lex.o ud_lib.o fsdb.o $(MAPFILES)
62	$(LINK.c) -o $@ fsdb.o fsdb_yacc.o fsdb_lex.o \
63			ud_lib.o $(LDLIBS)
64	$(POST_PROCESS)
65
66fsdb.o : fsdb.c
67	$(COMPILE.c) -o $@ fsdb.c
68	$(POST_PROCESS_O)
69
70ud_lib.o : ../fstyp/ud_lib.c ../fstyp/ud_lib.h
71	$(COMPILE.c) -o $@ ../fstyp/ud_lib.c
72	$(POST_PROCESS_O)
73
74y.tab.c : fsdb_yacc.y
75	$(YACC.y) fsdb_yacc.y
76
77fsdb_yacc.o : y.tab.c
78	$(COMPILE.c) -o $@ y.tab.c
79	$(POST_PROCESS_O)
80
81lex.yy.c : fsdb_lex.l
82	$(LEX) -e fsdb_lex.l
83
84fsdb_lex.o : lex.yy.c
85	$(COMPILE.c) -o $@ lex.yy.c
86	$(POST_PROCESS_O)
87
88clean :
89	$(RM) fsdb.o ud_lib.o fsdb_yacc.o fsdb_lex.o
90	$(RM) fsdb_yacc.c fsdb_lex.c y.tab.c y.tab.h lex.yy.c
91
92# for messaging catalog
93#
94POFILE= fsdb.po
95
96# for messaging catalog
97#
98catalog:        $(POFILE)
99
100CATSRCS=	$(SRCS) lex.yy.c y.tab.c
101
102$(POFILE):      $(CATSRCS) ../fstyp/ud_lib.h
103	$(RM) $@
104	$(COMPILE.cpp) $(CATSRCS)   > $(POFILE).i
105	$(XGETTEXT) $(XGETFLAGS)        $(POFILE).i
106	$(SED) "/^domain/d" messages.po >  $@
107	$(RM) $(POFILE).i messages.po
108
109lint: y.tab.c lex.yy.c ud_lib.c ud_lib.h
110	$(LINT.c) -mu $(SRCS)
111
112putback :
113	-cstyle -p fsdb.c
114	-keywords fsdb.c
115	-keywords Makefile
116
117