diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a5faec4 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +strerror: strerror.c strerror.h + $(CC) $(CFLAGS) -o $@ strerror.c + +strerror.h: errlist Makefile + printf '#ifndef STRERROR_H\n#define STRERROR_H 1\n\n' > $@ + printf 'struct { int number; char *name; } errlist[] = {\n' >> $@ + awk '{printf("#ifdef %s\n\t{ %s,\t\"%s\" },\n#endif\n", $$0, $$0, $$0);}' errlist >> $@ + printf '};\n\n#endif\n' >> $@ |
