xref: /illumos-gate/usr/src/cmd/fs.d/udfs/fsdb/Makefile (revision 28ab0ca48b3e331cbbb231b1c8325f9f24f9af95)
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:%=-Wl,-M%)
38
39CPPFLAGS +=	-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
40CPPFLAGS +=	-I../fstyp
41LDLIBS +=	-lmalloc -ll -ladm
42LDFLAGS +=	$(MAPOPTS)
43YFLAGS =	"-d"
44
45CERRWARN +=	-_gcc=-Wno-implicit-function-declaration
46CERRWARN +=	-_gcc=-Wno-unused-label
47CERRWARN +=	-_gcc=-Wno-unused-variable
48CERRWARN +=	$(CNOWARN_UNINIT)
49CERRWARN +=	-_gcc=-Wno-unused-value
50CERRWARN +=	-_gcc=-Wno-unused-function
51
52
53# not linted
54SMATCH=off
55
56SRCS=	fsdb.c ../fstyp/ud_lib.c
57
58fsdb : fsdb_yacc.o fsdb_lex.o ud_lib.o fsdb.o $(MAPFILES)
59	$(LINK.c) -o $@ fsdb.o fsdb_yacc.o fsdb_lex.o \
60			ud_lib.o $(LDLIBS)
61	$(POST_PROCESS)
62
63fsdb.o : fsdb.c
64	$(COMPILE.c) -o $@ fsdb.c
65	$(POST_PROCESS_O)
66
67ud_lib.o : ../fstyp/ud_lib.c ../fstyp/ud_lib.h
68	$(COMPILE.c) -o $@ ../fstyp/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) 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) ../fstyp/ud_lib.h
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