Author Topic: New "makeit.bat" for the MASM64 Library  (Read 776 times)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 6758
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
New "makeit.bat" for the MASM64 Library
« on: May 23, 2019, 05:06:52 AM »
I found a silly problem with the library build, it was cutting off the last module and did not build it. I don't know whether its a file count limit in ml64 but I could not be bothered debugging it so I wrote a new batch file to do the task. With thanks to Erol for the original idea, the following is the new batch file.

: ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

@echo off

: delete any existing library
  if exist m64lib.lib del m64lib.lib

: assemble modules
  for %%x in (*.asm) do \masm32\bin64\ml64 /c /nologo %%x

: redirect object files into a response file
  dir /b *.obj > obj.txt

: link the object modules into a library
  \masm32\bin64\lib /MACHINE:X64 /OUT:m64lib.lib @obj.txt

: clean up the junk
  del *.obj

: display the library at the console
  dir *.lib                                             

pause

: ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

nidud

  • Member
  • *****
  • Posts: 1799
    • https://github.com/nidud/asmc
Re: New "makeit.bat" for the MASM64 Library
« Reply #1 on: May 23, 2019, 06:34:56 AM »

@echo off

: delete any existing library
  if exist m64lib.lib del m64lib.lib

: assemble modules
  for %%x in (*.asm) do \masm32\bin64\ml64 /c /nologo %%x

: redirect object files into a response file
  dir /b *.obj > obj.txt

: link the object modules into a library
  \masm32\bin64\lib /MACHINE:X64 /OUT:m64lib.lib @obj.txt

: clean up the junk
  del *.obj

: display the library at the console
  dir *.lib                                             

pause


I assumed ml64 handled wild args but lib still do.

@echo off

: delete any existing library
  if exist m64lib.lib del m64lib.lib

: assemble modules
  for %%x in (*.asm) do \masm32\bin64\ml64 /c /nologo %%x

: link the object modules into a library
  \masm32\bin64\lib /MACHINE:X64 /OUT:m64lib.lib *.obj

: clean up the junk
  del *.obj

: display the library at the console
  dir *.lib                                             

pause

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 6758
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: New "makeit.bat" for the MASM64 Library
« Reply #2 on: May 23, 2019, 08:51:45 AM »
I have not seen a MASM version that handles wildcards but they do handle response files. Whatever the limit is, it was dropping the 132nd file name even though it was in the response file so I changed the way the library is built so that I can keep adding modules to the library.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

felipe

  • Member
  • *****
  • Posts: 1249
  • Eagles are just great!
Re: New "makeit.bat" for the MASM64 Library
« Reply #3 on: May 23, 2019, 11:31:06 PM »
thanks hutch  :Thmbsup:. So you will put this bat file in the zip folder of the masm64 package?
Felipe.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 6758
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: New "makeit.bat" for the MASM64 Library
« Reply #4 on: May 24, 2019, 12:10:12 AM »
Just replace the batch file of the same name in the m64lib directory. The earlier one appeared to run into a limit that is probably set in ml64 for response files. The new one has no limit of files so it can be used for libraries with a much larger module count.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

felipe

  • Member
  • *****
  • Posts: 1249
  • Eagles are just great!
Re: New "makeit.bat" for the MASM64 Library
« Reply #5 on: May 24, 2019, 03:01:01 AM »
ok then. thanks again.  :Thmbsup:.
Felipe.