Merge pull request #32 from enh/master
maketab: support build systems with read-only source.
This commit is contained in:
commit
2d9034a01a
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
a.out
|
||||||
|
maketab
|
||||||
|
proctab.c
|
||||||
|
ytab.c
|
||||||
|
ytab.h
|
||||||
|
*.o
|
2
makefile
2
makefile
@ -67,7 +67,7 @@ y%.c y%.h: awk.h proto.h awkgram.y
|
|||||||
ytab.h: ytab.c
|
ytab.h: ytab.c
|
||||||
|
|
||||||
proctab.c: maketab
|
proctab.c: maketab
|
||||||
./maketab >proctab.c
|
./maketab ytab.h >proctab.c
|
||||||
|
|
||||||
maketab: ytab.h maketab.c
|
maketab: ytab.h maketab.c
|
||||||
$(CC) $(CFLAGS) maketab.c -o maketab
|
$(CC) $(CFLAGS) maketab.c -o maketab
|
||||||
|
@ -125,8 +125,12 @@ int main(int argc, char *argv[])
|
|||||||
for (i = SIZE; --i >= 0; )
|
for (i = SIZE; --i >= 0; )
|
||||||
names[i] = "";
|
names[i] = "";
|
||||||
|
|
||||||
if ((fp = fopen("ytab.h", "r")) == NULL) {
|
if (argc != 2) {
|
||||||
fprintf(stderr, "maketab can't open ytab.h!\n");
|
fprintf(stderr, "usage: maketab YTAB_H\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
if ((fp = fopen(argv[1], "r")) == NULL) {
|
||||||
|
fprintf(stderr, "maketab can't open %s!\n", argv[1]);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
printf("static char *printname[%d] = {\n", SIZE);
|
printf("static char *printname[%d] = {\n", SIZE);
|
||||||
|
Loading…
Reference in New Issue
Block a user