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