# Generated automatically from Makefile.in by configure.
# $Id: Makefile.in,v 3.10 1998/10/02 10:56:45 christos Exp $
#	Makefile.in	4.3	6/11/83
#
# C Shell with process control; VM/UNIX VAX Makefile
# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
#
# With an input editor, command completion, etc. and ported to all sorts of
# things; Paul Placeway, CIS Dept., Ohio State University
#
#
#ident	"@(#)Makefile	1.3	99/10/31 SMI"

VERSION=6.09
PROG=tcsh
srcdir=.

MAN1FILES=	tcsh.1

include ../Makefile.cmd

################################################################
## CFLAGS.  For various -D things, see config.h
################################################################
#
# These are the default suffixes from .c to .o and -c to get there
# but to use the global optimizer on the mips boxes, see below
#
SUF=o
CF=-c
CPP= /usr/lib/cpp

INCLUDES=-I. -I$(srcdir)

CFLAGS += $(INCLUDES) -D_PATH_TCSHELL='"/usr/bin/tcsh"'

LDLIBS += -lsocket -lnsl -ltermlib


ASSRCS=	sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
	sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
	sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
	sh.set.c sh.time.c sh.char.h sh.dir.h sh.proc.h sh.h \
	tw.color.c
PSSRCS= sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h ma.setp.c \
	vms.termcap.c
SHSRCS= ${ASSRCS} ${PSSRCS}
SHOBJS=	sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \
	sh.char.${SUF} sh.exp.${SUF} sh.func.${SUF} sh.glob.${SUF} \
	sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} sh.misc.${SUF} \
	sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} sh.sem.${SUF} \
	sh.set.${SUF} sh.time.${SUF} glob.${SUF} mi.termios.${SUF} \
	ma.setp.${SUF} vms.termcap.${SUF}

TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
	tw.comp.c tw.color.c
TWOBJS=	tw.help.${SUF} tw.init.${SUF} tw.parse.${SUF} tw.spell.${SUF} \
	tw.comp.${SUF} tw.color.${SUF}

EDSRCS= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
	ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
EDOBJS=	ed.chared.${SUF} ed.refresh.${SUF} ed.screen.${SUF} ed.init.${SUF} \
	ed.inputl.${SUF} ed.defns.${SUF} ed.xmap.${SUF} ed.term.${SUF}

TCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
	tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
	tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
	tc.who.c tc.h
TCOBJS=	tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.defs.${SUF} \
	tc.disc.${SUF} tc.func.${SUF} tc.os.${SUF} tc.printf.${SUF} \
	tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \
	tc.vers.${SUF} tc.who.${SUF} 

PVSRCS= Makefile.std Makefile.vms Makefile.in Makefile.win32
AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \
	WishList config_f.h eight-bit.me glob.3 patchlevel.h \
	pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
	README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \
	host.defs gethost.c tcsh.man2html configure.in configure config.h.in

VHSRCS=${PVSRCS} ${AVSRCS}

CONFSRCS=config/* 

ALLSRCS=  ${SHSRCS} ${TWSRCS} ${EDSRCS} ${TCSRCS} ${VHSRCS}
DISTSRCS= ${PSSRCS} ${TWSRCS} ${EDSRCS} ${TCSRCS} ${AVSRCS}


OBJS= ${SHOBJS} ${TWOBJS} ${EDOBJS} ${TCOBJS}

DISTDIRS= nls nls/C nls/french nls/german nls/greek nls/italian nls/ja \
    nls/spanish config
ROOTSRC= $(ROOT)/usr/share/src/tcsh
ROOTSRCDIRS=   $(DISTDIRS:%=$(ROOTSRC)/%)
DISTFILES:sh= cat ./distfiles
ROOTDISTFILES= $(DISTFILES:%=$(ROOTSRC)/%)
$(ROOTDISTFILES) := FILEMODE= 0444
$(ROOTSRC)/config.guess \
$(ROOTSRC)/config.sub \
$(ROOTSRC)/configure := FILEMODE= 0555

.PARALLEL: $(OBJS)

.NO_PARALLEL: $(ROOTSRCDIRS)

.KEEP_STATE:

all: $(PROG)

install: all $(ROOTPROG) install_src install_man

install_src: $(ROOTSRC) .WAIT $(ROOTSRCDIRS) .WAIT $(ROOTDISTFILES)

install_man: $(ROOTMAN1FILES)

$(ROOTSRC) $(ROOTSRCDIRS):
	$(INS.dir)

$(ROOTSRC)/%: %
	$(INS.file)

$(PROG): $(OBJS)
	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
	$(POST_PROCESS)

gethost:  gethost.c sh.err.h tc.const.h sh.h
	rm -f gethost
	${CC} -o gethost ${LDFLAGS} ${CFLAGS} ${DFLAGS} $(srcdir)/gethost.c \
		${LIBES} ${EXTRALIBS}
	$(POST_PROCESS)

tc.defs.c:	gethost host.defs
	@rm -f $@
	@echo "/* Do not edit this file, make creates it */" > $@
	./gethost $(srcdir)/host.defs >> $@

ed.defns.h: ed.defns.c
	@rm -f $@
	@echo '/* Do not edit this file, make creates it. */' > $@
	@echo '#ifndef _h_ed_defns' >> $@
	@echo '#define _h_ed_defns' >> $@
	grep '[FV]_' $(srcdir)/ed.defns.c | grep '^#define' >> $@
	@echo '#endif /* _h_ed_defns */' >> $@

sh.err.h: sh.err.c
	@rm -f $@
	@echo '/* Do not edit this file, make creates it. */' > $@
	@echo '#ifndef _h_sh_err' >> $@
	@echo '#define _h_sh_err' >> $@
	grep 'ERR_' $(srcdir)/sh.err.c | grep '^#define' >> $@
	@echo '#endif /* _h_sh_err */' >> $@

tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
	@rm -f $@
	@echo '/* Do not edit this file, make creates it. */' > $@
	@echo '#ifndef _h_tc_const' >> $@
	@echo '#define _h_tc_const' >> $@
	${CPP} $(INCLUDES) ${DFLAGS} ${EXTRAFLAGS} -D_h_tc_const\
	    $(srcdir)/tc.const.c | grep 'Char STR' | \
	    sed -e 's/Char \([a-zA-Z0-9_]*\)\[\].*/extern Char \1[];/' | \
	    sort >> $@
	@echo '#endif /* _h_tc_const */' >> $@

csh.prof: ${OBJS} sh.prof.${SUF} mcrt0.${SUF}
	rm -f csh.prof
	ld -X mcrt0.${SUF} ${OBJS} -o csh.prof ${LIBES} -lc

clean:
	${RM} -f a.out strings x.c xs.c tcsh tcsh.a _MAKE_LOG core gethost
	${RM} -f *.${SUF} sh.prof.c ed.defns.h tc.const.h sh.err.h tc.defs.c
	${RM} -f tcsh.*.m tcsh.*.cat

#
# Dependencies
#
config.h: config_f.h

TCH=tc.h tc.const.h tc.decls.h tc.os.h tc.sig.h
SHH=sh.h sh.types.h sh.char.h sh.err.h sh.dir.h sh.proc.h pathnames.h \
    sh.decls.h ${TCH}
TWH=tw.h tw.decls.h
EDH=ed.h ed.decls.h

# EDH
EDINC=sh.${SUF} sh.func.${SUF} sh.lex.${SUF} sh.print.${SUF} sh.proc.${SUF} \
      sh.set.${SUF} tc.bind.${SUF} tc.os.${SUF} tc.prompt.${SUF} \
      tc.sched.${SUF} tw.parse.${SUF} tw.color.${SUF}
${EDOBJS} ${EDINC} : ${EDH}

# SHH
${OBJS}: config.h ${SHH}

# TWH
TWINC=ed.chared.${SUF} ed.inputl.${SUF} sh.exec.${SUF} sh.func.${SUF} \
      sh.set.${SUF} tc.func.${SUF} tw.color.${SUF}
${TWOBJS} ${TWINC}: ${TWH}

# glob.h
glob.${SUF} sh.glob.${SUF}: glob.h

# ed.defns.h
EDDINC=tc.bind.${SUF} tc.func.${SUF} tc.os.${SUF}
${EDOBJS} ${EDDINC}: ed.defns.h

# tc.defs.o
tc.defs.${SUF}:	tc.defs.c sh.h

include ../Makefile.targ
