-$(srcdir)/lib/ofp-errors.c: \
- include/openflow/openflow.h include/openflow/nicira-ext.h \
- build-aux/extract-ofp-errors
- cd $(srcdir)/include && \
- $(PYTHON) ../build-aux/extract-ofp-errors \
- openflow/openflow.h openflow/nicira-ext.h > ../lib/ofp-errors.c
-EXTRA_DIST += build-aux/extract-ofp-errors
+$(srcdir)/lib/ofp-errors.inc: \
+ lib/ofp-errors.h $(srcdir)/build-aux/extract-ofp-errors
+ $(run_python) $(srcdir)/build-aux/extract-ofp-errors \
+ $(srcdir)/lib/ofp-errors.h > $@.tmp && mv $@.tmp $@
+$(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
+EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
+
+$(srcdir)/lib/ofp-msgs.inc: \
+ lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
+ $(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
+ $(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
+$(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
+EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc