1# @(#)Makefile 8.4 (Berkeley) 5/5/95 2# $FreeBSD: head/bin/sh/Makefile 235927 2012-05-24 19:48:15Z marcel $ 3 4PROG= sh 5INSTALLFLAGS= -S 6SHSRCS= alias.c arith_yacc.c arith_yylex.c cd.c echo.c error.c eval.c \ 7 exec.c expand.c \ 8 histedit.c input.c jobs.c kill.c mail.c main.c memalloc.c miscbltin.c \ 9 mystring.c options.c output.c parser.c printf.c redir.c show.c \ 10 test.c trap.c var.c 11GENSRCS= builtins.c nodes.c syntax.c 12GENHDRS= builtins.h nodes.h syntax.h token.h 13SRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS} 14 15WARNS?= 3 16NO_WERROR= yes # [-Werror=clobbered] on gcc50 17 18# MLINKS for Shell built in commands for which there are no userland 19# utilities of the same name are handled with the associated manpage, 20# builtin.1 in share/man/man1/. 21 22DPADD= ${LIBEDIT} ${LIBTERMCAP} 23LDADD= -ledit -ltermcap 24 25CFLAGS+=-DSHELL -I. -I${.CURDIR} 26# for debug: 27# DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline 28 29.if defined(BOOTSTRAPPING) 30CFLAGS+= -DNO_HISTORY 31.endif 32 33.PATH: ${.CURDIR}/bltin \ 34 ${.CURDIR}/../kill \ 35 ${.CURDIR}/../test \ 36 ${.CURDIR}/../../usr.bin/printf 37 38CLEANFILES+= mknodes.nx mknodes.no \ 39 mksyntax.nx mksyntax.no 40CLEANFILES+= ${GENSRCS} ${GENHDRS} 41 42build-tools: mknodes.nx mksyntax.nx 43 44.ORDER: builtins.c builtins.h 45builtins.c builtins.h: mkbuiltins builtins.def 46 sh ${.CURDIR}/mkbuiltins ${.CURDIR} 47 48# XXX this is just to stop the default .c rule being used, so that the 49# intermediate object has a fixed name. 50# XXX we have a default .c rule, but no default .o rule. 51.o: 52 ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} 53mknodes.nx: mknodes.no 54mksyntax.nx: mksyntax.no 55 56.ORDER: nodes.c nodes.h 57nodes.c nodes.h: mknodes.nx nodetypes nodes.c.pat 58 ./mknodes.nx ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat 59 60.ORDER: syntax.c syntax.h 61syntax.c syntax.h: mksyntax.nx 62 ./mksyntax.nx 63 64token.h: mktokens 65 sh ${.CURDIR}/mktokens 66 67regress: sh 68 cd ${.CURDIR}/../../tools/regression/bin/sh && ${MAKE} SH=${.OBJDIR}/sh 69.include <bsd.prog.mk> 70