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 
  28 FSTYPE=         udfs
  29 LIBPROG=        fsdb
  30 
  31 include         ../../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.
  36 MAPFILES +=     $(MAPFILE.INT) $(MAPFILE.LEX) $(MAPFILE.NGB)
  37 MAPOPTS =       $(MAPFILES:%=-M%)
  38 
  39 CPPFLAGS +=     -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
  40 CPPFLAGS +=     -I../fstyp
  41 LDLIBS +=       -lmalloc -ll -ladm
  42 LDFLAGS +=      $(MAPOPTS)
  43 YFLAGS =        "-d"
  44 
  45 LINTFLAGS +=    -erroff=E_STATIC_UNUSED
  46 LINTFLAGS64 +=  -erroff=E_STATIC_UNUSED
  47 
  48 CERRWARN +=     -_gcc=-Wno-implicit-function-declaration
  49 CERRWARN +=     -_gcc=-Wno-unused-label
  50 CERRWARN +=     -_gcc=-Wno-unused-variable
  51 CERRWARN +=     $(CNOWARN_UNINIT)
  52 CERRWARN +=     -_gcc=-Wno-unused-value
  53 CERRWARN +=     -_gcc=-Wno-unused-function
  54 
  55 
  56 # not linted
  57 SMATCH=off
  58 
  59 SRCS=   fsdb.c ../fstyp/ud_lib.c
  60 
  61 fsdb : 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 
  66 fsdb.o : fsdb.c
  67         $(COMPILE.c) -o $@ fsdb.c
  68         $(POST_PROCESS_O)
  69 
  70 ud_lib.o : ../fstyp/ud_lib.c ../fstyp/ud_lib.h
  71         $(COMPILE.c) -o $@ ../fstyp/ud_lib.c
  72         $(POST_PROCESS_O)
  73 
  74 y.tab.c : fsdb_yacc.y
  75         $(YACC.y) fsdb_yacc.y
  76 
  77 fsdb_yacc.o : y.tab.c
  78         $(COMPILE.c) -o $@ y.tab.c
  79         $(POST_PROCESS_O)
  80 
  81 lex.yy.c : fsdb_lex.l
  82         $(LEX) -e fsdb_lex.l
  83 
  84 fsdb_lex.o : lex.yy.c
  85         $(COMPILE.c) -o $@ lex.yy.c
  86         $(POST_PROCESS_O)
  87 
  88 clean :
  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 #
  94 POFILE= fsdb.po
  95 
  96 # for messaging catalog
  97 #
  98 catalog:        $(POFILE)
  99 
 100 CATSRCS=        $(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 
 109 lint: y.tab.c lex.yy.c ud_lib.c ud_lib.h
 110         $(LINT.c) -mu $(SRCS)
 111 
 112 putback :
 113         -cstyle -p fsdb.c
 114         -keywords fsdb.c
 115         -keywords Makefile
 116