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