|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T c
Length: 2325 (0x915)
Types: TextFile
Names: »create_makefile.l«
└─⟦8ee07855d⟧ Bits:30000545 8mm tape, Rational 1000, DTIA 2_1_6
└─⟦0c25cb74a⟧ »DATA«
└─⟦038380b96⟧
└─⟦d0624311f⟧ Bits:30000529 8mm tape, Rational 1000, DTIA 2_1_7
└─⟦f494b5154⟧ »DATA«
└─⟦038380b96⟧
└─⟦this⟧ »create_makefile.l«
%a 6000
%p 6000
%n 6000
%{
void start_inetd(),usage(),cflags(),libs();
#define TRUE (0==0)
#define FALSE (!TRUE)
static int remove = FALSE;
#define NIL 0
#define SUN 1
#define HP 2
#define AIX 3
#define APOLLO 4
#define ULTRIX 5
static int porting = NIL;
%}
%%
^.*"kill".*[\n] start_inetd(yytext);
^"# End of Makefile" exit(0);
^.*"sccs".*"clean".*[\n] ;
^"LINT".*[\n] ;
"tar*" ;
"$(LINTS"[0-9]") " ;
"$(LINTS) " ;
^"CFLAGS".* if (!remove) (void) cflags(yytext);
^"LIBS".* if (!remove) (void) libs(yytext);
^"tar".*[\n] remove = TRUE;
^"lint".*[\n] remove = TRUE;
^"create_makefile".*[\n] remove=TRUE;
^"# Do not remove or change this line. Mkmake depends on it.\n" remove = FALSE;
. if (!remove) printf("%c",*yytext);
[\n] if (!remove) printf("\n");
%%
static void usage(cmd)
char *cmd; {
fprintf(stderr,"Usage: %s {SUN | HP | AIX | ULTRIX}\n",cmd);
exit(1);
}
static void start_inetd(s)
char *s; {
char *p;
switch (porting) {
case SUN:
case APOLLO:
case ULTRIX:
printf("%s",s);
break;
case HP:
printf("\t/etc/inetd -c\n");
break;
case AIX:
for (p=s;*p;p++) {
if (*p=='-') {
p++;
if (*p=='a') {
*p++ = 'e';
*p = 'd';
}
}
}
printf("%s",s);
break;
}
}
static void cflags(s)
char *s; {
switch (porting) {
case SUN:
printf("CFLAGS=\t\t-DSUN\n");
break;
case HP:
printf("CFLAGS=\t\t-DHP\n");
break;
case AIX:
printf("CFLAGS=\t\t-DAIX\n");
break;
case APOLLO:
printf("CFLAGS=\t\t-DAPOLLO\n");
break;
case ULTRIX:
printf("CFLAGS=\t\t-DSUN\n");
break;
}
}
static void libs(s)
char *s; {
switch (porting) {
case SUN:
printf("%s",yytext);
break;
case HP:
printf("LIBS=\t\t-lrpcsvc -lBSD\n");
break;
case AIX:
printf("LIBS=\t\t-lrpcsvc\n");
break;
case APOLLO:
printf("%s",yytext);
break;
case ULTRIX:
printf("%s",yytext);
break;
}
}
main(argc,argv)
int argc;
char **argv; {
if (argc != 2) usage(argv[0]);
if (strcmp(argv[1],"SUN") == 0) porting = SUN;
else if (strcmp(argv[1],"HP") == 0) porting = HP;
else if (strcmp(argv[1],"AIX") == 0) porting = AIX;
else if (strcmp(argv[1],"APOLLO") == 0) porting = APOLLO;
else if (strcmp(argv[1],"ULTRIX") == 0) porting = ULTRIX;
else porting = NIL;
if (porting == NIL) usage();
yylex();
exit(0);
}