Re: *.patch files with subdirectories under ${CONTRIBDIR}

看板DFBSD_kernel作者時間21年前 (2004/11/22 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/5 (看更多)
On Sun, Nov 21, 2004 at 01:38:40PM +0100, Joerg Sonnenberger wrote: > On Sun, Nov 21, 2004 at 12:56:59PM +0900, YONETANI Tomokazu wrote: > > I'm not 100% sure how to fix this. To only cope with (B), the following > > patch should do the job(though I haven't gone though full buildworld yet). > > (A) is a known problem and I'm not sure if we can fix it easily. What do > you think of the atttached patch? It fixes another left-over too. > > Joerg > Index: bsd.prog.mk > =================================================================== > RCS file: /home/joerg/wd/repository/dragonflybsd/src/share/mk/bsd.prog.mk,v > retrieving revision 1.6 > diff -u -r1.6 bsd.prog.mk > --- bsd.prog.mk 26 Jul 2004 14:29:11 -0000 1.6 > +++ bsd.prog.mk 21 Nov 2004 12:35:18 -0000 > @@ -31,7 +31,7 @@ > > OBJS+= ${SRCS:N*.h:N*.patch:R:S/$/.o/g} > .for _PATCH in ${SRCS:T:N*.no_obj.patch:N*.h.patch:M*.patch} > -.for _OBJ in ${_PATCH:R:R:S/$/.o/} > +.for _OBJ in ${_PATCH:R:R:S|,|/|g:S/$/.o/} > OBJS:= ${OBJS:N${_OBJ}} ${_OBJ} > .endfor > .endfor This still creates ${.OBJDIR}/foo/foo.c and ${.OBJDIR}/foo.o and add foo/foo.o to OBJS, so linkage fails unless you can fix (A). Do you like this patch? This creates ${.OBJDIR}/foo,foo.c from ${CONTRIBDIR}/foo/foo.c and foo,foo.c.patch , and appends foo,foo.c to SRCS, which is consistent with the current bsd.{lib,hostprog,prog}.mk . It won't create directory under ${.OBJDIR} anymore, but it's not a problem, since the only instance of '*,*.patch' is in gnu/usr.bin/cc34/cc_prep, but it doesn't use bsd.dep.mk and rolls its own, so this change won't break anything yet. Index: bsd.dep.mk =================================================================== RCS file: /home/source/dragonfly/cvs/src/share/mk/bsd.dep.mk,v retrieving revision 1.7 diff -u -r1.7 bsd.dep.mk --- bsd.dep.mk 13 Nov 2004 17:31:00 -0000 1.7 +++ bsd.dep.mk 21 Nov 2004 15:05:22 -0000 @@ -68,11 +68,11 @@ CLEANFILES?= .for _PSRC in ${SRCS:M*.patch} -.for _PC in ${_PSRC:T:C/(\.no_obj)?\.patch$//:S|,|/|g} +.for _PC in ${_PSRC:T:C/(\.no_obj)?\.patch$//} -${_PC}: ${CONTRIBDIR}/${_PC} ${_PSRC} +${_PC}: ${CONTRIBDIR}/${_PC:S|,|/|g} ${_PSRC} mkdir -p ${.TARGET:H} - patch -o ${.TARGET} -i ${.ALLSRC:M*.patch} ${CONTRIBDIR}/${.TARGET} + patch -o ${.TARGET} -i ${.ALLSRC:M*.patch} ${CONTRIBDIR}/${_PC:S|,|/|g} SRCS:= ${SRCS:N${_PC}:S|${_PSRC}|${_PC}|} CLEANFILES:= ${CLEANFILES} ${_PC}
文章代碼(AID): #11eDVr00 (DFBSD_kernel)
討論串 (同標題文章)
文章代碼(AID): #11eDVr00 (DFBSD_kernel)