1 /* Running commands on Amiga
2 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3 2005, 2006, 2007 Free Software Foundation, Inc.
4 This file is part of GNU Make.
6 GNU Make is free software; you can redistribute it and/or modify it under the
7 terms of the GNU General Public License as published by the Free Software
8 Foundation; either version 3 of the License, or (at your option) any later
11 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License along with
16 this program. If not, see <http://www.gnu.org/licenses/>. */
22 #include <exec/memory.h>
23 #include <dos/dostags.h>
24 #include <proto/exec.h>
25 #include <proto/dos.h>
27 static const char Amiga_version
[] = "$VER: Make 3.74.3 (12.05.96) \n"
28 "Amiga Port by A. Digulla (digulla@home.lake.de)";
31 MyExecute (char **argv
)
38 for (aptr
=argv
; *aptr
; aptr
++)
40 len
+= strlen (*aptr
) + 4;
43 buffer
= AllocMem (len
, MEMF_ANY
);
46 fatal (NILF
, "MyExecute: Cannot allocate space for calling a command");
50 for (aptr
=argv
; *aptr
; aptr
++)
52 if (((*aptr
)[0] == ';' && !(*aptr
)[1]))
59 else if ((*aptr
)[0] == '@' && (*aptr
)[1] == '@' && !(*aptr
)[2])
75 status
= SystemTags (buffer
,
79 FreeMem (buffer
, len
);
81 if (SetSignal(0L,0L) & SIGBREAKF_CTRL_C
)
84 /* Warnings don't count */
92 wildcard_expansion (char *wc
, char *o
)
94 # define PATH_SIZE 1024
95 struct AnchorPath
* apath
;
97 if ( (apath
= AllocMem (sizeof (struct AnchorPath
) + PATH_SIZE
,
101 apath
->ap_Strlen
= PATH_SIZE
;
103 if (MatchFirst (wc
, apath
) == 0)
107 o
= variable_buffer_output (o
, apath
->ap_Buf
,
108 strlen (apath
->ap_Buf
));
109 o
= variable_buffer_output (o
, " ",1);
110 } while (MatchNext (apath
) == 0);
114 FreeMem (apath
, sizeof (struct AnchorPath
) + PATH_SIZE
);