From ce86ed8a7416e2c36521626447619623ddec5657 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Mon, 26 Sep 2005 19:16:18 +0000
Subject: [PATCH] Support BUILD/BUILDPATH as per *nix. BCC only currently...
 need to look into MSVC methods to handle this properly.

---
 src/build/Common.bmake | 13 +++++++++++--
 src/build/Common.gmake |  1 +
 src/sbbs3/Makefile     |  4 ++--
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/build/Common.bmake b/src/build/Common.bmake
index 418ec9e4fb..4ddadffbac 100644
--- a/src/build/Common.bmake
+++ b/src/build/Common.bmake
@@ -140,9 +140,12 @@ CFLAGS	=	$(CFLAGS) -Od -D_DEBUG
 
 # Debug or release build?
 !ifdef DEBUG
-BUILDPATH	=	debug
+BUILD	=	debug
 !else
-BUILDPATH	=	release
+BUILD	=	release
+!endif
+!ifndef BUILDPATH
+BUILDPATH	=	$(BUILD)
 !endif
 
 OBJODIR =	$(CCPRE).win32.obj.$(BUILDPATH)
@@ -194,6 +197,7 @@ xpdev:
 	set DEBUG=$(DEBUG)
 	set RELEASE=$(RELEASE)
 	set VERBOSE=$(VERBOSE)
+	set BUILDPATH=$(BUILDPATH)
 	cd $(XPDEV_SRC)
 	$(MAKE) -$(MAKEFLAGS) lib
 	exit
@@ -206,6 +210,7 @@ xpdev-mt:
 	set DEBUG=$(DEBUG)
 	set RELEASE=$(RELEASE)
 	set VERBOSE=$(VERBOSE)
+	set BUILDPATH=$(BUILDPATH)
 	cd $(XPDEV_SRC)
 	$(MAKE) -$(MAKEFLAGS) mtlib
 	exit
@@ -218,6 +223,7 @@ smblib:
 	set DEBUG=$(DEBUG)
 	set RELEASE=$(RELEASE)
 	set VERBOSE=$(VERBOSE)
+	set BUILDPATH=$(BUILDPATH)
 	cd $(SMBLIB_SRC)
 	$(MAKE) -$(MAKEFLAGS) lib
 	exit
@@ -230,6 +236,7 @@ ciolib-mt:
 	set DEBUG=$(DEBUG)
 	set RELEASE=$(RELEASE)
 	set VERBOSE=$(VERBOSE)
+	set BUILDPATH=$(BUILDPATH)
 	cd $(CIOLIB_SRC)
 	$(MAKE) -$(MAKEFLAGS) mtlib
 	exit
@@ -242,6 +249,7 @@ uifc:
 	set DEBUG=$(DEBUG)
 	set RELEASE=$(RELEASE)
 	set VERBOSE=$(VERBOSE)
+	set BUILDPATH=$(BUILDPATH)
 	cd $(UIFC_SRC)
 	$(MAKE) -$(MAKEFLAGS) lib
 	exit
@@ -254,6 +262,7 @@ uifc-mt:
 	set DEBUG=$(DEBUG)
 	set RELEASE=$(RELEASE)
 	set VERBOSE=$(VERBOSE)
+	set BUILDPATH=$(BUILDPATH)
 	cd $(UIFC_SRC)
 	$(MAKE) -$(MAKEFLAGS) mtlib
 	exit
diff --git a/src/build/Common.gmake b/src/build/Common.gmake
index 6f1cc4ac04..a09c0be869 100644
--- a/src/build/Common.gmake
+++ b/src/build/Common.gmake
@@ -222,6 +222,7 @@ else
  ifeq ($(os),darwin)
   SOFILE =	.dylib
   CFLAGS +=	-Wno-long-double
+  RANLIB +=	-s
  endif
 endif
 
diff --git a/src/sbbs3/Makefile b/src/sbbs3/Makefile
index dc5cf01a6f..9cf39495c8 100644
--- a/src/sbbs3/Makefile
+++ b/src/sbbs3/Makefile
@@ -30,7 +30,7 @@ CFLAGS = $(CFLAGS) -DJAVASCRIPT
 !endif
 
 !ifndef JSLIBDIR
-	JSLIBDIR = $(SRC_ROOT)$(DIRSEP)..$(DIRSEP)lib$(DIRSEP)mozilla$(DIRSEP)js$(DIRSEP)win32.$(BUILDPATH)
+	JSLIBDIR = $(SRC_ROOT)$(DIRSEP)..$(DIRSEP)lib$(DIRSEP)mozilla$(DIRSEP)js$(DIRSEP)win32.$(BUILD)
 !endif
 !ifndef JSLIB
 	JSLIB	=	js32omf
@@ -38,7 +38,7 @@ CFLAGS = $(CFLAGS) -DJAVASCRIPT
 !ifndef NSPRDIR
 	# There *IS* no debug build in CVS
 	# That's ok, looks like it doesn't need NSPR4
-	#NSPRDIR = $(SRC_ROOT)$(DIRSEP)..$(DIRSEP)lib$(DIRSEP)mozilla$(DIRSEP)nspr$(DIRSEP)win32.$(BUILDPATH)
+	#NSPRDIR = $(SRC_ROOT)$(DIRSEP)..$(DIRSEP)lib$(DIRSEP)mozilla$(DIRSEP)nspr$(DIRSEP)win32.$(BUILD)
 	#NSPRDIR = $(SRC_ROOT)$(DIRSEP)..$(DIRSEP)lib$(DIRSEP)mozilla$(DIRSEP)nspr$(DIRSEP)win32.release
 !endif
 JS_LDFLAGS = $(JS_LDFLAGS) $(JSLIBDIR)$(DIRSEP)$(UL_PRE)$(JSLIB)$(UL_SUF)
-- 
GitLab