Subject: Overriding /usr/share/mk/sys.mk in make ...
To: None <tech-ports@NetBSD.ORG>
From: Andrew Cagney <cagney@highland.com.au>
List: tech-ports
Date: 09/29/1995 13:12:36
Hello,

[Perhaphs this has been addressed in a more recent make, my make is
pretty old...]

As far as I can tell, netbsd-make doesn't allow the path/name of the
sys.mk file to be changed (except by recompiling).  Two questions
arise:

	o	should the user be allowed to do this?
		(I want to so that I can use custom *.mk files).

	o	if so how?

Below is one possible method - checking the environment for a
MAKEDEFSYSMK variable.

			Andrew

*** main.c.dist	Fri Sep 29 12:44:01 1995
--- main.c	Fri Sep 29 13:06:48 1995
***************
*** 556,563 ****
  	 * if it was (makefile != (char *) NULL), or the default Makefile and
  	 * makefile, in that order, if it wasn't.
  	 */
! 	 if (!noBuiltins && !ReadMakefile(_PATH_DEFSYSMK))
! 		Fatal("make: no system rules (%s).", _PATH_DEFSYSMK);
  
  	if (!Lst_IsEmpty(makefiles)) {
  		LstNode ln;
--- 556,568 ----
  	 * if it was (makefile != (char *) NULL), or the default Makefile and
  	 * makefile, in that order, if it wasn't.
  	 */
! 	if (!noBuiltins) {
! 		char *defsysmk = getenv("MAKEDEFSYSMK");
! 		if (defsysmk == NULL)
! 			defsysmk = _PATH_DEFSYSMK;
! 		if (!ReadMakefile(defsysmk))
! 			Fatal("make: no system rules (%s).", defsysmk);
! 	}
  
  	if (!Lst_IsEmpty(makefiles)) {
  		LstNode ln;