| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | WAMAKE 1.0: source code |
* Copied (from: c_echo) by Tom Torfs using timEd/2 1.10+.
Hello All!
/*
Watcom C/C++ Automated MAKE Utility v1.0.
Written by Tom Torfs. Donated to the public domain.
Last update: August 6th, 1996.
*/
#ifndef __WATCOMC__
#error You need Watcom C to compile WAMAKE.C.
#endif
#include
#include
#include
#include
enum {DOS,DOS4G,OS2,OS2V2,NUMTARGETS};
const char *targetname[NUMTARGETS]
= {"DOS","DOS4G","OS2","OS2V2"};
const char *targetdefine[NUMTARGETS]
= {"","__DOS__","","__OS2__"};
const char *wasm[NUMTARGETS]
= {"WASM","WASM","WASM","WASM"};
const char *wcc[NUMTARGETS]
= {"WCC","WCC386","WCC","WCC386"};
const char *wpp[NUMTARGETS]
= {"WPP","WPP386","WPP","WPP386"};
const char *wlink[NUMTARGETS]
= {"WLINK","WLINK","WLINK","WLINK"};
const char linkfile[] = "~WAMAKE~.LNK";
static char configfile[_MAX_PATH] = "WAMAKE.WAM";
static char drive[_MAX_DRIVE],dir[_MAX_DIR],fname[_MAX_FNAME],ext[_MAX_EXT];
static char wccopt[128],wasmopt[128];
static char buf[256];
static char exename[_MAX_PATH]="",srcname[_MAX_PATH],objname[_MAX_PATH];
int main(int argc, char *argv[])
{
FILE *fp,*linkf;
struct find_t ffblk;
unsigned short srcdate,srctime,objdate,objtime;
int len;
int relink = 0, nolink = 0, forced;
int target
#ifdef __OS2__
= OS2;
#else
= DOS;
#endif
puts("Watcom C/C++ Automated MAKE Utility v1.0 - by Tom Torfs\n");
if (argc>2 || (argc==2 && strchr(argv[1],'?')!=NULL))
{
puts("Usage: WAMAKE [.WAM]\n\n"
"Read WAMAKE.DOC for more information.");
return EXIT_FAILURE;
}
if (argc>1)
{
_fullpath(configfile,argv[1],_MAX_PATH);
strupr(configfile);
_splitpath(configfile,drive,dir,fname,ext);
if (ext[0]=='\0')
_makepath(configfile,drive,dir,fname,".WAM");
}
if ((fp=fopen(configfile,"r"))==NULL)
{
printf("Error: can't read %s\n",configfile);
return EXIT_FAILURE;
}
if ((linkf=fopen(linkfile,"w"))==NULL)
{
printf("Error: can't create temporary file %s\n",linkfile);
fclose(fp);
return EXIT_FAILURE;
}
while (1)
{
fgets(buf,256,fp);
if (feof(fp))
break;
len = strlen(buf);
while (len>0 && isspace(buf[len-1]))
buf[--len] = '\0';
while (isspace(buf[0]))
memmove(buf,buf+1,len--);
if (len==0 || buf[0]==';')
continue;
if (buf[0]=='.' && isalpha(buf[1]))
{
if (memicmp(buf,".target ",8)==0)
{
for (target=0; target * Origin: 80X86 BBS 32-15-24.62.32 V.34/V.FC (24h/24h) (2:292/516)SEEN-BY: 50/99 270/101 620/243 625/100 711/401 409 410 413 430 808 809 934 SEEN-BY: 711/955 712/407 515 624 628 713/888 800/1 @PATH: 292/516 506 850 876 270/101 712/515 711/808 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.