update source to use our brand new source generator. Update automakes.
[apps/madmutt.git] / tools / cpkg2c.mk
diff --git a/tools/cpkg2c.mk b/tools/cpkg2c.mk
new file mode 100644 (file)
index 0000000..66660fd
--- /dev/null
@@ -0,0 +1,9 @@
+%.c: %.cpkg $(top_builddir)/tools/cpkg2c
+       $(top_builddir)/tools/cpkg2c -c $< > $@ || (rm -f $@; exit 1)
+
+%.li: %.cpkg $(top_builddir)/tools/cpkg2c
+       $(top_builddir)/tools/cpkg2c -h $< > $@ || (rm -f $@; exit 1)
+
+$(top_builddir)/tools/cpkg2c:
+       $(MAKE) -C $(@D) $(@F)
+