Home | History | Annotate | Line # | Download | only in csh
Makefile revision 1.37
      1 #	$NetBSD: Makefile,v 1.37 2013/01/25 14:20:57 christos Exp $
      2 #	@(#)Makefile	8.1 (Berkeley) 5/31/93
      3 #
      4 # C Shell with process control; VM/UNIX VAX Makefile
      5 # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
      6 #
      7 # To profile, put -DPROF in DFLAGS and -pg in COPTS, and recompile.
      8 
      9 .include <bsd.own.mk>
     10 
     11 PROG=	csh
     12 DFLAGS=-DBUILTIN -DFILEC -DNLS -DSHORT_STRINGS
     13 # - Editor history not always aligned with shell history,
     14 #   should implement internally
     15 # - Does not handle escaped prompts.
     16 # - Does not do completion
     17 .ifndef SMALLPROG
     18 DFLAGS+=-DEDIT
     19 .endif
     20 CPPFLAGS+=-I${.CURDIR} -I. ${DFLAGS}
     21 SRCS=	alloc.c char.c const.c csh.c dir.c dol.c err.c exec.c exp.c file.c \
     22 	func.c glob.c hist.c init.c lex.c misc.c parse.c printf.c proc.c \
     23 	sem.c set.c str.c time.c
     24 .PATH:	${NETBSDSRCDIR}/usr.bin/printf
     25 
     26 MLINKS=	csh.1 limit.1 csh.1 alias.1 csh.1 bg.1 csh.1 dirs.1 csh.1 fg.1 \
     27 	csh.1 foreach.1 csh.1 history.1 csh.1 jobs.1 csh.1 popd.1 \
     28 	csh.1 pushd.1 csh.1 rehash.1 csh.1 repeat.1 csh.1 suspend.1 \
     29 	csh.1 stop.1 csh.1 source.1
     30 
     31 DPSRCS+=	errnum.h const.h
     32 CLEANFILES+=	errnum.h const.h
     33 
     34 errnum.h: err.c
     35 	${_MKTARGET_CREATE}
     36 	rm -f ${.TARGET}
     37 	(\
     38 	echo '/* Do not edit this file, make creates it. */' ;\
     39 	echo '#ifndef _h_sh_errnum' ;\
     40 	echo '#define _h_sh_errnum' ;\
     41 	egrep 'ERR_' ${.ALLSRC} | egrep '^#define' ;\
     42 	echo '#endif /* _h_sh_errnum */' ;\
     43 	) > ${.TARGET}
     44 
     45 const.c: errnum.h
     46 const.h: const.c
     47 	${_MKTARGET_CREATE}
     48 	rm -f ${.TARGET}
     49 	echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
     50 	${CC} -E ${CPPFLAGS} ${.ALLSRC} | egrep 'Char STR' | \
     51 	    ${TOOL_SED} -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
     52 	    sort >> ${.TARGET}
     53 
     54 .if make(install)
     55 SUBDIR+=USD.doc
     56 .endif
     57 
     58 # XXX Only GCC 4.1 problem
     59 .if defined(HAVE_GCC) && ${HAVE_GCC} == 4 && ${MACHINE_ARCH} == "vax"
     60 COPTS.parse.c+=	-O0
     61 .endif
     62 COPTS.err.c = -Wno-format-nonliteral
     63 COPTS.printf.c = -Wno-format-nonliteral
     64 COPTS.proc.c = -Wno-format-nonliteral
     65 
     66 .if !empty(DFLAGS:M*EDIT)
     67 LDADD+=-ledit -lutil
     68 DPADD+=${LIBEDIT} ${LIBUTIL}
     69 .else
     70 LDADD+=-lutil
     71 DPADD+=${LIBUTIL}
     72 .endif
     73 
     74 .include <bsd.prog.mk>
     75 .include <bsd.subdir.mk>
     76