xref: /illumos-gate/usr/src/cmd/fs.d/udfs/fsdb/Makefile (revision 8119dad84d6416f13557b0ba8e2aaf9064cbcfd3)
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../common
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 +=	-_gcc=-Wno-unused-value
49CERRWARN +=	-_gcc=-Wno-unused-function
50
51
52# not linted
53SMATCH=off
54
55SRCS=	fsdb.c ../common/ud_lib.c
56
57fsdb : fsdb_yacc.o fsdb_lex.o ud_lib.o fsdb.o $(MAPFILES)
58	$(LINK.c) -o $@ fsdb.o fsdb_yacc.o fsdb_lex.o \
59			ud_lib.o $(LDLIBS)
60	$(POST_PROCESS)
61
62fsdb.o : fsdb.c
63	$(COMPILE.c) -o $@ fsdb.c
64	$(POST_PROCESS_O)
65
66ud_lib.o : ../common/ud_lib.c ../common/ud_lib.h
67	$(COMPILE.c) -o $@ ../common/ud_lib.c
68	$(POST_PROCESS_O)
69
70y.tab.c : fsdb_yacc.y
71	$(YACC.y) fsdb_yacc.y
72
73fsdb_yacc.o : y.tab.c
74	$(COMPILE.c) -o $@ y.tab.c
75	$(POST_PROCESS_O)
76
77lex.yy.c : fsdb_lex.l
78	$(LEX) -e fsdb_lex.l
79
80fsdb_lex.o : lex.yy.c
81	$(COMPILE.c) -o $@ lex.yy.c
82	$(POST_PROCESS_O)
83
84clean :
85	$(RM) fsdb.o ud_lib.o fsdb_yacc.o fsdb_lex.o
86	$(RM) fsdb_yacc.c fsdb_lex.c y.tab.c y.tab.h lex.yy.c
87
88# for messaging catalog
89#
90POFILE= fsdb.po
91
92# for messaging catalog
93#
94catalog:        $(POFILE)
95
96CATSRCS=	$(SRCS) lex.yy.c y.tab.c
97
98$(POFILE):      $(CATSRCS) ../common/ud_lib.h
99	$(RM) $@
100	$(COMPILE.cpp) $(CATSRCS)   > $(POFILE).i
101	$(XGETTEXT) $(XGETFLAGS)        $(POFILE).i
102	$(SED) "/^domain/d" messages.po >  $@
103	$(RM) $(POFILE).i messages.po
104