# $Header: Makefile.SH,v 3.0.1.8 91/01/11 18:34:40 lwall Locked $
#
# $Log:	Makefile.SH,v $
# Revision 3.0.1.8  91/01/11  18:34:40  lwall
# patch42: x2p/Makefile.SH blew up on /afs misfeature
# 
# Revision 3.0.1.7  90/11/10  02:20:15  lwall
# patch38: random cleanup
# 
# Revision 3.0.1.6  90/10/16  11:28:18  lwall
# patch29: various portability fixes
# 
# Revision 3.0.1.5  90/08/13  22:41:05  lwall
# patch28: shift/reduce count was off for a2p's Makefile
# 
# Revision 3.0.1.4  90/03/01  10:28:09  lwall
# patch9: a2p didn't allow logical expressions everywhere it should
# 
# Revision 3.0.1.3  89/12/21  20:29:00  lwall
# patch7: Configure now lets you pick between yacc or bison
# 
# Revision 3.0.1.2  89/11/17  15:49:55  lwall
# patch: in x2p/Makefile.SH, removed reference to nm library
# 
# Revision 3.0.1.1  89/10/26  23:29:11  lwall
# patch1: in x2p/Makefile.SH, added dependency on ../config.sh
# 
# Revision 3.0  89/10/18  15:33:52  lwall
# 3.0 baseline
# 
# Revision 2.0.1.2  88/09/07  17:13:30  lwall
# patch14: added redirection of stderr to /dev/null
# 
# Revision 2.0.1.1  88/07/11  23:13:39  root
# patch2: now expects more shift/reduce errors
# 
# Revision 2.0  88/06/05  00:15:31  root
# Baseline version 2.0.
# 
# 

CC = cc
YACC = yacc
bin = /usr/local
lib = 
mansrc = /usr/man/manl
manext = l
CFLAGS =  -O
LDFLAGS = 
SMALL = 
LARGE =  
mallocsrc = 
mallocobj = 

libs = -lnm -ldbm -lm

public = a2p s2p

private = 

manpages = a2p.man s2p.man

util =

sh = Makefile.SH makedepend.SH

h = EXTERN.h INTERN.h config.h handy.h hash.h a2p.h str.h util.h

c = hash.c $(mallocsrc) str.c util.c walk.c

obj = hash.o $(mallocobj) str.o util.o walk.o

lintflags = -phbvxac

addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7

# grrr
SHELL = /bin/sh

.c.o:
	$(CC) -c $(CFLAGS) $(LARGE) $*.c

all: $(public) $(private) $(util)
	touch all

a2p: $(obj) a2p.o
	$(CC) $(LARGE) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p

a2p.c: a2p.y
	@ echo Expect 226 shift/reduce conflicts...
	$(YACC) a2p.y
	mv y.tab.c a2p.c

a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h str.h hash.h
	$(CC) -c $(CFLAGS) $(LARGE) a2p.c

install: a2p s2p
# won't work with csh
	export PATH || exit 1
	- mv $(bin)/a2p $(bin)/a2p.old 2>/dev/null
	- mv $(bin)/s2p $(bin)/s2p.old 2>/dev/null
	- if test `pwd` != $(bin); then cp $(public) $(bin); fi
	cd $(bin); \
for pub in $(public); do \
chmod +x `basename $$pub`; \
done
#	chmod +x makedir
#	- ./makedir `filexp $(lib)`
#	- \
#if test `pwd` != `filexp $(lib)`; then \
#cp $(private) `filexp $(lib)`; \
#fi
#	cd `filexp $(lib)`; \
#for priv in $(private); do \
#chmod +x `basename $$priv`; \
#done
	- if test `pwd` != $(mansrc); then \
for page in $(manpages); do \
cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
done; \
fi

clean:
	rm -f a2p *.o

realclean: clean
	rm -f *.orig */*.orig core $(addedbyconf) a2p.c s2p all

# The following lint has practically everything turned on.  Unfortunately,
# you have to wade through a lot of mumbo jumbo that can't be suppressed.
# If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
# for that spot.

lint:
	lint $(lintflags) $(defs) $(c) > a2p.fuzz

depend: ../makedepend
	../makedepend

clist:
	echo $(c) | tr ' ' '\012' >.clist

hlist:
	echo $(h) | tr ' ' '\012' >.hlist

shlist:
	echo $(sh) | tr ' ' '\012' >.shlist

config.sh: ../config.sh
	rm -f config.sh
	ln ../config.sh .

# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
# If this runs make out of memory, delete /usr/include lines.
hash.o: ../config.h
hash.o: /usr/include/ctype.h
hash.o: /usr/include/stdio.h
hash.o: EXTERN.h
hash.o: a2p.h
hash.o: handy.h
hash.o: hash.c
hash.o: hash.h
hash.o: str.h
hash.o: util.h
str.o: ../config.h
str.o: /usr/include/ctype.h
str.o: /usr/include/stdio.h
str.o: EXTERN.h
str.o: a2p.h
str.o: handy.h
str.o: hash.h
str.o: str.c
str.o: str.h
str.o: util.h
util.o: ../config.h
util.o: /usr/include/ctype.h
util.o: /usr/include/stdio.h
util.o: EXTERN.h
util.o: INTERN.h
util.o: a2p.h
util.o: handy.h
util.o: hash.h
util.o: str.h
util.o: util.c
util.o: util.h
walk.o: ../config.h
walk.o: /usr/include/ctype.h
walk.o: /usr/include/stdio.h
walk.o: EXTERN.h
walk.o: a2p.h
walk.o: handy.h
walk.o: hash.h
walk.o: str.h
walk.o: util.h
walk.o: walk.c
Makefile: Makefile.SH config.sh ; /bin/sh Makefile.SH
makedepend: makedepend.SH config.sh ; /bin/sh makedepend.SH
# WARNING: Put nothing here or make depend will gobble it up!
