Makefile (1322B)
1 # rc - rc shell unix port from plan9 2 # Depends on ../lib9 3 4 TARG = rc 5 OFILES = code.o exec.o getflags.o glob.o here.o io.o lex.o \ 6 pcmd.o pfnc.o simple.o subr.o trap.o tree.o unixcrap.o \ 7 var.o y.tab.o plan9ish.o havefork.o 8 YFILES = syn.y 9 MANFILES = rc.1 10 11 include ../config.mk 12 13 # Solaris 14 #LDFLAGS += -dy -lxnet 15 16 all: 17 @if [ ! -f y.tab.c ]; then \ 18 make -f Makefile depend;\ 19 fi 20 @make -f Makefile ${TARG} 21 @echo built ${TARG} 22 23 depend: 24 @echo YACC ${YFILES} 25 @${YACC} -d ${YFILES} 26 @cp y.tab.h x.tab.h 27 28 install: ${TARG} 29 @mkdir -p ${DESTDIR}${PREFIX}/bin 30 @cp -f ${TARG} ${DESTDIR}${PREFIX}/bin/ 31 @chmod 755 ${DESTDIR}${PREFIX}/bin/${TARG} 32 @mkdir -p ${DESTDIR}${MANPREFIX}/man1 33 @cp -f ${MANFILES} ${DESTDIR}${MANPREFIX}/man1 34 @chmod 444 ${DESTDIR}${MANPREFIX}/man1/${MANFILES} 35 @mkdir -p ${DESTDIR}${PREFIX}/etc 36 @cp -f rcmain ${DESTDIR}${PREFIX}/etc 37 @chmod 755 ${DESTDIR}${PREFIX}/etc/rcmain 38 39 uninstall: 40 rm -f ${DESTDIR}${PREFIX}/bin/${TARG} 41 rm -f ${DESTDIR}${MANPREFIX}/man1/${MANFILES} 42 rm -f ${DESTDIR}${PREFIX}/etc/rcmain 43 44 .c.o: 45 @echo CC $*.c 46 @${CC} ${CFLAGS} -I../lib9 -I${PREFIX}/include -I../lib9 $*.c 47 48 clean: 49 rm -f ${OFILES} ${TARG} y.tab.c y.tab.h x.tab.h 50 51 ${TARG}: ${OFILES} 52 @echo LD ${TARG} 53 @${CC} ${LDFLAGS} -o ${TARG} ${OFILES} -L${PREFIX}/lib -L../lib9 -l9 -lm