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, Version 1.0 only
   6 # (the "License").  You may not use this file except in compliance
   7 # with the License.
   8 #
   9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10 # or http://www.opensolaris.org/os/licensing.
  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 2004 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 #
  26 
  27 HASHPROG=       hashmk1 spellin1
  28 SHPROG=         spell compress
  29 HASHTAB=        hlista hlistb hstop
  30 BINPROG=        spellprog spellin hashmake hashcheck
  31 PROG=           $(SHPROG) $(BINPROG) $(HASHPROG) $(HASHTAB) spellhist
  32 
  33 SPELLPROGSRC=   spellprog.c hash.c hashlook.c huff.c
  34 SPELLPROGOBJ=   $(SPELLPROGSRC:%.c=%.o)
  35 
  36 SPELLINSRC=     spellin.c huff.c
  37 SPELLINOBJ=     $(SPELLINSRC:%.c=%.o)
  38 
  39 HASHCHECKSRC=   hashcheck.c hash.c huff.c
  40 HASHCHECKOBJ=   $(HASHCHECKSRC:%.c=%.o)
  41 
  42 HASHMAKESRC=    hashmake.c hash.c
  43 HASHMAKEOBJ=    $(HASHMAKESRC:%.c=%.o)
  44 
  45 SRCS= $(SPELLPROGSRC) spellin.c hashcheck.c hashmake.c
  46 OBJS= $(SRCS:%.c=%.o)
  47 
  48 WORDS=  american british local list extra stop
  49 TXTS=   compress.sh spell.sh
  50 
  51 include ../Makefile.cmd
  52 
  53 CFLAGS += $(CCVERBOSE)
  54 CERRWARN += -_gcc=-Wno-parentheses
  55 
  56 XGETFLAGS += -a -x spell.xcl
  57 
  58 CLOBBERFILES += htemp1 htemp2
  59 
  60 ROOTSPELLD = $(ROOTLIB)/spell
  61 ROOTVARADMD = $(ROOT)/var/adm
  62 ROOTDIRS= $(ROOTSPELLD)
  63 
  64 BINF= spell
  65 SPELLF= spellprog hashmake hashcheck spellin hstop hlistb hlista compress
  66 VARADMF= spellhist
  67 
  68 ROOTBINF = $(BINF:%=$(ROOTBIN)/%)
  69 ROOTSPELLF = $(SPELLF:%=$(ROOTSPELLD)/%)
  70 ROOTVARADMF = $(VARADMF:%=$(ROOTVARADMD)/%)
  71 
  72 HASHFILEMODE = 0644
  73 $(ROOTSPELLD)/hstop $(ROOTSPELLD)/hlistb \
  74 $(ROOTSPELLD)/hlista := FILEMODE =      0644
  75 $(ROOTVARADMF) :=       FILEMODE =      0666
  76 
  77 spellin1 hashmk1 := CC = $(NATIVECC)
  78 spellin1 hashmk1 := POST_PROCESS =
  79 spellin1 hashmk1 := CPPFLAGS =
  80 spellin1 hashmk1 := LDFLAGS =
  81 
  82 $(ROOTSPELLD)/% $(ROOTVARADMD)/% : %
  83         $(INS.file)
  84 
  85 .KEEP_STATE:
  86 
  87 all:    $(PROG) $(TXTS)
  88 
  89 spellprog:              $(SPELLPROGOBJ)
  90                         $(LINK.c) $(SPELLPROGOBJ) -o $@ $(LDLIBS)
  91                         $(POST_PROCESS)
  92 
  93 spellin spellin1:       $(SPELLINOBJ)
  94                         $(LINK.c) $(SPELLINOBJ) -o $@ $(LDLIBS)
  95                         $(POST_PROCESS)
  96 
  97 spellhist:
  98                         $(ECHO) '\c' > spellhist
  99 
 100 hashcheck:              $(HASHCHECKOBJ)
 101                         $(LINK.c) $(HASHCHECKOBJ) -o $@ $(LDLIBS)
 102                         $(POST_PROCESS)
 103 
 104 hashmake hashmk1:       $(HASHMAKEOBJ)
 105                         $(LINK.c) $(HASHMAKEOBJ) -o $@ $(LDLIBS)
 106                         $(POST_PROCESS)
 107 
 108 htemp1: list local extra hashmk1
 109         $(RM) $@; cat list local extra | $(_SH_) ./hashmk1 > $@
 110 
 111 hlista: american $(HASHPROG) htemp1
 112         $(RM) htemp2; ./hashmk1 <american |sort -u - htemp1 >htemp2
 113         $(RM) $@; ./spellin1 `wc htemp2|sed -n 's/\([^ ]\) .*/\1/p'`<htemp2 >$@
 114         $(RM) htemp2
 115 
 116 hlistb: british $(HASHPROG) htemp1
 117         $(RM) htemp2; ./hashmk1 <british |sort -u - htemp1 >htemp2
 118         $(RM) $@; ./spellin1 `wc htemp2|sed -n 's/\([^ ]\) .*/\1/p'`<htemp2 >$@
 119         $(RM) htemp2
 120 
 121 hstop:  stop $(HASHPROG)
 122         $(RM) htemp2; ./hashmk1 <stop | sort -u >htemp2
 123         $(RM) $@; ./spellin1 `wc htemp2|sed -n 's/\([^ ]\) .*/\1/p'`<htemp2 >$@
 124         $(RM) htemp2
 125 
 126 install: all $(ROOTDIRS) $(ROOTBINF) $(ROOTSPELLF) $(ROOTVARADMF)
 127 
 128 $(ROOTDIRS):
 129         $(INS.dir)
 130 
 131 lint:   lint_SRCS
 132 
 133 clean:
 134         $(RM) $(OBJS)
 135 
 136 include ../Makefile.targ