View Single Post
Old 29 September 2018, 21:18   #1
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Building VASM on Windows

Edit: Solution:
In order to build vasm in any combination of cpu and syntax module, you'll need 3 things: a C/C++ compiler, a linker and a make utility. If you setup your Visual Studio environment correctly, you'll find all 3 of them there.

You can use the (free) Community Edition of Visual Studio (VS). The latest version at the time of writing is 2017. You may need to make a Microsoft account to keep using VS after the trial period has expired. Don't worry; it's free for personal use.

You'll need to make sure you have installed support for 'Desktop development with C++' in VS. You can do this by going to 'Get Tools and Features' in the VS Tools menu, and selecting the aforementioned feature for installation. IIRC, the default installation of VS2017 does not have this turned on. If you do not have this feature installed, you won't find the compiler and the linker in the VS installation directory (not sure about the make utility). If you do have this feature installed, then you'll find cl.exe (compiler), link.exe (linker) and nmake.exe (make utility) there.

By default, these executables will reside in a quite deeply nested directory, and they won't be in your Windows path, so the system will not find them. You could add these directories to your path system environment variable, or use the included 'x64 Native Tools Command Prompt for VS2017' to build vasm. I personally prefer the latter approach, because it's the easiest method, and because it probably has some more useful features then just setting the paths to the tools mentioned above.

Finally, you'll need to compile each combination of cpu & syntax module separately. You can specify them on the command line. Below is an example for building vasm for m68k cpu's with the madmac syntax.

You can read more about building vasm here:
http://sun.hasenbraten.de/vasm/index.php?view=compile
http://sun.hasenbraten.de/vasm/relea...html#Interface

TLDR: Summary:
1. Install Visual Studio
2. Install support for 'Desktop development with C++' in VS
3. Start the 'x64 Native Tools Command Prompt for VS2017'
4. cd to the vasm source root directory
5. (if you haven't already) md obj_win32
6. nmake /f makefile.win32 CPU=m68k SYNTAX=madmac
Done!
You'll find vasmm68k_madmac_win32.exe (*) in the vasm source root directory.
Special thanks to Leffmann for helping me figure this out.

(*) Although this executable has a _win32 suffix in its name, it really is a 64-bit executable if you used the 'x64 Native Tools Command Prompt for VS2017' to generate it. If you use the 'x86 Native Tools Command Prompt for VS2017', it will produce a 32-bit executable. You'll need to empty the obj_win32 folder before you try to build a different-bit-version of the executable, as the object files will have to be rebuilt with the same n-bit-ness.

-----------------------------------------------------------------------------
Original post:
I'm using 64-bit Windows 10 and Visual Studio 2017 Community Edition. I'm trying to build the latest vasm source archive (http://sun.hasenbraten.de/vasm/index.php?view=relsrc). Leffmann has a binary release of vbcc available (http://eab.abime.net/showthread.php?t=83113). Understandably, this does not come with all combinations of syntax and target vasm executables, so I've been trying to compile those myself. Eg, I'm trying to compile vasmm68k_madmac.exe, for reasons explained here: http://eab.abime.net/showthread.php?...45#post1272745

Coming with VS2017 is the C compiler (cl.exe) and the linker (link.exe), which is exactly how they are referenced in the Makefile.Win32 file in the vasm source. I take that to be a good sign. VS also comes with a cmake.exe, but I don't think that's your regular make -- for one, I can't seem to find the option to specify a makefile. So I'm using make.exe, as supplied by the windows binary release of vasm by Leffmann, see link above.

So I start the VS x64 native shell, cd to the vasm source directory, and type
Code:
make -f Makefile.Win32
Unfortunately this doesn't seem to do very much, and almost immediately bails out with this message:
Code:
make: *** No rule to make target 'cpus//cpu.h', needed by 'obj_win32/__vasm.o'.  Stop.
Does anyone have any idea what the problem might be, and what I can do to solve it? TIA!

Last edited by guy lateur; 30 September 2018 at 17:04. Reason: Added solution + 32/64-bit remark
guy lateur is offline  
 
Page generated in 0.05025 seconds with 11 queries