29 September 2018, 21:18 | #1 |
Registered User
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 Code:
make: *** No rule to make target 'cpus//cpu.h', needed by 'obj_win32/__vasm.o'. Stop. Last edited by guy lateur; 30 September 2018 at 17:04. Reason: Added solution + 32/64-bit remark |
29 September 2018, 21:33 | #2 |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
I have the latest vasm built with m68k support if u want it.
|
29 September 2018, 21:53 | #3 |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
|
29 September 2018, 22:10 | #4 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
|
the message means that "cpus//cpu.h" doesn't exist. Or there's no rule to generate it (if it's a generated code)
Anyway building such complex programs on Windows is just hell. Even when you know what you're doing. |
29 September 2018, 22:24 | #5 | |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
Quote:
And no, I have as good as no idea what I'm doing, here, so good luck to me! |
|
29 September 2018, 22:48 | #6 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
|
cpus//cpu.h is the same as cpus\cpu.h (POSIX paths are accepted on windows). But the file isn't here. Note that there are at least 2 different flavours of "make" command on windows: MinGW and native. The stuff is generally half-ported to windows with crap like cygwin and all... or it relies on MSVC compiler and the infamous "vcvarsall.bat". Oh my!
|
29 September 2018, 23:50 | #7 |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
|
30 September 2018, 02:13 | #8 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
If you setup a linux vm then this compiles it:
make CPU=m68k SYNTAX=madmac CC=x86_64-w64-mingw32-gcc CFLAGS="-Os" LDFLAGS="-s -static" TARGETEXTENSION=.exe |
30 September 2018, 12:28 | #9 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
If you want to build vasm quickly, open the VS native shell and run:
Code:
cd vasm md obj_win32 nmake /f makefile.win32 CPU=m68k SYNTAX=madmac |
30 September 2018, 13:08 | #10 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
|
nmake! another flavour of the "make" command. That one is pure native. No missing with MinGW stuff. thanks
|
30 September 2018, 14:50 | #11 |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
Thank you all for the help, much appreciated! I clearly needed to specify the target cpu and the syntax module. For some reason, I was expecting it to build every combination automatically. I'll adjust my first post with the solution shortly.
I do get a warning when compiling vasmm68k_madmac_win32.exe (using Leffmann's commands): Code:
parse.c(1158): warning C4477: 'printf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 1 has type 'size_t' parse.c(1158): note: consider using '%zu' in the format string Also, the above mentioned procedure generates win32 executables. If somebody knows how to produce x64 binaries, I'll be happy to hear about it. |
30 September 2018, 14:58 | #12 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
There is a chapter "Building vasm" in the documentation and there is also a short instruction on the home page here: http://sun.hasenbraten.de/vasm/index.php?view=compile In any case, as others already pointed out, you need to set the CPU and the SYNTAX variables for the make-process. Working on Windows might be hell, but vasm is really just a simple, portable ANSI-C source, without any dependencies. |
|
30 September 2018, 15:12 | #13 | |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
Quote:
Any thoughts on the aforementioned warning? And/or on the 64-bit binaries? |
|
30 September 2018, 15:36 | #14 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
There's no benefit in running 64-bit versions of the tools, but you can build them using the VS 64-bit native shell.
The printf format warning is safe to ignore. |
30 September 2018, 16:00 | #15 | |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
Quote:
Ok, thanks! |
|
30 September 2018, 16:26 | #16 |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
Edited first post to add solution.
|
30 September 2018, 16:57 | #17 |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
Never mind that, what Leffmann said about the different shells producing 32- vs 64-bit executables is correct. It just still has the win32 suffix in the name, but it is indeed a 64-bit executable.
|
03 June 2021, 12:36 | #18 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
vasm can be compiled with any 32-bit or 64-bit C99-compliant compiler. It's up to you which one to select.
Additionally we automatically generate 64-Bit Windows executables with every new release (since V1.8j). You find the zip-Archives for the most common backends here: http://sun.hasenbraten.de/vasm/index.php?view=binrel |
03 June 2021, 13:11 | #19 | |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
Quote:
|
|
03 June 2021, 13:34 | #20 | |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,406
|
Quote:
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Trying out vlink and vasm | cla | Coders. General | 2 | 30 September 2016 20:30 |
vasm and comments | xxxxx | Coders. Asm / Hardware | 10 | 03 February 2015 12:59 |
vasm question | marduk_kurios | Coders. Asm / Hardware | 7 | 14 February 2014 20:06 |
vasm fsincos | dalton | Coders. Asm / Hardware | 4 | 03 September 2012 10:35 |
vasm 1.5 RFC | phx | Coders. General | 30 | 11 December 2010 02:08 |
|
|