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 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+= mknodes.nx mknodes.no \ 38 mksyntax.nx mksyntax.no 39CLEANFILES+= ${GENSRCS} ${GENHDRS} 40 41build-tools: mknodes.nx mksyntax.nx 42 43.ORDER: builtins.c builtins.h 44builtins.c builtins.h: mkbuiltins builtins.def 45 sh ${.CURDIR}/mkbuiltins ${.CURDIR} 46 47# XXX this is just to stop the default .c rule being used, so that the 48# intermediate object has a fixed name. 49# XXX we have a default .c rule, but no default .o rule. 50.o: 51 ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} 52mknodes.nx: mknodes.no 53mksyntax.nx: mksyntax.no 54 55.ORDER: nodes.c nodes.h 56nodes.c nodes.h: mknodes.nx nodetypes nodes.c.pat 57 ./mknodes.nx ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat 58 59.ORDER: syntax.c syntax.h 60syntax.c syntax.h: mksyntax.nx 61 ./mksyntax.nx 62 63token.h: mktokens 64 sh ${.CURDIR}/mktokens 65 66regress: sh 67 cd ${.CURDIR}/../../tools/regression/bin/sh && ${MAKE} SH=${.OBJDIR}/sh 68.include <bsd.prog.mk> 69