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