Hi,

while looking at what is needed to switch the xenocara build system to
the same kind of scheme as base (no more SUDO, start as root and drop
privs to $BUILDUSER), I figured out that the global 'includes' step
done at the begin of 'make build' is causing more trouble than it's
solving...

So as a 1st step, here's a diff to run 'make includes' when needed as
part of the individual directories 'build'.

ok ?

Index: Makefile
===================================================================
RCS file: /cvs/OpenBSD/xenocara/Makefile,v
retrieving revision 1.73
diff -u -p -u -r1.73 Makefile
--- Makefile    2 Oct 2016 09:25:23 -0000       1.73
+++ Makefile    8 Oct 2016 19:23:31 -0000
@@ -43,7 +43,6 @@ bootstrap-root:
 
 beforeinstall beforebuild:
        cd util/macros && exec ${MAKE} -f Makefile.bsd-wrapper install
-       exec ${MAKE} includes
 
 afterinstall afterbuild:
        exec ${MAKE} fix-appd
Index: app/fvwm/Makefile
===================================================================
RCS file: /cvs/OpenBSD/xenocara/app/fvwm/Makefile,v
retrieving revision 1.3
diff -u -p -u -r1.3 Makefile
--- app/fvwm/Makefile   19 Jul 2015 10:43:08 -0000      1.3
+++ app/fvwm/Makefile   8 Oct 2016 19:23:31 -0000
@@ -2,8 +2,6 @@
 
 SUBDIR= libs fvwm sample.fvwmrc utils icons modules
 
-includes:
-
 update:
 
 .include <bsd.subdir.mk>
Index: lib/freetype/Makefile
===================================================================
RCS file: /cvs/OpenBSD/xenocara/lib/freetype/Makefile,v
retrieving revision 1.44
diff -u -p -u -r1.44 Makefile
--- lib/freetype/Makefile       9 Aug 2016 07:16:08 -0000       1.44
+++ lib/freetype/Makefile       9 Oct 2016 12:02:53 -0000
@@ -29,7 +29,10 @@ CLEANFILES+= freetype-config freetype2.p
 
 obj:   _xenocara_obj
 
-beforedepend:  freetype-config freetype2.pc includes-root
+beforedepend:  freetype-config freetype2.pc
+
+beforeinstall:
+       cd ${.CURDIR} ; exec ${MAKE} ${MAKE_FLAGS} includes
 
 includes: _SUBDIRUSE
        @cmp -s ${DESTDIR}${X11BASE}/include/freetype2/ft2build.h \
@@ -40,9 +43,6 @@ includes: _SUBDIRUSE
          ${.CURDIR}/builds/unix/ftconfig.h || \
        ${INSTALL_DATA} ${.CURDIR}/builds/unix/ftconfig.h \
          ${DESTDIR}${X11BASE}/include/freetype2/freetype/config/ftconfig.h
-
-includes-root:
-       cd ${.CURDIR} && exec ${SUDO} ${MAKE} includes
 
 install-pc: freetype2.pc
        ${INSTALL_DATA} freetype2.pc ${DESTDIR}${LIBDIR}/pkgconfig
Index: lib/libepoxy/Makefile
===================================================================
RCS file: /cvs/OpenBSD/xenocara/lib/libepoxy/Makefile,v
retrieving revision 1.5
diff -u -p -u -r1.5 Makefile
--- lib/libepoxy/Makefile       8 Oct 2016 19:09:34 -0000       1.5
+++ lib/libepoxy/Makefile       8 Oct 2016 19:29:26 -0000
@@ -50,6 +50,8 @@ includes: _SUBDIRUSE
                eval "$$j"; \
        done
 
+beforeinstall: includes 
+
 NOPROFILE=
 
 PKGCONFIG=             epoxy.pc
Index: share/mk/bsd.xorg.mk
===================================================================
RCS file: /cvs/OpenBSD/xenocara/share/mk/bsd.xorg.mk,v
retrieving revision 1.53
diff -u -p -u -r1.53 bsd.xorg.mk
--- share/mk/bsd.xorg.mk        28 Mar 2016 11:59:06 -0000      1.53
+++ share/mk/bsd.xorg.mk        8 Oct 2016 19:23:31 -0000
@@ -129,10 +129,6 @@ realinstall: install-headers-subdirs
 .MAIN: all
 .endif
 
-.if !target(includes)
-includes: _SUBDIRUSE
-.endif
-
 .if defined(SHARED_LIBS)
 _lt_libs=
 .for _n _v in ${SHARED_LIBS}
@@ -211,6 +207,10 @@ build:
        @exit 2
 .else
 build:
+.if target(includes)
+       cd ${.CURDIR} && \
+               exec ${SUDO} ${MAKE} ${MAKE_FLAGS} ${_wrapper} includes
+.endif
        cd ${.CURDIR} && exec ${MAKE} ${MAKE_FLAGS} ${_wrapper} cleandir
        cd ${.CURDIR} && exec ${MAKE} ${MAKE_FLAGS} ${_wrapper} depend
        cd ${.CURDIR} && exec ${MAKE} ${MAKE_FLAGS} ${_wrapper} all

-- 
Matthieu Herrb

Attachment: signature.asc
Description: PGP signature

Reply via email to