* texinfo.tex (\acronym): New Texinfo command.
[make.git] / amiga.c
bloba163781720aae99ebac49c2606e413a06499cdd8
1 /* Running commands on Amiga
2 Copyright (C) 1995, 1996 Free Software Foundation, Inc.
3 This file is part of GNU Make.
5 GNU Make is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
10 GNU Make is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNU Make; see the file COPYING. If not, write to
17 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19 #include "make.h"
20 #include "variable.h"
21 #include "amiga.h"
22 #include <assert.h>
23 #include <exec/memory.h>
24 #include <dos/dostags.h>
25 #include <proto/exec.h>
26 #include <proto/dos.h>
28 static const char Amiga_version[] = "$VER: Make 3.74.3 (12.05.96) \n"
29 "Amiga Port by A. Digulla (digulla@home.lake.de)";
31 int
32 MyExecute (argv)
33 char ** argv;
35 char * buffer, * ptr;
36 char ** aptr;
37 int len = 0;
38 int status;
40 for (aptr=argv; *aptr; aptr++)
42 len += strlen (*aptr) + 4;
45 buffer = AllocMem (len, MEMF_ANY);
47 if (!buffer)
48 fatal ("MyExecute: Cannot allocate space for calling a command");
50 ptr = buffer;
52 for (aptr=argv; *aptr; aptr++)
54 if (((*aptr)[0] == ';' && !(*aptr)[1]))
56 *ptr ++ = '"';
57 strcpy (ptr, *aptr);
58 ptr += strlen (ptr);
59 *ptr ++ = '"';
61 else if ((*aptr)[0] == '@' && (*aptr)[1] == '@' && !(*aptr)[2])
63 *ptr ++ = '\n';
64 continue;
66 else
68 strcpy (ptr, *aptr);
69 ptr += strlen (ptr);
71 *ptr ++ = ' ';
72 *ptr = 0;
75 ptr[-1] = '\n';
77 status = SystemTags (buffer,
78 SYS_UserShell, TRUE,
79 TAG_END);
81 FreeMem (buffer, len);
83 if (SetSignal(0L,0L) & SIGBREAKF_CTRL_C)
84 status = 20;
86 /* Warnings don't count */
87 if (status == 5)
88 status = 0;
90 return status;
93 char *
94 wildcard_expansion (wc, o)
95 char * wc, * o;
97 # define PATH_SIZE 1024
98 struct AnchorPath * apath;
100 if ( (apath = AllocMem (sizeof (struct AnchorPath) + PATH_SIZE,
101 MEMF_CLEAR))
104 apath->ap_Strlen = PATH_SIZE;
106 if (MatchFirst (wc, apath) == 0)
110 o = variable_buffer_output (o, apath->ap_Buf,
111 strlen (apath->ap_Buf));
112 o = variable_buffer_output (o, " ",1);
113 } while (MatchNext (apath) == 0);
116 MatchEnd (apath);
117 FreeMem (apath, sizeof (struct AnchorPath) + PATH_SIZE);
120 return o;