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