Skip to content

Commit

Permalink
2024-01-13 00:32 UTC-0500 Ron Pinkas <ronpinkas/AT/gmail/com>
Browse files Browse the repository at this point in the history
  * make_bc.bat
  * make_clng.bat
  * make_gc.bat
  * make_gc64.bat
  * make_gnu.bat
  * make_mingw.sh
  * make_pc.bat
  * make_vc.bat
  * make_xc.bat
  * winmake/find_bc.bat
  * winmake/find_bison.bat
  * winmake/find_pc.bat
  * winmake/find_vc.bat
  * winmake/found_cc.bat
  * winmake/makefile.gc
  * winmake/mdir.bat
    * Cleanup and standardization

  * winmake/functions.bat
    * Renamed findInPath to rootOfAppInPath
    + Added Right, findInString, isStrInPath, isPathInPath

  + winmake/find_clng.bat
  + winmake/known.clng
    + Added auto detection support for MingW-CLang (work in progress)
  • Loading branch information
ronpinkas committed Jan 13, 2024
1 parent f3bfdf1 commit 5f02def
Show file tree
Hide file tree
Showing 20 changed files with 911 additions and 393 deletions.
27 changes: 27 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,33 @@
2002-12-01 23:12 UTC+0100 Foo Bar <[email protected]>
*/

2024-01-13 00:32 UTC-0500 Ron Pinkas <ronpinkas/AT/gmail/com>
* make_bc.bat
* make_clng.bat
* make_gc.bat
* make_gc64.bat
* make_gnu.bat
* make_mingw.sh
* make_pc.bat
* make_vc.bat
* make_xc.bat
* winmake/find_bc.bat
* winmake/find_bison.bat
* winmake/find_pc.bat
* winmake/find_vc.bat
* winmake/found_cc.bat
* winmake/makefile.gc
* winmake/mdir.bat
* Cleanup and standardization

* winmake/functions.bat
* Renamed findInPath to rootOfAppInPath
+ Added Right, findInString, isStrInPath, isPathInPath

+ winmake/find_clng.bat
+ winmake/known.clng
+ Added auto detection support for MingW-CLang (work in progress)

2024-01-11 01:55 UTC-0500 Ron Pinkas <ronpinkas/AT/gmail/com>
* bin/bld.bat
+ Added support for MingW-CLang
Expand Down
42 changes: 18 additions & 24 deletions make_bc.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ rem
rem $Id$
rem
rem FILE: make_bc.bat
rem BATCH FILE FOR Borland C++
rem
rem This is Generic File, do not change it. If you should require your own build
rem version, changes should only be made on your local copy.(AJ:2008-04-26)
Expand All @@ -27,13 +26,15 @@ REM SET HB_DIR_OPENSSL=
REM SET HB_DIR_MAGIC=
REM SET HB_DIR_ADS=

IF "%__MAKE__%"=="" SET __MAKE__=make

REM Make that the current directory is the same as the batch file (root of xHarbour)
CD %~dp0

SET "scriptName=%~n0"
ECHO *** START [%~f0](%*) > winmake\functions.log

:SET_BCC
:SET_CC
CALL winmake\find_bc.bat
IF ERRORLEVEL 99 GOTO ERROR_99
IF ERRORLEVEL 2 GOTO ABORTED
Expand All @@ -44,7 +45,7 @@ ECHO *** START [%~f0](%*) > winmake\functions.log
:ERROR_99
ECHO.
ECHO. ---------------------------------------
ECHO. Make Utility for Borland C/C++
ECHO. Make Utility for %C_LONG_NAME%
ECHO. ---------------------------------------
ECHO.
ECHO. Unexpected error!
Expand All @@ -54,7 +55,7 @@ ECHO *** START [%~f0](%*) > winmake\functions.log
:ABORTED
ECHO.
ECHO. ---------------------------------------
ECHO. Make Utility for Borland C/C++
ECHO. Make Utility for %C_LONG_NAME%
ECHO. ---------------------------------------
ECHO.
ECHO. Aborted by user.
Expand All @@ -64,10 +65,10 @@ ECHO *** START [%~f0](%*) > winmake\functions.log
:NOT_READY
ECHO.
ECHO. ---------------------------------------
ECHO. Make Utility for Borland C/C++
ECHO. Make Utility for %C_LONG_NAME%
ECHO. ---------------------------------------
ECHO.
ECHO. Borland C/C++ not found.
ECHO. %C_LONG_NAME% not found.
ECHO. Please install and try again.
ECHO.
GOTO EXIT
Expand All @@ -79,9 +80,6 @@ ECHO *** START [%~f0](%*) > winmake\functions.log
GOTO READY

:READY
IF "%SUB_DIR%"=="" SET SUB_DIR=b32
IF "%HB_ARCH%"=="w64" SET SUB_DIR=b64

REM NOT an error using $() synttax because it will be LATE expanded by make!
IF "%HB_GT_LIB%" == "" SET "HB_GT_LIB=$(GTWIN_LIB)"

Expand All @@ -98,9 +96,7 @@ rem ============================================================================
SET LIBEXT=%HB_DEBUG%.lib
SET OBJEXT=%HB_DEBUG%.obj
SET DIR_SEP=\
IF "%HB_ARCH%"=="w64" SET LIBEXT=%HB_DEBUG%.a
IF "%HB_ARCH%"=="w64" SET OBJEXT=%HB_DEBUG%.o
REM SET LIBPREFIX=
SET LIBPREFIX=
rem ============================================================================

if "%1"=="/?" goto SYNTAX
Expand All @@ -125,20 +121,22 @@ rem=============================================================================
:BUILD
rem=============================================================================
SET __BLD__=CORE_BLD
SET HB_THREAD_SUPPORT=
SET HB_MT=
SET HB_MT_DIR=
@CALL winmake\mdir.bat
make -l -fwinmake\makefile.bc >make_%SUB_DIR%.log
%__MAKE__% -l -fwinmake\makefile.%C_SHORT_NAME% >make_%SUB_DIR%.log
if errorlevel 1 goto BUILD_ERR
if "%1"=="NOMT" goto BUILD_OK
if "%1"=="nomt" goto BUILD_OK
if "%2"=="NOMT" goto BUILD_OK
if "%2"=="nomt" goto BUILD_OK

SET HB_THREAD_SUPPORT=1
SET HB_MT=mt
SET HB_MT_DIR=
@CALL winmake\mdir.bat
make -l -DHB_THREAD_SUPPORT -fwinmake\makefile.bc >>make_%SUB_DIR%.log
%__MAKE__% -l -fwinmake\makefile.%C_SHORT_NAME% >>make_%SUB_DIR%.log
if errorlevel 1 goto BUILD_ERR
goto BUILD_OK

Expand All @@ -163,15 +161,16 @@ rem=============================================================================
rem=============================================================================
:DLL
rem=============================================================================
IF "%HB_DEBUG%"=="d" goto EXIT
rem
rem We use HB_MT_DIR envar for DLL object folder here
rem
SET __BLD__=DLL_BLD
SET HB_THREAD_SUPPORT=
SET HB_MT=
SET HB_MT_DIR=\dll
REM SET HB_NO_VM_ALL=1
@CALL winmake\mdir.bat dllcreate
make -l -fwinmake\makefile.bc >dll_%SUB_DIR%.log
%__MAKE__% -l -fwinmake\makefile.%C_SHORT_NAME% >dll_%SUB_DIR%.log
if errorlevel 1 goto DLL_ERR
goto DLL_OK

Expand All @@ -197,16 +196,13 @@ rem=============================================================================
:CONTRIBS
rem=============================================================================
SET __BLD__=CONTRIB_BLD
SET HB_THREAD_SUPPORT=
SET HB_MT=
SET HB_MT_DIR=
@CALL winmake\mdir.bat
make -l -fwinmake\makefile.bc >cont_%SUB_DIR%.log
%__MAKE__% -l -fwinmake\makefile.%C_SHORT_NAME% >cont_%SUB_DIR%.log
if errorlevel 1 goto CONTRIBS_ERR

REM SET HB_MT=mt
REM SET HB_MT_DIR=
REM make -s -l -DHB_THREAD_SUPPORT -fwinmake\makefile.bc >>cont_%SUB_DIR%.log
REM if errorlevel 1 goto CONTRIBS_ERR

rem=============================================================================
:CONTRIBS_OK
Expand All @@ -232,7 +228,7 @@ rem=============================================================================
rem=============================================================================
ECHO.
ECHO. ---------------------------------------
ECHO. Make Utility for Borland C/C++
ECHO. Make Utility for %C_LONG_NAME%
ECHO. ---------------------------------------
@CALL winmake\mdir.bat howto
goto EXIT
Expand All @@ -241,8 +237,6 @@ rem=============================================================================
:CLEAN
rem=============================================================================
@CALL winmake\mdir.bat clean
REM IF EXIST "%HB_DIR_ADS%\ace32.dll" implib -c lib\b32\ace32.lib "%HB_DIR_ADS%\ace32.dll"
REM IF EXIST lib\b32\ace32.lib copy lib\b32\ace32.lib lib
IF "%2"=="BUILD" goto BUILD_ALL
IF "%2"=="build" goto BUILD_ALL
@ECHO ****** End of Job *****
Expand Down
114 changes: 81 additions & 33 deletions make_clng.bat
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@

@echo off
rem ============================================================================
rem
rem $Id$
rem
rem FILE: make_clng.bat
rem BATCH FILE FOR MingW-Clang
rem FILE: make_clng.bat (for Mingw-w64 LLVM/clang based toolchain)
rem
rem This is Generic File, do not change it. If you should require your own build
rem version, changes should only be made on your local copy.(AJ:2008-04-26)
rem
rem ============================================================================

REM SET HB_ARCH=w64
REM SET HB_OPTIMFLAGS=-gc3
REM SET HB_DEBUG=d
REM SET HB_GUI=1
Expand All @@ -23,27 +26,78 @@ REM SET HB_DIR_OPENSSL=
REM SET HB_DIR_MAGIC=
REM SET HB_DIR_ADS=

SET "DIR_SEP=/"
IF "%__MAKE__%"=="" SET __MAKE__=mingw32-make

REM Make that the current directory is the same as the batch file (root of xHarbour)
CD %~dp0

SET "scriptName=%~n0"
ECHO *** START [%~f0](%*) > winmake\functions.log

:SET_CC
CALL winmake\find_clng.bat
IF ERRORLEVEL 99 GOTO ERROR_99
IF ERRORLEVEL 2 GOTO ABORTED
IF ERRORLEVEL 1 GOTO NOT_READY

GOTO FIND_BISON

:ERROR_99
ECHO.
ECHO. ---------------------------------------
ECHO. Make Utility for %C_LONG_NAME%
ECHO. ---------------------------------------
ECHO.
ECHO. Unexpected error!
ECHO.
GOTO EXIT

:ABORTED
ECHO.
ECHO. ---------------------------------------
ECHO. Make Utility for %C_LONG_NAME%
ECHO. ---------------------------------------
ECHO.
ECHO. Aborted by user.
ECHO.
GOTO EXIT

:NOT_READY
ECHO.
ECHO. ---------------------------------------
ECHO. Make Utility for %C_LONG_NAME%
ECHO. ---------------------------------------
ECHO.
ECHO. %C_LONG_NAME% not found.
ECHO. Please install and try again.
ECHO.
GOTO EXIT

IF "%HB_ARCH%" == "" SET HB_ARCH=w32
IF "%CC_DIR%" == "" SET CC_DIR=C:%DIR_SEP%llvm-mingw-20231128-ucrt-x86_64
IF "%CC%" == "" SET CC=clang
:FIND_BISON
IF NOT "%BISON_DIR%"=="" GOTO READY
CALL winmake\find_bison.bat
IF "%CC%"=="" GOTO NOT_READY
GOTO READY

SET SUB_DIR=clng%HB_ARCH%
:READY
REM NOT an error using $() synttax because it will be LATE expanded by make!
IF "%HB_GT_LIB%" == "" SET "HB_GT_LIB=$(GTWIN_LIB)"

IF "%HB_GT_LIB%" == "" SET HB_GT_LIB=$(GTWIN_LIB)
IF "%BISON_DIR%" == "" SET BISON_DIR=
REM echo "%CC_DIR%"

SET _PATH=%PATH%
SET PATH=%CC_DIR%/bin;%PATH%
:SAVE_PATH
REM Save the original path before further modifications
SET _PATH=%PATH%

rem ============================================================================
rem The followings should never change
rem Do not hard-code in makefile because there are needed for clean build
rem ============================================================================
SET "OBJEXT=%HB_DEBUG%.o"
SET "LIBEXT=%HB_DEBUG%.a"
SET "LIBPREFIX=lib"
SET LIBEXT=%HB_DEBUG%.a
SET OBJEXT=%HB_DEBUG%.o
SET DIR_SEP=/
SET LIBPREFIX=lib
rem ============================================================================

if "%1"=="/?" goto SYNTAX
if "%1"=="-?" goto SYNTAX
Expand Down Expand Up @@ -71,7 +125,7 @@ rem=============================================================================
SET HB_MT=
SET HB_MT_DIR=
@CALL winmake\mdir.bat
mingw32-make.exe -r -f winmake\makefile.clng 1>make0_%SUB_DIR%.log 2>make_%SUB_DIR%.log
%__MAKE__% -l -fwinmake\makefile.%C_SHORT_NAME% >make_%SUB_DIR%.log
if errorlevel 1 goto BUILD_ERR
if "%1"=="NOMT" goto BUILD_OK
if "%1"=="nomt" goto BUILD_OK
Expand All @@ -82,7 +136,7 @@ rem=============================================================================
SET HB_MT=mt
SET HB_MT_DIR=
@CALL winmake\mdir.bat
mingw32-make.exe -r -f winmake\makefile.clng 1>>make0_%SUB_DIR%.log 2>>make_%SUB_DIR%.log
%__MAKE__% -r -f winmake\makefile.%C_SHORT_NAME% 1>>make0_%SUB_DIR%.log 2>>make_%SUB_DIR%.log
if errorlevel 1 goto BUILD_ERR
goto BUILD_OK

Expand All @@ -107,16 +161,16 @@ rem=============================================================================
rem=============================================================================
:DLL
rem=============================================================================
rem==========================================================================
rem
rem We use HB_MT_DIR envar for DLL object folder here
rem==========================================================================
rem
SET __BLD__=DLL_BLD
SET HB_THREAD_SUPPORT=
SET HB_MT=
SET HB_MT_DIR=%DIR_SEP%dll
SET HB_NO_VM_ALL=1
REM SET HB_NO_VM_ALL=1
@CALL winmake\mdir.bat dllcreate
mingw32-make.exe -r -f winmake\makefile.clng 1>dll0_%SUB_DIR%.log 2>dll_%SUB_DIR%.log
%__MAKE__% -r -f winmake\makefile.clng 1>dll0_%SUB_DIR%.log 2>dll_%SUB_DIR%.log
if errorlevel 1 goto DLL_ERR
goto DLL_OK

Expand Down Expand Up @@ -146,14 +200,9 @@ rem=============================================================================
SET HB_MT=
SET HB_MT_DIR=
@CALL winmake\mdir.bat
mingw32-make.exe -f winmake\makefile.clng 1>cont0_%SUB_DIR%.log 2>cont_%SUB_DIR%.log
%__MAKE__% -f winmake\makefile.clng 1>cont0_%SUB_DIR%.log 2>cont_%SUB_DIR%.log
if errorlevel 1 goto CONTRIBS_ERR

REM SET HB_THREAD_SUPPORT=1
REM SET HB_MT=mt
REM SET HB_MT_DIR=
REM mingw32-make.exe -f winmake\makefile.clng 1>>cont0_%SUB_DIR%.log 2>>cont_%SUB_DIR%.log
REM if errorlevel 1 goto CONTRIBS_ERR

rem=============================================================================
:CONTRIBS_OK
Expand All @@ -178,19 +227,16 @@ rem=============================================================================
:SYNTAX
rem=============================================================================
ECHO.
ECHO. ------------------------
ECHO. Make Utility for MinGW32
ECHO. ------------------------
ECHO. ---------------------------------------
ECHO. Make Utility for %C_LONG_NAME%
ECHO. ---------------------------------------
@CALL winmake\mdir.bat howto
goto EXIT

rem=============================================================================
:CLEAN
rem=============================================================================
@CALL winmake\mdir.bat clean
IF EXIST make0_%SUB_DIR%.log DEL make0_%SUB_DIR%.log
IF EXIST cont0_%SUB_DIR%.log DEL cont0_%SUB_DIR%.log
IF EXIST dll0_%SUB_DIR%.log DEL dll0_%SUB_DIR%.log
IF "%2"=="BUILD" goto BUILD_ALL
IF "%2"=="build" goto BUILD_ALL
@ECHO ****** End of Job *****
Expand All @@ -200,3 +246,5 @@ rem=============================================================================
:EXIT
rem=============================================================================
@CALL winmake\mdir.bat resetenvar
set "scriptName="
ECHO *** END[%ERRORLEVEL%] [%~f0] >> winmake\functions.log
Loading

0 comments on commit 5f02def

Please sign in to comment.