Run AmigaDOS commands in a makefile

Have a question about our Software Developer Kit? Ask them here.

Run AmigaDOS commands in a makefile

Postby corto » Mon Jun 27, 2011 6:37 pm

I was trying to run some AmigaDOS commands ("if exists foo") a makefile and I found almost nothing about that. Then I found the article on gnumake by Steven, so I tried a simple example using @@ :
Code: Select all
all:
   if exists foo @@
      echo "foo exists" @@
   else @@
      echo "foo does not exist" @@
   endif


That doesn't work and I have an error :
if exists foo @@
IF: ELSE or ENDINF missing
if : error code 10


I use make 3.81 from the last SDK (53.20 I suppose ... by the way, I am not sure there is the version number somewhere once the SDK is installed).
corto
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 33
Joined: Sun Jun 19, 2011 9:53 am

Re: Run AmigaDOS commands in a makefile

Postby xenic » Sun Jul 03, 2011 4:42 am

@corto
One of my makefiles uses @@ in a similar way but right now I don't have time for a recompile to see if it still works. There is one extra thing in my makefile; it has a backslash after the @@ like this:
@if exists ${ARCHIVE_BASE} @@\
delete ${ARCHIVE_BASE} @@\
endif
AmigaOne X1000 with 2GB memory - OS4.1 FE
xenic
 
Posts: 1057
Joined: Sun Jun 19, 2011 1:06 am

Re: Run AmigaDOS commands in a makefile

Postby corto » Thu Jul 14, 2011 8:47 am

@xenic
Thanks, it works with a backslash at the end of the line. I don't know why I didn't test like that (I tried the backslash without @@). I was focusing on the sonix release.

@ssolie
You should update the example in your article according to the fact the backslash is required.
corto
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 33
Joined: Sun Jun 19, 2011 9:53 am

Re: Run AmigaDOS commands in a makefile

Postby broadblues » Thu Jul 14, 2011 2:26 pm

It's probably a good idea to email ssolie directly about the 'error' in his article rather than hope he'll read your post here. There contact info n the page you linked to.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 484
Joined: Sat Jun 18, 2011 3:40 am
Location: Portsmouth, UK


Return to SDK Support

Who is online

Users browsing this forum: No registered users and 1 guest