2001-11-02 08:21:47 +03:00
|
|
|
# $NetBSD: bsd.nls.mk,v 1.31 2001/11/02 05:21:51 tv Exp $
|
1995-04-20 09:09:34 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
.include <bsd.init.mk>
|
2000-06-08 07:51:56 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Basic targets
|
1997-05-07 00:54:31 +04:00
|
|
|
.PHONY: cleannls nlsinstall
|
2001-08-14 11:02:13 +04:00
|
|
|
cleandir: cleannls
|
2001-11-02 08:21:47 +03:00
|
|
|
realinstall: nlsinstall
|
1995-04-20 09:09:34 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Default values
|
2001-08-14 12:28:24 +04:00
|
|
|
GENCAT?= gencat
|
2001-11-02 08:21:47 +03:00
|
|
|
NLSNAME?= ${PROG:Ulib${LIB}}
|
|
|
|
|
|
|
|
NLS?=
|
|
|
|
|
|
|
|
##### Build rules
|
|
|
|
.if ${MKNLS} != "no"
|
|
|
|
|
|
|
|
NLSALL= ${NLS:.msg=.cat}
|
|
|
|
|
|
|
|
realall: ${NLSALL}
|
|
|
|
.NOPATH: ${NLSALL}
|
2001-08-14 12:28:24 +04:00
|
|
|
|
1995-04-20 09:09:34 +04:00
|
|
|
.SUFFIXES: .cat .msg
|
|
|
|
|
|
|
|
.msg.cat:
|
|
|
|
@rm -f ${.TARGET}
|
2001-08-14 12:28:24 +04:00
|
|
|
${GENCAT} ${.TARGET} ${.IMPSRC}
|
1995-04-20 09:09:34 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
.endif # ${MKNLS} != "no"
|
1995-04-20 09:09:34 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
##### Install rules
|
|
|
|
nlsinstall:: # ensure existence
|
1999-02-12 15:38:44 +03:00
|
|
|
.if ${MKNLS} != "no"
|
1995-04-20 09:09:34 +04:00
|
|
|
|
2001-11-02 08:21:47 +03:00
|
|
|
nlsinstall:: ${DESTDIR}${NLSDIR}
|
|
|
|
.PRECIOUS: ${DESTDIR}${NLSDIR}
|
|
|
|
.PHONY: ${DESTDIR}${NLSDIR}
|
2000-06-06 13:53:29 +04:00
|
|
|
|
|
|
|
${DESTDIR}${NLSDIR}:
|
|
|
|
@if [ ! -d ${.TARGET} ] || [ -h ${.TARGET} ] ; then \
|
|
|
|
echo creating ${.TARGET}; \
|
|
|
|
/bin/rm -rf ${.TARGET}; \
|
|
|
|
${INSTALL} ${INSTPRIV} -d -o ${NLSOWN} -g ${NLSGRP} -m 755 \
|
|
|
|
${.TARGET}; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
__nlsinstall: .USE
|
2000-06-07 21:28:52 +04:00
|
|
|
${INSTALL} ${INSTPRIV} -d -o ${NLSOWN} -g ${NLSGRP} ${.TARGET:H}
|
2000-06-06 13:53:29 +04:00
|
|
|
${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${NLSOWN} \
|
|
|
|
-g ${NLSGRP} -m ${NLSMODE} ${.ALLSRC} ${.TARGET}
|
|
|
|
|
2001-05-08 07:19:51 +04:00
|
|
|
.for F in ${NLSALL:O:u}
|
2001-11-02 08:21:47 +03:00
|
|
|
_F:= ${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat # installed path
|
|
|
|
|
|
|
|
${_F}: ${F} __nlsinstall # install rule
|
|
|
|
nlsinstall:: ${_F}
|
|
|
|
.PRECIOUS: ${_F} # keep if install fails
|
|
|
|
.PHONY: ${UPDATE:U${_F}} # noclobber install
|
1999-09-05 01:48:33 +04:00
|
|
|
.if !defined(BUILD) && !make(all) && !make(${F})
|
2001-11-02 08:21:47 +03:00
|
|
|
${_F}: .MADE # no build at install
|
1997-04-20 02:24:30 +04:00
|
|
|
.endif
|
|
|
|
.endfor
|
2001-11-02 08:21:47 +03:00
|
|
|
|
|
|
|
.undef _F
|
|
|
|
.endif # ${MKNLS} != "no"
|
|
|
|
|
|
|
|
##### Clean rules
|
1997-05-07 20:45:40 +04:00
|
|
|
cleannls:
|
2001-11-02 08:21:47 +03:00
|
|
|
.if !empty(NLS)
|
|
|
|
rm -f ${NLSALL}
|
1997-04-20 02:24:30 +04:00
|
|
|
.endif
|