]> git.tuebingen.mpg.de Git - osl.git/blobdiff - Makefile
Generate osl.h from osl.h.in.
[osl.git] / Makefile
index 70b83c70f9055846cd07aa7ddcc331fbf62e9497..4e8b48e8aedfc673f7c97a2566b0909272c5dad8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -57,5 +57,15 @@ Makefile.deps: $(wildcard *.c *.h)
 $(dso_filename): $(objects)
        $(CC) $(dso_opts) -o $@ $(objects) -lcrypto
 
+osl_errors.h: errlist
+       sed -e 's/\([A-Z_]*\)   .*/     E_OSL_\1/' \
+               -e '1s/^/enum osl_errors {\n/1' \
+               -e '$$!s/$$/,/g' \
+               -e '$$s/$$/\n};/1' $< > $@
+
+errtab.h: errlist
+       sed -e 's/^\([A-Z_]*\)\s*\(.*\)/_S(E_OSL_\1, \2)/g' $< > $@
+osl.h: osl.h.in osl_errors.h
+       cat $^ > $@
 clean:
-       rm -f *.o $(dso_filename)
+       rm -f *.o $(dso_filename) osl.h osl_errors.h errtab.h