1 # $NetBSD: Makefile,v 1.39 2024/12/05 22:45:20 rillig Exp $ 2 3 WARNS= 3 4 CWARNFLAGS.clang+= -Wno-error=cast-qual 5 6 .include <bsd.own.mk> 7 8 CPPFLAGS+= -I. 9 LINTFLAGS+= -X 384 # function definition using identifier list 10 11 PROG= ksh 12 SRCS= alloc.c c_ksh.c c_sh.c c_test.c c_ulimit.c edit.c emacs.c \ 13 eval.c exec.c expr.c history.c io.c jobs.c lex.c mail.c \ 14 main.c misc.c path.c shf.c syn.c table.c trap.c tree.c tty.c \ 15 var.c version.c vi.c 16 DPSRCS= emacs.out siglist.out 17 .if ${MKMAN} != "no" 18 DPSRCS+=ksh.1 19 .endif 20 21 USETBL= # yes, needed for the man page. 22 23 # Environment for scripts executed during build. 24 SCRIPT_ENV= \ 25 AWK=${TOOL_AWK:Q} \ 26 SED=${TOOL_SED:Q} 27 28 CLEANFILES+= siglist.out siglist.out.tmp 29 # two steps to prevent the creation of a bogus siglist.out 30 siglist.out: config.h sh.h siglist.in siglist.sh 31 ${_MKTARGET_CREATE} 32 ${SCRIPT_ENV} \ 33 ${HOST_SH} ${.CURDIR}/siglist.sh "${CC} -E ${CPPFLAGS} ${DEFS} \ 34 -I. -I${.CURDIR}" < ${.CURDIR}/siglist.in > siglist.out.tmp \ 35 && mv siglist.out.tmp siglist.out 36 37 # two steps to prevent the creation of a bogus emacs.out 38 CLEANFILES+= emacs.out emacs.out.tmp 39 emacs.out: emacs.c 40 ${_MKTARGET_CREATE} 41 ${SCRIPT_ENV} \ 42 ${HOST_SH} ${.CURDIR}/emacs-gen.sh ${.CURDIR}/emacs.c > emacs.out.tmp \ 43 && mv emacs.out.tmp emacs.out 44 45 CLEANFILES+= ksh.1 ksh.1.tmp 46 ksh.1: ksh.Man mkman 47 ${_MKTARGET_CREATE} 48 ${SCRIPT_ENV} \ 49 ${HOST_SH} ${.CURDIR}/mkman ksh ${.CURDIR}/ksh.Man >ksh.1.tmp \ 50 && mv ksh.1.tmp ksh.1 51 52 COPTS+= ${CC_WNO_IMPLICIT_FALLTHROUGH} 53 54 .include <bsd.prog.mk> 55