Run AmigaDOS commands in a makefile

Have a question about our Software Developer Kit? Ask them here.
Post Reply
corto
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 40
Joined: Sun Jun 19, 2011 8:53 am

Run AmigaDOS commands in a makefile

Post by corto »

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).
xenic
Posts: 1185
Joined: Sun Jun 19, 2011 12:06 am

Re: Run AmigaDOS commands in a makefile

Post by xenic »

@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
corto
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 40
Joined: Sun Jun 19, 2011 8:53 am

Re: Run AmigaDOS commands in a makefile

Post by corto »

@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.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: Run AmigaDOS commands in a makefile

Post by broadblues »

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.
Post Reply