Merge illumos-gate
[unleashed.git] / usr / src / cmd / fs.d / udfs / fsdb / Makefile
blob15b4b80b5cec209ea93ef2b90f11b833e28a7983
2 # CDDL HEADER START
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.
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.
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]
19 # CDDL HEADER END
22 # Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
25 # Copyright (c) 2018, Joyent, Inc.
28 FSTYPE= udfs
29 LIBPROG= fsdb
31 include ../../Makefile.fstype
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.
36 MAPFILES += $(MAPFILE.INT) $(MAPFILE.LEX) $(MAPFILE.NGB)
37 MAPOPTS = $(MAPFILES:%=-Wl,-M%)
39 LDLIBS += -lmalloc -ll -ladm
40 LDFLAGS += $(MAPOPTS)
41 YFLAGS = "-d"
44 CERRWARN += -Wno-implicit-function-declaration
45 CERRWARN += -Wno-unused-label
46 CERRWARN += -Wno-unused-variable
47 CERRWARN += -Wno-uninitialized
48 CERRWARN += -Wno-unused-value
49 CERRWARN += -Wno-unused-function
51 # not linted
52 SMATCH=off
54 SRCS= fsdb.c ud_lib.c
56 fsdb : fsdb_yacc.o fsdb_lex.o ud_lib.o fsdb.o $(MAPFILES)
57 $(LINK.c) -o $@ fsdb.o fsdb_yacc.o fsdb_lex.o \
58 ud_lib.o $(LDLIBS)
59 $(POST_PROCESS)
61 fsdb.o : fsdb.c
62 $(COMPILE.c) -o $@ fsdb.c
63 $(POST_PROCESS_O)
65 ud_lib.o : ud_lib.c ud_lib.h
66 $(COMPILE.c) -o $@ ud_lib.c
67 $(POST_PROCESS_O)
69 ud_lib.c : ../fstyp/ud_lib.c
70 $(RM) $@
71 $(CP) ../fstyp/ud_lib.c $@
73 ud_lib.h : ../fstyp/ud_lib.h
74 $(RM) $@
75 $(CP) ../fstyp/ud_lib.h $@
77 y.tab.c : fsdb_yacc.y
78 $(YACC.y) fsdb_yacc.y
80 fsdb_yacc.o : y.tab.c
81 $(COMPILE.c) -o $@ y.tab.c
82 $(POST_PROCESS_O)
84 lex.yy.c : fsdb_lex.l
85 $(LEX) $(LFLAGS) -e fsdb_lex.l
87 fsdb_lex.o : lex.yy.c
88 $(COMPILE.c) -o $@ lex.yy.c
89 $(POST_PROCESS_O)
91 clean :
92 $(RM) ud_lib.c ud_lib.h fsdb.o ud_lib.o fsdb_yacc.o fsdb_lex.o
93 $(RM) fsdb_yacc.c fsdb_lex.c y.tab.c y.tab.h lex.yy.c
95 # for messaging catalog
97 POFILE= fsdb.po
99 # for messaging catalog
101 catalog: $(POFILE)
103 CATSRCS= $(SRCS) lex.yy.c y.tab.c
105 $(POFILE): $(CATSRCS) ud_lib.h
106 $(RM) $@
107 $(COMPILE.cpp) $(CATSRCS) > $(POFILE).i
108 $(XGETTEXT) $(XGETFLAGS) $(POFILE).i
109 $(SED) "/^domain/d" messages.po > $@
110 $(RM) $(POFILE).i messages.po
112 putback :
113 -cstyle -p fsdb.c
114 -keywords fsdb.c
115 -keywords Makefile