Print this page
12482 Have /usr/bin/awk point to /usr/bin/nawk
Reviewed by: Peter Tribble <peter.tribble@gmail.com>
Reviewed by: Toomas Soome <tsoome@me.com>


  11 # See the License for the specific language governing permissions
  12 # and limitations under the License.
  13 #
  14 # When distributing Covered Code, include this CDDL HEADER in each
  15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16 # If applicable, add the following below this CDDL HEADER, with the
  17 # fields enclosed by brackets "[]" replaced with your own identifying
  18 # information: Portions Copyright [yyyy] [name of copyright owner]
  19 #
  20 # CDDL HEADER END
  21 #
  22 #
  23 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 #
  26 # Copyright 2020 Joyent, Inc.
  27 
  28 include         ../Makefile.cmd
  29 
  30 PROG =          oawk
  31 LINKPROG =      awk
  32 
  33 SRCS =          b.c lib.c main.c parse.c run.c tran.c
  34 
  35 #TXTS =         README EXPLAIN
  36 
  37 OBJS =          awk.g.o awk.lx.o proctab.o tmptoken.o           \
  38                 $(SRCS:%.c=%.o)
  39 
  40 #
  41 # for message catalogue
  42 #
  43 POFILES=        $(OBJS:%.o=%.po)
  44 POFILE=         oawk.po
  45 XGETFLAGS +=    -a -x oawk.xcl
  46 
  47 NATIVEDIR =     native
  48 MAKEPRCTAB =    $(NATIVEDIR)/makeprctab
  49 
  50 NATIVEOBJS =    $(NATIVEDIR)/makeprctab.o $(NATIVEDIR)/tmptoken.o
  51 $(MAKEPRCTAB) :=        CC = $(NATIVECC)
  52 $(MAKEPRCTAB) :=        POST_PROCESS=
  53 $(MAKEPRCTAB) :=        POST_PROCESS_O=
  54 $(MAKEPRCTAB) :=        NATIVE_LIBS += libm.so libc.so
  55 
  56 CLEANFILES =    proctab.c y.tab.h y.tab.c awk.h awk.g.c         \
  57                 tmptoken.c awk.lx.c $(NATIVEOBJS) $(MAKEPRCTAB) \
  58                 temp
  59 
  60 YFLAGS =        -d
  61 LDLIBS += -lm
  62 CPPFLAGS =      -I. $(CPPFLAGS.master)
  63 CPPFLAGS +=     -D_FILE_OFFSET_BITS=64
  64 
  65 ROOTLINK =      $(LINKPROG:%=$(ROOTBIN)/%)
  66 
  67 CERRWARN +=     -_gcc=-Wno-implicit-function-declaration
  68 CERRWARN +=     -_gcc=-Wno-unused-label
  69 CERRWARN +=     -_gcc=-Wno-unused-variable
  70 CERRWARN +=     -_gcc=-Wno-extra
  71 CERRWARN +=     -_gcc=-Wno-parentheses
  72 
  73 # missing type declarations
  74 SMATCH =        off
  75 
  76 .KEEP_STATE :
  77 
  78 all :           $(PROG) $(TXTS)
  79 
  80 $(PROG) :       $(OBJS)
  81                 $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
  82                 $(POST_PROCESS)
  83 
  84 $(POFILE):      $(POFILES)
  85                 $(RM)   $@
  86                 $(CAT)  $(POFILES) > $@


  88 awk.g.c + awk.h :       awk.g.y
  89                 $(RM) awk.g.c awk.h
  90                 $(YACC.y) awk.g.y
  91                 $(MV) y.tab.c awk.g.c
  92                 $(MV) y.tab.h awk.h
  93 
  94 awk.lx.c:       awk.lx.l
  95                 $(LEX.l) -w awk.lx.l > awk.lx.c
  96 
  97 tmptoken.c :    tokenscript token.c
  98                 $(RM) $@
  99                 ed - < tokenscript
 100 
 101 proctab.c :     $(MAKEPRCTAB)
 102                 $(RM) $@
 103                 $(MAKEPRCTAB) > $@
 104 
 105 $(MAKEPRCTAB) : $(NATIVEDIR) $(NATIVEOBJS)
 106                 $(LINK.c) $(NATIVEOBJS) -o $@ $(XLDLIBS5CC)
 107 
 108 install :       all $(ROOTPROG) $(ROOTLINK)
 109 
 110 $(NATIVEDIR) :
 111                 -@mkdir -p $(NATIVEDIR)
 112 
 113 $(NATIVEDIR)/%.o :      %.c
 114                 $(COMPILE.c) -o $@ $<
 115 
 116 $(ROOTLINK) :   $(ROOTPROG)
 117                 $(RM) $@; $(LN) $(ROOTPROG) $@
 118 
 119 clean:
 120                 $(RM) $(OBJS) $(CLEANFILES)
 121 
 122 lint :          lint_SRCS
 123 
 124 strip:
 125                 $(STRIP) $(PROG)
 126 
 127 include         ../Makefile.targ


  11 # See the License for the specific language governing permissions
  12 # and limitations under the License.
  13 #
  14 # When distributing Covered Code, include this CDDL HEADER in each
  15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16 # If applicable, add the following below this CDDL HEADER, with the
  17 # fields enclosed by brackets "[]" replaced with your own identifying
  18 # information: Portions Copyright [yyyy] [name of copyright owner]
  19 #
  20 # CDDL HEADER END
  21 #
  22 #
  23 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 #
  26 # Copyright 2020 Joyent, Inc.
  27 
  28 include         ../Makefile.cmd
  29 
  30 PROG =          oawk

  31 
  32 SRCS =          b.c lib.c main.c parse.c run.c tran.c
  33 
  34 #TXTS =         README EXPLAIN
  35 
  36 OBJS =          awk.g.o awk.lx.o proctab.o tmptoken.o           \
  37                 $(SRCS:%.c=%.o)
  38 
  39 #
  40 # for message catalogue
  41 #
  42 POFILES=        $(OBJS:%.o=%.po)
  43 POFILE=         oawk.po
  44 XGETFLAGS +=    -a -x oawk.xcl
  45 
  46 NATIVEDIR =     native
  47 MAKEPRCTAB =    $(NATIVEDIR)/makeprctab
  48 
  49 NATIVEOBJS =    $(NATIVEDIR)/makeprctab.o $(NATIVEDIR)/tmptoken.o
  50 $(MAKEPRCTAB) :=        CC = $(NATIVECC)
  51 $(MAKEPRCTAB) :=        POST_PROCESS=
  52 $(MAKEPRCTAB) :=        POST_PROCESS_O=
  53 $(MAKEPRCTAB) :=        NATIVE_LIBS += libm.so libc.so
  54 
  55 CLEANFILES =    proctab.c y.tab.h y.tab.c awk.h awk.g.c         \
  56                 tmptoken.c awk.lx.c $(NATIVEOBJS) $(MAKEPRCTAB) \
  57                 temp
  58 
  59 YFLAGS =        -d
  60 LDLIBS += -lm
  61 CPPFLAGS =      -I. $(CPPFLAGS.master)
  62 CPPFLAGS +=     -D_FILE_OFFSET_BITS=64
  63 


  64 CERRWARN +=     -_gcc=-Wno-implicit-function-declaration
  65 CERRWARN +=     -_gcc=-Wno-unused-label
  66 CERRWARN +=     -_gcc=-Wno-unused-variable
  67 CERRWARN +=     -_gcc=-Wno-extra
  68 CERRWARN +=     -_gcc=-Wno-parentheses
  69 
  70 # missing type declarations
  71 SMATCH =        off
  72 
  73 .KEEP_STATE :
  74 
  75 all :           $(PROG) $(TXTS)
  76 
  77 $(PROG) :       $(OBJS)
  78                 $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
  79                 $(POST_PROCESS)
  80 
  81 $(POFILE):      $(POFILES)
  82                 $(RM)   $@
  83                 $(CAT)  $(POFILES) > $@


  85 awk.g.c + awk.h :       awk.g.y
  86                 $(RM) awk.g.c awk.h
  87                 $(YACC.y) awk.g.y
  88                 $(MV) y.tab.c awk.g.c
  89                 $(MV) y.tab.h awk.h
  90 
  91 awk.lx.c:       awk.lx.l
  92                 $(LEX.l) -w awk.lx.l > awk.lx.c
  93 
  94 tmptoken.c :    tokenscript token.c
  95                 $(RM) $@
  96                 ed - < tokenscript
  97 
  98 proctab.c :     $(MAKEPRCTAB)
  99                 $(RM) $@
 100                 $(MAKEPRCTAB) > $@
 101 
 102 $(MAKEPRCTAB) : $(NATIVEDIR) $(NATIVEOBJS)
 103                 $(LINK.c) $(NATIVEOBJS) -o $@ $(XLDLIBS5CC)
 104 
 105 install :       all $(ROOTPROG)
 106 
 107 $(NATIVEDIR) :
 108                 -@mkdir -p $(NATIVEDIR)
 109 
 110 $(NATIVEDIR)/%.o :      %.c
 111                 $(COMPILE.c) -o $@ $<
 112 



 113 clean:
 114                 $(RM) $(OBJS) $(CLEANFILES)
 115 
 116 lint :          lint_SRCS
 117 
 118 strip:
 119                 $(STRIP) $(PROG)
 120 
 121 include         ../Makefile.targ