This commit was manufactured by cvs2svn to create tag 'FreeBSD-release/1.0'.
[unix-history] / gnu / usr.bin / man / whatis / Makefile
index 1e9c1c1..94347e1 100644 (file)
@@ -1,26 +1,37 @@
-.include "../Makefile.inc"
+.if exists(${.CURDIR}/obj)
+MANP=  ${.CURDIR}/obj/whatis.1
+TARG=  ${.CURDIR}/obj/whatis
+.else
+MANP=  ${.CURDIR}/whatis.1
+TARG=  ${.CURDIR}/whatis
+.endif
 
 
-all:   whatis whatis.1
+all:   ${TARG} ${MANP}
 
 
-obj depend rcsfreeze all:
+depend rcsfreeze tags all:
        @echo -n
 
 cleandir: clean
        @echo -n
 
 cleandir: clean
+       cd ${.CURDIR}; rm -rf obj;
 
 clean:
 
 clean:
-       @rm -f whatis whatis.1
+       @rm -f ${TARG} ${MANP}
 
 
-whatis: whatis.sh
+${TARG}: ${.CURDIR}/whatis.sh
        sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \
            -e 's,%pager%,${pager},' \
        sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \
            -e 's,%pager%,${pager},' \
-               whatis.sh > whatis
+               ${.CURDIR}/whatis.sh > ${TARG}
 
 
-whatis.1: whatis.man
+${MANP}: ${.CURDIR}/whatis.man
        sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \
            -e 's,%pager%,${pager},' -e 's,%troff%,${troff},' \
            -e 's,%manpath_config_file%,${manpath_config_file},' \
        sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \
            -e 's,%pager%,${pager},' -e 's,%troff%,${troff},' \
            -e 's,%manpath_config_file%,${manpath_config_file},' \
-       whatis.man > whatis.1
+       ${.CURDIR}/whatis.man > ${MANP}
+
+install: ${TARG} maninstall
+       install -c -o bin -g bin -m 555 ${TARG} ${DESTDIR}/usr/bin
 
 
-install: whatis whatis.1
-       install -c -o bin -g bin -m 555 whatis /usr/bin
-       install -c -o bin -g bin -m 444 whatis.1 /usr/share/man/man1
+maninstall: ${MANP}
+       install -c -o bin -g bin -m 444 ${MANP} ${DESTDIR}/usr/share/man/man1
+
+.include "../Makefile.inc"