English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 20 May 2020, 13:50   #1
grond
Banned

 
Join Date: Jun 2015
Location: Germany
Posts: 780
Host type variable in vasm?

I have recently played a little with cross-assemblation using vasm on my linux computer and find it very convenient. I now wonder whether there is an internal variable or another way to make one and the same source code assemble in vasm on the Amiga and in vasm on linux. The problem is a small one, on the Amiga I have an include directory called Include:, on linux the includes are obviously in a different place. I could, of course, specify the include directory on the command line or in the makefile but then again I would need to remember everything in order to successfully assemble my stuff in a few years from now (that's usually the biggest challenge...) or setup two different makefiles. I would prefer to just change the declaration in the source file depending on whether I assemble the code on the Amiga or on my linux computer. I think this could be done by using some IFDEF-type construct which would obviously require a way of finding out whether vasm is running on the Amiga or not. Is there some internal variable in vasm that could be checked to determine the type of the build system?
grond is offline  
Old 20 May 2020, 13:59   #2
roondar
Registered User

 
Join Date: Jul 2015
Location: The Netherlands
Posts: 1,956
I tend to have a shared makefile and a "proper" makefile. The shared one sets up directories, flags, etc and I include that in the "proper" one. Not really what you asked for, but it's a workaround anyway
roondar is offline  
Old 20 May 2020, 17:02   #3
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,660
Quote:
Originally Posted by grond View Post
on the Amiga I have an include directory called Include:, on linux the includes are obviously in a different place.
...
Is there some internal variable in vasm that could be checked to determine the type of the build system?
No, not yet. There is also no code to determine the host OS in vasm. The only OS-dependant code (for automatic path-conversions) is selected by compiling vasm with an AMIGA, _WIN32, MSDOS or ATARI define. Default is Unix-style paths.

Maybe I could introduce a symbol which reflects the current path-style (AMIGA, DOS, UNIX)? Does that help?

Quote:
Originally Posted by roondar View Post
I tend to have a shared makefile and a "proper" makefile. The shared one sets up directories, flags, etc and I include that in the "proper" one.
Yes, that's also what I did in the past. Usually there is more than just an include path which differs, so I always have sub-Makefile to include for the different platforms.
phx is offline  
Old 20 May 2020, 17:34   #4
grond
Banned

 
Join Date: Jun 2015
Location: Germany
Posts: 780
Quote:
Originally Posted by phx View Post
No, not yet. There is also no code to determine the host OS in vasm. The only OS-dependant code (for automatic path-conversions) is selected by compiling vasm with an AMIGA, _WIN32, MSDOS or ATARI define. Default is Unix-style paths.
As I'm not much of a programmer, I don't know how this could be done in the most convenient way, but obviously vasm wouldn't have to determine the host OS at run time but only at compile time which shouldn't require much code inside vasm.


Quote:
Maybe I could introduce a symbol which reflects the current path-style (AMIGA, DOS, UNIX)? Does that help?
That would solve the problem for me.


Quote:
Yes, that's also what I did in the past. Usually there is more than just an include path which differs, so I always have sub-Makefile to include for the different platforms.
I guess I should learn more about makefiles, both on linux and the Amiga. In linux I just use GNU make (and the most simple structure), on the Amiga I used to use smake back in the day, but it sucks because it can't even determine which object files need updates.
grond is offline  
Old 20 May 2020, 18:37   #5
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 47
Posts: 3,846
There we see the interest of having a simple config file, like Phxass does...
meynaf is offline  
Old 20 May 2020, 19:22   #6
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 451
I would not have two separate makefiles, but rather use vamos to build on Linux, and just use the Amiga binaries. This works surprisingly well now. 3.1.4 was built like this, and P96 is also build like this.
Thomas Richter is offline  
Old 21 May 2020, 06:05   #7
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 49
Posts: 541
Wouldn't "-Idir1:,dir2" work?
alkis is offline  
Old 21 May 2020, 13:35   #8
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,660
Ok, depending on whether vasm is compiled with -DUNIX, -DAMIGA, -DATARI, -DMSDOS, etc. it defines one of these internal symbols:
__UNIXFS __AMIGAFS __MSDOSFS

Otherwise no such symbol is defined. The value is currently 0, which might change in the future. You should check for them with
IFD
.

Feel free to try tomorrow's source snapshot.

Quote:
Originally Posted by Thomas Richter View Post
I would not have two separate makefiles, but rather use vamos to build on Linux, and just use the Amiga binaries.
Yes. That's another solution. Although it complicates the build environment by depending on vamos and python (installing, configuring).
phx is offline  
Old 21 May 2020, 13:38   #9
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 48
Posts: 4,170
personally I find that vamos on windows is unusable... I wanted to use lha on it, and just could get the help page... Any native solutions are always preferable.

vasm forever!
jotd is online now  
Old 21 May 2020, 13:38   #10
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,660
Quote:
Originally Posted by alkis View Post
Wouldn't "-Idir1:,dir2" work?
Yes, maybe. As long as a path doesn't generate strange errors on one OS.
phx is offline  
Old 21 May 2020, 13:41   #11
grond
Banned

 
Join Date: Jun 2015
Location: Germany
Posts: 780
Thank you, I will try it some of these days!
grond is offline  
Old 22 May 2020, 21:06   #12
hooverphonique
ex. demoscener "Bigmama"

 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,102
You can do conditional stuff in a makefile based on host OS.
hooverphonique is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Variable injection? solarmon support.WinUAE 12 20 January 2019 12:05
Vasm file type for cubicide? tolkien Coders. General 5 10 August 2017 11:54
Speedy. The variable speed accellerator. DDNI Hardware mods 9 18 June 2012 21:33
NTSC variable-length scanlines TheDarkCoder Coders. Asm / Hardware 3 23 November 2011 15:51
Variable Master Clock wiltshireguyuk request.UAE Wishlist 0 13 December 2004 16:40

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 22:02.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.08446 seconds with 15 queries