11.43Smrg#	$NetBSD: Makefile,v 1.43 2025/09/18 03:35:59 mrg Exp $
21.9Scgd#	@(#)Makefile	8.1 (Berkeley) 5/31/93
31.6Smycroft#
41.1Scgd# C Shell with process control; VM/UNIX VAX Makefile
51.1Scgd# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
61.1Scgd#
71.19Slukem# To profile, put -DPROF in DFLAGS and -pg in COPTS, and recompile.
81.1Scgd
91.20Slukem.include <bsd.own.mk>
101.39SchristosWARNS=6
111.20Slukem
121.1ScgdPROG=	csh
131.6SmycroftDFLAGS=-DBUILTIN -DFILEC -DNLS -DSHORT_STRINGS
141.36Schristos# - Editor history not always aligned with shell history,
151.36Schristos#   should implement internally
161.34Schristos# - Does not handle escaped prompts.
171.34Schristos# - Does not do completion
181.37Schristos.ifndef SMALLPROG
191.36SchristosDFLAGS+=-DEDIT
201.37Schristos.endif
211.15SchristosCPPFLAGS+=-I${.CURDIR} -I. ${DFLAGS}
221.1ScgdSRCS=	alloc.c char.c const.c csh.c dir.c dol.c err.c exec.c exp.c file.c \
231.6Smycroft	func.c glob.c hist.c init.c lex.c misc.c parse.c printf.c proc.c \
241.33Schristos	sem.c set.c str.c time.c
251.20Slukem.PATH:	${NETBSDSRCDIR}/usr.bin/printf
261.1Scgd
271.1ScgdMLINKS=	csh.1 limit.1 csh.1 alias.1 csh.1 bg.1 csh.1 dirs.1 csh.1 fg.1 \
281.1Scgd	csh.1 foreach.1 csh.1 history.1 csh.1 jobs.1 csh.1 popd.1 \
291.1Scgd	csh.1 pushd.1 csh.1 rehash.1 csh.1 repeat.1 csh.1 suspend.1 \
301.1Scgd	csh.1 stop.1 csh.1 source.1
311.1Scgd
321.23SlukemDPSRCS+=	errnum.h const.h
331.23SlukemCLEANFILES+=	errnum.h const.h
341.1Scgd
351.13Schristoserrnum.h: err.c
361.26Slukem	${_MKTARGET_CREATE}
371.24Slukem	rm -f ${.TARGET}
381.24Slukem	(\
391.24Slukem	echo '/* Do not edit this file, make creates it. */' ;\
401.24Slukem	echo '#ifndef _h_sh_errnum' ;\
411.24Slukem	echo '#define _h_sh_errnum' ;\
421.24Slukem	egrep 'ERR_' ${.ALLSRC} | egrep '^#define' ;\
431.24Slukem	echo '#endif /* _h_sh_errnum */' ;\
441.24Slukem	) > ${.TARGET}
451.1Scgd
461.24Slukemconst.c: errnum.h
471.1Scgdconst.h: const.c
481.26Slukem	${_MKTARGET_CREATE}
491.24Slukem	rm -f ${.TARGET}
501.24Slukem	echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
511.15Schristos	${CC} -E ${CPPFLAGS} ${.ALLSRC} | egrep 'Char STR' | \
521.29Sapb	    ${TOOL_SED} -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
531.13Schristos	    sort >> ${.TARGET}
541.1Scgd
551.42SchristosSUBDIR.roff+=USD.doc
561.1Scgd
571.32SjoergCOPTS.err.c = -Wno-format-nonliteral
581.31SchristosCOPTS.printf.c = -Wno-format-nonliteral
591.31SchristosCOPTS.proc.c = -Wno-format-nonliteral
601.43SmrgCOPTS.glob.c = ${CC_WNO_DANGLING_POINTER}
611.33Schristos
621.36Schristos.if !empty(DFLAGS:M*EDIT)
631.38SheLDADD+=-ledit -lterminfo -lutil
641.35SchristosDPADD+=${LIBEDIT} ${LIBUTIL}
651.35Schristos.else
661.33SchristosLDADD+=-lutil
671.33SchristosDPADD+=${LIBUTIL}
681.34Schristos.endif
691.27Smrg
701.1Scgd.include <bsd.prog.mk>
711.16Smycroft.include <bsd.subdir.mk>
72