summaryrefslogtreecommitdiff
path: root/usr/src/cmd/spell/Makefile
blob: e0af91a7f0daa8779462c731e7774473d85f8d6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License").  You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#

HASHPROG=	hashmk1 spellin1
SHPROG=		spell compress
HASHTAB=	hlista hlistb hstop
BINPROG=	spellprog spellin hashmake hashcheck
PROG=		$(SHPROG) $(BINPROG) $(HASHPROG) $(HASHTAB) spellhist

SPELLPROGSRC=	spellprog.c hash.c hashlook.c huff.c
SPELLPROGOBJ=	$(SPELLPROGSRC:%.c=%.o)

SPELLINSRC=	spellin.c huff.c
SPELLINOBJ=	$(SPELLINSRC:%.c=%.o)

HASHCHECKSRC=	hashcheck.c hash.c huff.c
HASHCHECKOBJ=	$(HASHCHECKSRC:%.c=%.o)

HASHMAKESRC=	hashmake.c hash.c
HASHMAKEOBJ=	$(HASHMAKESRC:%.c=%.o)

SRCS= $(SPELLPROGSRC) spellin.c hashcheck.c hashmake.c
OBJS= $(SRCS:%.c=%.o)

WORDS=	american british local list extra stop
TXTS=	compress.sh spell.sh

include ../Makefile.cmd

CFLAGS += $(CCVERBOSE)
CERRWARN += -_gcc=-Wno-parentheses

XGETFLAGS += -a -x spell.xcl

CLOBBERFILES += htemp1 htemp2

ROOTSPELLD = $(ROOTLIB)/spell
ROOTVARADMD = $(ROOT)/var/adm
ROOTDIRS= $(ROOTSPELLD)

BINF= spell
SPELLF= spellprog hashmake hashcheck spellin hstop hlistb hlista compress
VARADMF= spellhist

ROOTBINF = $(BINF:%=$(ROOTBIN)/%)
ROOTSPELLF = $(SPELLF:%=$(ROOTSPELLD)/%)
ROOTVARADMF = $(VARADMF:%=$(ROOTVARADMD)/%)

HASHFILEMODE = 0644
$(ROOTSPELLD)/hstop $(ROOTSPELLD)/hlistb \
$(ROOTSPELLD)/hlista :=	FILEMODE =	0644
$(ROOTVARADMF) :=	FILEMODE =	0666

spellin1 hashmk1 := CC = $(NATIVECC)
spellin1 hashmk1 := LD = $(NATIVELD)
spellin1 hashmk1 := CFLAGS = $(NATIVE_CFLAGS)
spellin1 hashmk1 := POST_PROCESS =
spellin1 hashmk1 := CPPFLAGS =
spellin1 hashmk1 := LDLIBS =
spellin1 hashmk1 := LDFLAGS = $(BDIRECT)
spellin1 hashmk1 := NATIVE_LIBS = libc.so

$(ROOTSPELLD)/% $(ROOTVARADMD)/% : %
	$(INS.file)

.KEEP_STATE:

all:	$(PROG) $(TXTS)

spellprog:		$(SPELLPROGOBJ)
			$(LINK.c) $(SPELLPROGOBJ) -o $@ $(LDLIBS)
			$(POST_PROCESS)

spellin spellin1:	$(SPELLINOBJ)
			$(LINK.c) $(SPELLINOBJ) -o $@ $(LDLIBS)
			$(POST_PROCESS)

spellhist:
			$(ECHO) '\c' > spellhist

hashcheck:		$(HASHCHECKOBJ)
			$(LINK.c) $(HASHCHECKOBJ) -o $@ $(LDLIBS)
			$(POST_PROCESS)

hashmake hashmk1:	$(HASHMAKEOBJ)
			$(LINK.c) $(HASHMAKEOBJ) -o $@ $(LDLIBS)
			$(POST_PROCESS)

htemp1:	list local extra hashmk1
	$(RM) $@; cat list local extra | $(_SH_) ./hashmk1 > $@

hlista: american $(HASHPROG) htemp1
	$(RM) htemp2a; ./hashmk1 <american |sort -u - htemp1 >htemp2a
	$(RM) $@; ./spellin1 `wc htemp2a|sed -n 's/\([^ ]\) .*/\1/p'`<htemp2a >$@
	$(RM) htemp2a

hlistb: british $(HASHPROG) htemp1
	$(RM) htemp2b; ./hashmk1 <british |sort -u - htemp1 >htemp2b
	$(RM) $@; ./spellin1 `wc htemp2b|sed -n 's/\([^ ]\) .*/\1/p'`<htemp2b >$@
	$(RM) htemp2b

hstop:	stop $(HASHPROG)
	$(RM) htemp2s; ./hashmk1 <stop | sort -u >htemp2s
	$(RM) $@; ./spellin1 `wc htemp2s|sed -n 's/\([^ ]\) .*/\1/p'`<htemp2s >$@
	$(RM) htemp2s

install: all $(ROOTDIRS) $(ROOTBINF) $(ROOTSPELLF) $(ROOTVARADMF)

$(ROOTDIRS):
	$(INS.dir)

lint:	lint_SRCS

clean:
	$(RM) $(OBJS)

include ../Makefile.targ