Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

build: fix make tool command line handling #120

Merged
merged 1 commit into from
Dec 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
build: fix make tool command line handling
unify main make file name to makefile.mak
now make tool command line is handled by MAKE environment variable (fix issue with space after -f for Turbo C)
  • Loading branch information
jmalak committed Dec 25, 2024
commit 5ec17e938ff5671c89c3a2a7b86014d99927ccf0
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -306,7 +306,7 @@ tools/icmd_1.icd
tools/icmd_2.icd
tools/icmd_3.icd
tools/kssf.com
tools/tools.mak
tools/makefile.mak
tools/vspawn.com
tools/watcomc.cfg
utils/watcomc.cfg
36 changes: 18 additions & 18 deletions build.bat
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ set SWAP=YES-DXMS-SWAP____________________
if NOT "%SWAP%"=="YES-DXMS-SWAP____________________" goto err1
: BEGIN Internal stuff for ska -- If one of these three commands
: fail for you, your distribution is broken! Please report.
for %%a in (lib\lib.mak cmd\cmd.mak shell\command.mak) do if not exist %%a set SWAP=NO
for %%a in (lib\makefile.mak cmd\makefile.mak shell\makefile.mak) do if not exist %%a set SWAP=NO
if "%SWAP%"=="NO" set XMS_SWAP=
if "%SWAP%"=="NO" call dmake dist
: END
@@ -83,10 +83,10 @@ echo Building FreeCOM for language %LNG%

if not "%MAKE%" == "" goto skip_make

if "%COMPILER%" == "TC2" set MAKE=%TC2_BASE%\make -f
if "%COMPILER%" == "TURBOCPP" set MAKE=%TP1_BASE%\bin\make -f
if "%COMPILER%" == "BC5" set MAKE=%BC5_BASE%\bin\make -f
if "%COMPILER%" == "WATCOM" set MAKE=wmake -ms -h -f
if "%COMPILER%" == "TC2" set MAKE=%TC2_BASE%\make -fmakefile.mak
if "%COMPILER%" == "TURBOCPP" set MAKE=%TP1_BASE%\bin\make -f makefile.mak
if "%COMPILER%" == "BC5" set MAKE=%BC5_BASE%\bin\make -f makefile.mak
if "%COMPILER%" == "WATCOM" set MAKE=wmake -ms -h -f makefile.mak

echo Make is %MAKE%.

@@ -97,10 +97,10 @@ echo Checking SUPPL library
cd suppl
if exist skip goto endSuppl
echo Building SUPPL library
%MAKE% suppl.mak all
%MAKE% all
if errorlevel 1 goto ende
cd src
%MAKE% suppl.mak all
%MAKE% all
if errorlevel 1 goto ende
cd ..
:endSuppl
@@ -110,50 +110,50 @@ echo.
echo Making basic utilities for build process
echo.
cd utils
%MAKE% utils.mak all
%MAKE% all
if errorlevel 1 goto ende
cd ..

echo.
echo Making STRINGS resource
echo.
cd strings
%MAKE% strings.mak all
%MAKE% all
if errorlevel 1 goto ende
cd strings
%MAKE% strings.mak all
%MAKE% all
if errorlevel 1 goto ende
cd ..\..

echo.
echo Making CRITER resource
echo.
cd criter
%MAKE% criter.mak all
%MAKE% all
if errorlevel 1 goto ende
cd ..

echo.
echo Making misc library
echo.
cd lib
%MAKE% lib.mak all
%MAKE% all
if errorlevel 1 goto ende
cd ..

echo.
echo Making commands library
echo.
cd cmd
%MAKE% cmd.mak all
%MAKE% all
if errorlevel 1 goto ende
cd ..

echo.
echo Making COMMAND.COM
echo.
cd shell
%MAKE% command.mak all
%MAKE% all
if errorlevel 1 goto ende
cd ..

@@ -169,10 +169,10 @@ echo.
echo Making supplemental tools
echo.
cd tools
type tools.m1 >tools.mak
..\utils\mktools.exe >>tools.mak
type tools.m2 >>tools.mak
%MAKE% tools.mak all
type tools.m1 >makefile.mak
..\utils\mktools.exe >>makefile.mak
type tools.m2 >>makefile.mak
%MAKE% all
if errorlevel 1 goto ende
cd ..

40 changes: 20 additions & 20 deletions build.sh
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ fi
export SWAP=YES-DXMS-SWAP____________________
# BEGIN Internal stuff for ska -- If one of these three commands
# fail for you, your distribution is broken! Please report.
for a in lib/lib.mak cmd/cmd.mak shell/command.mak; do if [ ! -f $a ]; then export SWAP=NO; fi; done
for a in lib/makefile.mak cmd/makefile.mak shell/makefile.mak; do if [ ! -f $a ]; then export SWAP=NO; fi; done
if [ "$SWAP" == "NO" ]; then
unset XMS_SWAP
dmake dist
@@ -87,7 +87,7 @@ echo Building FreeCOM for language $LNG
if [ -z "$MAKE" ]; then
case "$COMPILER" in
watcom)
export MAKE="wmake -ms -h -f"
export MAKE="wmake -ms -h -f makefile.mak"
;;
gcc)
export MAKE="make -f gnumake.mak"
@@ -114,22 +114,22 @@ gnumake_subst () {
if $MAKE -? 2>&1 | grep -q gnu; then
gnumake_subst . config.mak gnuconf.mak
for i in suppl utils strings criter lib cmd; do
gnumake_subst $i $i.mak gnumake.mak
gnumake_subst $i makefile.mak gnumake.mak
done
gnumake_subst suppl/src suppl.mak gnumake.mak
gnumake_subst strings/strings strings.mak gnumake.mak
gnumake_subst shell command.mak gnumake.mak
gnumake_subst suppl/src makefile.mak gnumake.mak
gnumake_subst strings/strings makefile.mak gnumake.mak
gnumake_subst shell makefile.mak gnumake.mak
fi

echo
echo Checking SUPPL library
cd suppl
if [ ! -f skip ]; then
echo Building SUPPL library
$MAKE suppl.mak all
$MAKE all

cd src
$MAKE suppl.mak all
$MAKE all
cd ..
fi
cd ..
@@ -138,44 +138,44 @@ echo
echo Making basic utilities for build process
echo
cd utils
$MAKE utils.mak all
$MAKE all
cd ..

echo
echo Making STRINGS resource
echo
cd strings
$MAKE strings.mak all
$MAKE all
cd strings
$MAKE strings.mak all
$MAKE all
cd ../..

echo
echo Making CRITER resource
echo
cd criter
$MAKE criter.mak all
$MAKE all
cd ..

echo
echo Making misc library
echo
cd lib
$MAKE lib.mak all
$MAKE all
cd ..

echo
echo Making commands library
echo
cd cmd
$MAKE cmd.mak all
$MAKE all
cd ..

echo
echo Making COMMAND.COM
echo
cd shell
$MAKE command.mak all
$MAKE all
cd ..

utils/mkinfres.exe -Tinfo.txt infores shell/command.map shell/command.exe
@@ -186,13 +186,13 @@ echo
echo Making supplemental tools
echo
cd tools
cat tools.m1 > tools.mak
../utils/mktools.exe >>tools.mak
cat tools.m2 >>tools.mak
cat tools.m1 > makefile.mak
../utils/mktools.exe >>makefile.mak
cat tools.m2 >>makefile.mak
if $MAKE -? 2>&1 | grep -q gnu; then
gnumake_subst . tools.mak gnumake.mak
gnumake_subst . makefile.mak gnumake.mak
fi
$MAKE tools.mak all
$MAKE all
cd ..

echo
2 changes: 1 addition & 1 deletion ci_build.sh
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ git clean -q -x -d -f -e _output -e _watcom -e _download
{
echo set COMPILER=WATCOM
echo set WATCOM='C:\\devel\\watcomc'
echo set MAKE=wmake /ms /h /f
echo set MAKE=wmake /ms /h /f makefile.mak
echo set XNASM='C:\\devel\\nasm\\nasm'
echo set XUPX=upx --8086 --best
echo set OLDPATH=%PATH%
2 changes: 1 addition & 1 deletion clean.bat
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ call %0 criter\ criter criter1 context.def context.inc context.h_c
call %0 cmd\ cmds.lib cmds.lst cmds.rsp echolib.bat
call %0 lib\ freecom.lib freecom.lst freecom.rsp echolib.bat
call %0 shell\ command.exe command.map command.rsp echoto.bat
call %0 tools\ tools.mak
call %0 tools\ makefile.mak

call %0 strings\*. cfg obj exe
call %0 strings\strings\*. c obj
2 changes: 1 addition & 1 deletion clean.sh
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ cd ../lib && rm -f freecom.lib freecom.lst freecom.rsp echolib.bat
cd ../shell && rm -f command.exe command.map command.rsp echoto.bat
cd ../strings && rm -f *.cfg *.obj *.exe
cd ../strings/strings && rm -f strings.lib strings.lst strings.rsp *.c *.obj *.o makefile
cd ../../tools && rm -f tools.mak *.icd *.cfg *.obj *.map *.exe *.com
cd ../../tools && rm -f makefile.mak *.icd *.cfg *.obj *.map *.exe *.com
cd ../utils && rm -f *.cfg *.obj *.map *.exe
for i in cmd lib shell criter; do cd ../$i && rm -f *.obj *.cfg; done
cd .. && rm -f gnuconf.mak $(find * -name gnumake.mak)
2 changes: 1 addition & 1 deletion cmd/cmd.m1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.AUTODEPEND

CFG_DEPENDENCIES = cmd.mak
CFG_DEPENDENCIES = makefile.mak

!include "..\config.mak"

6 changes: 3 additions & 3 deletions cmd/makefile
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ HDR = ..\config.h ..\err_fcts.h ..\include/batch.h ..\include/cmdline.h \
# Default target
all: cmds.lib

dist: cmd.mak
dist: makefile.mak

%.obj : %.asm ; $(NASM) $(NASMFLAGS) -f obj -F borland -o $@ $< >>errlist

@@ -248,12 +248,12 @@ DYNSOURCES =
#MAKEDEP STOP

clobber : clean
$(RM) $(RMFLAGS) *.com *.cln *.lib *.lst *.cfg cmd.mak
$(RM) $(RMFLAGS) *.com *.cln *.lib *.lst *.cfg makefile.mak

clean :
$(RM) $(RMFLAGS) *.lst *.map *.bin *.bak *.las *.obj *.exe $(CFG) *.dmp com.com tags errlist


cmd.mak : makefile cmd.m1 cmd.m2
makefile.mak : makefile cmd.m1 cmd.m2
+copy cmd.m1 + $(mktmp cmds.lib : \44(CFG) $(OBJ:t" \\\\\\n\\t") \n\tif exist cmds.lib \44(AR) cmds.lib /c @&&|\n+-$(OBJ:t" &\\n+-")\n| , cmds.lst \n\tif not exist cmds.lib \44(AR) cmds.lib /c @&&|\n+$(OBJ:t" &\\n+")\n| , cmds.lst \n) + cmd.m2 $@

4 changes: 2 additions & 2 deletions cmd/cmd.mak → cmd/makefile.mak
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CFG_DEPENDENCIES = cmd.mak
CFG_DEPENDENCIES = makefile.mak

TOP=..
!include "$(TOP)/config.mak"
@@ -50,7 +50,7 @@ OBJ5 = rmdir.obj \
echolib.bat : ../scripts/echolib.bat
$(CP) ..$(DIRSEP)scripts$(DIRSEP)echolib.bat .

cmds.rsp : echolib.bat cmd.mak
cmds.rsp : echolib.bat makefile.mak
$(RMFILES) cmds.rsp
$(ECHOLIB) cmds.rsp $(OBJ1)
$(ECHOLIB) cmds.rsp $(OBJ2)
2 changes: 1 addition & 1 deletion criter/criter.mak → criter/makefile.mak
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CFG_DEPENDENCIES = criter.mak
CFG_DEPENDENCIES = makefile.mak

TOP=..
!include "$(TOP)/config.mak"
2 changes: 1 addition & 1 deletion lib/lib.m1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.AUTODEPEND

CFG_DEPENDENCIES = lib.mak
CFG_DEPENDENCIES = makefile.mak

!include "..\config.mak"

6 changes: 3 additions & 3 deletions lib/makefile
Original file line number Diff line number Diff line change
@@ -159,7 +159,7 @@ SRC += $(SRC_ERR)
OBJ += $(OBJ_ERR)


dist : lib.mak
dist : makefile.mak

%.obj : %.asm ; $(NASM) $(NASMFLAGS) -f obj -F borland -o $@ $< >>errlist

@@ -640,13 +640,13 @@ DYNSOURCES =
#MAKEDEP STOP

clobber : clean
$(RM) $(RMFLAGS) *.com *.cln *.lib *.lst *.cfg lib.mak
$(RM) $(RMFLAGS) *.com *.cln *.lib *.lst *.cfg makefile.mak

clean :
$(RM) $(RMFLAGS) *.lst *.map *.bin *.bak *.las *.obj *.exe $(CFG) *.dmp com.com tags errlist lib.m3


lib.mak : makefile lib.m1 lib.m2
makefile.mak : makefile lib.m1 lib.m2
..\utils\chunk freecom_deps <$(mktmp $(OBJ:t"\n")\n) >lib.m3
+copy lib.m1 + lib.m3 + $(mktmp freecom.lib : \44(CFG) freecom_deps \n\tif exist freecom.lib \44(AR) freecom.lib /c @&&|\n+-$(OBJ:t" &\\n+-")\n| , freecom.lst \n\tif not exist freecom.lib \44(AR) freecom.lib /c @&&|\n+$(OBJ:t" &\\n+")\n| , freecom.lst \n) + lib.m2 $@
# +copy lib.m1 + $(mktmp freecom.lib : \44(CFG) $(OBJ:t" \\\\\\n\\t") \n\tif exist freecom.lib \44(AR) freecom.lib /c @&&|\n+-$(OBJ:t" &\\n+-")\n| , freecom.lst \n\tif not exist freecom.lib \44(AR) freecom.lib /c @&&|\n+$(OBJ:t" &\\n+")\n| , freecom.lst \n) + lib.m2 $@
4 changes: 2 additions & 2 deletions lib/lib.mak → lib/makefile.mak
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#.AUTODEPEND

CFG_DEPENDENCIES = lib.mak
CFG_DEPENDENCIES = makefile.mak

TOP=..
!include "$(TOP)/config.mak"
@@ -255,7 +255,7 @@ echolib.bat : ../scripts/echolib.bat

freecom.rsp : echolib.bat $(OBJ16) $(OBJ17) $(OBJ18) $(OBJ19) $(OBJ20) \
$(OBJ21) $(OBJ22) $(OBJ23) $(OBJ24) $(OBJ25) $(OBJ26) $(OBJ27) $(OBJ28) \
$(OBJ29) lib.mak
$(OBJ29) makefile.mak
$(RMFILES) freecom.rsp
$(ECHOLIB) freecom.rsp $(OBJ1)
$(ECHOLIB) freecom.rsp $(OBJ2)
2 changes: 1 addition & 1 deletion shell/command.m1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.AUTODEPEND

CFG_DEPENDENCIES = COMMAND.MAK ..\strings.h
CFG_DEPENDENCIES = makefile.mak ..\strings.h

!include "..\config.mak"

Loading