[Midnightbsd-cvs] mports: bsd.mport.mk: Add run-configure and run-build targets.

ctriv at midnightbsd.org ctriv at midnightbsd.org
Sat Nov 10 13:29:15 EST 2007


Log Message:
-----------
Add run-configure and run-build targets.  These targets are run by
do-configured and do-build respectfully (the do-targets are thin wrappers).
This allows you to override do-build, do something, and the then run the
normal build process without having to reproduce it in your port makefile.

Broke the fake process out of the monolithic fake-install target into
several smaller targets.  This allows the port maintainer to override the
do-fake target if needed.

These changes are protential unstable.  I believe there to be no
regressions, but until a run magus run can be done, be wary.

Modified Files:
--------------
    mports/Mk:
        bsd.mport.mk (r1.72 -> r1.73)

-------------- next part --------------
Index: bsd.mport.mk
===================================================================
RCS file: /home/cvs/mports/Mk/bsd.mport.mk,v
retrieving revision 1.72
retrieving revision 1.73
diff -L Mk/bsd.mport.mk -L Mk/bsd.mport.mk -u -r1.72 -r1.73
--- Mk/bsd.mport.mk
+++ Mk/bsd.mport.mk
@@ -1559,7 +1559,7 @@
 FAKE_SETUP+=	PATH=${PATH}:${FAKE_DESTDIR}${PREFIX}/bin:${FAKE_DESTDIR}${PREFIX}/sbin
 .endif
 .if ${FAKE_OPTS:Mprefixhack}x != "x"
-FAKE_MAKEARGS+=	prefix=${FAKE_DESTDIR}${PREFIX} infodir=${FAKE_DESTDIR}${PREFIX}/${INFO_PATH}
+FAKE_MAKEARGS+=	prefix=${FAKE_DESTDIR}${TRUE_PREFIX} infodir=${FAKE_DESTDIR}${TRUE_PREFIX}/${INFO_PATH}
 FAKE_MAKEARGS+=	mandir=${FAKE_DESTDIR}${MANPREFIX}/man MANDIR=${FAKE_DESTDIR}${MANPREFIX}/man
 .endif
 .endif
@@ -3531,7 +3531,10 @@
 # Configure
 
 .if !target(do-configure)
-do-configure:
+do-configure: run-configure
+.endif
+
+run-configure:
 	@if [ -f ${SCRIPTDIR}/configure ]; then \
 		cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
 		  ${SCRIPTDIR}/configure; \
@@ -3563,18 +3566,24 @@
 .if defined(USE_IMAKE)
 	@(cd ${CONFIGURE_WRKSRC}; ${SETENV} ${MAKE_ENV} ${XMKMF})
 .endif
-.endif
 
+#
 # Build
+#
 
 .if !target(do-build)
-do-build:
+do-build: run-build
+.endif
+
+run-build:
 .if defined(USE_GMAKE)
 	@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
 .else
 	@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
 .endif
-.endif
+
+
+
 
 
 # 
@@ -3599,35 +3608,50 @@
 .endif
 
 
-.if !target(fake-install)
-fake-install:
-.	if target(pre-install)
+.if !target(fake-pre-install) 
+fake-pre-install:
+.   if target(pre-install)
 		@cd ${.CURDIR} && exec ${MAKE} pre-install ${FAKE_SETUP}
-.	endif
-# 	This is where the old FreeBSD bsd.port.mk made the tmpplist, we'll do it
-# 	here as well so that everyone is happy.
-	@cd ${.CURDIR} && exec ${MAKE} generate-plist
-.	if target(pre-su-install)
+.   endif
+.endif
+
+	
+.if !target(fake-pre-su-install)
+fake-pre-su-install:
+.   if target(pre-su-install)
 		@${ECHO_MSG} "===>   WARNING: pre-su-install is deprecated. Use pre-install instead."
 		@cd ${.CURDIR} && exec ${MAKE} pre-su-install ${FAKE_SETUP}
-.	endif
+.   endif
+.endif
+
+
+.if !target(do-fake) 
+do-fake:
 .	if target(do-install)
 		@cd ${.CURDIR} && exec ${MAKE} do-install ${FAKE_SETUP}
 .	else
-#	Normal builds.
-		@cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${FAKE_SETUP}\
-			${_MAKE_CMD} -f ${MAKEFILE} ${FAKE_MAKEARGS} ${FAKE_TARGET};
-.		if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES)
-			@cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${FAKE_SETUP}\
-				${_MAKE_CMD} -f ${MAKEFILE} ${FAKE_MAKEARGS} install.man
-.		endif
+		@cd ${.CURDIR} && exec ${MAKE} run-fake
 .	endif
+.endif
+
+
+.if !target(fake-post-install)
+fake-post-install:
 .	if target(post-install)
 		@cd ${.CURDIR} && exec ${MAKE} post-install ${FAKE_SETUP}
 .	endif
 .endif
 
 
+run-fake:
+	@cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${FAKE_SETUP}\
+		${_MAKE_CMD} -f ${MAKEFILE} ${FAKE_MAKEARGS} ${FAKE_TARGET};
+.	if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES)
+		@cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${FAKE_SETUP}\
+			${_MAKE_CMD} -f ${MAKEFILE} ${FAKE_MAKEARGS} install.man
+.	endif
+
+
 .if !target(fix-fake-symlinks) 
 fix-fake-symlinks:
 	- at cd ${FAKE_DESTDIR}${PREFIX}; \
@@ -4003,7 +4027,8 @@
 				post-build post-build-script
 
 _FAKE_DEP=		build
-_FAKE_SEQ=		fake-message fake-dir apply-slist pre-fake fake-install \
+_FAKE_SEQ=		fake-message fake-dir apply-slist pre-fake fake-pre-install \
+				generate-plist fake-pre-su-install do-fake fake-post-install \
 				post-fake compress-man install-rc-script install-ldconfig-file \
 				fix-fake-symlinks finish-tmpplist
 


More information about the Midnightbsd-cvs mailing list