1 /* Running commands on Amiga
2 Copyright (C) 1995-2013 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 it under the
6 terms of the GNU General Public License as published by the Free Software
7 Foundation; either version 3 of the License, or (at your option) any later
10 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License along with
15 this program. If not, see <http://www.gnu.org/licenses/>. */
21 #include <exec/memory.h>
22 #include <dos/dostags.h>
23 #include <proto/exec.h>
24 #include <proto/dos.h>
26 static const char Amiga_version[] = "$VER: Make 3.74.3 (12.05.96) \n"
27 "Amiga Port by A. Digulla (digulla@home.lake.de)";
30 MyExecute (char **argv)
37 for (aptr=argv; *aptr; aptr++)
39 len += strlen (*aptr) + 4;
42 buffer = AllocMem (len, MEMF_ANY);
45 fatal (NILF, "MyExecute: Cannot allocate space for calling a command");
49 for (aptr=argv; *aptr; aptr++)
51 if (((*aptr)[0] == ';' && !(*aptr)[1]))
58 else if ((*aptr)[0] == '@' && (*aptr)[1] == '@' && !(*aptr)[2])
74 status = SystemTags (buffer,
78 FreeMem (buffer, len);
80 if (SetSignal (0L,0L) & SIGBREAKF_CTRL_C)
83 /* Warnings don't count */
91 wildcard_expansion (char *wc, char *o)
93 # define PATH_SIZE 1024
94 struct AnchorPath * apath;
96 if ( (apath = AllocMem (sizeof (struct AnchorPath) + PATH_SIZE,
100 apath->ap_Strlen = PATH_SIZE;
102 if (MatchFirst (wc, apath) == 0)
106 o = variable_buffer_output (o, apath->ap_Buf,
107 strlen (apath->ap_Buf));
108 o = variable_buffer_output (o, " ",1);
109 } while (MatchNext (apath) == 0);
113 FreeMem (apath, sizeof (struct AnchorPath) + PATH_SIZE);