summaryrefslogtreecommitdiff
path: root/Makefile
blob: a5faec4f48abd1bcd32f8ab11e6c473feec5883b (plain)
1
2
3
4
5
6
7
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' >> $@