blob: 4c103f3acabaefecae0d42e6e92de6e6c04105a0 [file] [log] [blame]
Patrick Williams0be05ee2016-12-09 14:30:45 -06001#!/bin/sh
2
Patrick Williamsad2310e2016-12-09 17:47:04 -06003cd $1
4
Patrick Williams0be05ee2016-12-09 14:30:45 -06005toplevel_dirs=xyz
6interfaces=`find $toplevel_dirs -name "*.interface.yaml"`
7
8for i in ${interfaces};
9do
10 iface_path=`dirname $i`/`basename $i .interface.yaml`
11 iface=`echo $iface_path | sed 's/\//./g'`
12 cat <<MAKEFILE
13
14${i%.interface.yaml}/server.cpp: ${i} ${i%.interface.yaml}/server.hpp
15 @mkdir -p \`dirname \$@\`
Patrick Williamse1a8f362016-12-10 07:42:08 -060016 \$(SDBUSPLUSPLUS) -r \$(srcdir) interface server-cpp ${iface} > \$@
Patrick Williams0be05ee2016-12-09 14:30:45 -060017
18${i%.interface.yaml}/server.hpp: ${i}
19 @mkdir -p \`dirname \$@\`
Patrick Williamse1a8f362016-12-10 07:42:08 -060020 \$(SDBUSPLUSPLUS) -r \$(srcdir) interface server-header ${iface} > \$@
Patrick Williams0be05ee2016-12-09 14:30:45 -060021
22MAKEFILE
23
24done
25
26echo "libphosphor_dbus_cpp_SOURCES = \\"
27for i in ${interfaces};
28do
29 echo " ${i%.interface.yaml}/server.cpp \\"
30done
31echo
32
33echo "libphosphor_dbus_hpp_SOURCES = \\"
34for i in ${interfaces};
35do
36 echo " ${i%.interface.yaml}/server.hpp \\"
37done
38echo
39
40cat << MAKEFILE
41libphosphor_dbus.cpp: \$(libphosphor_dbus_cpp_SOURCES)
42 cat \$^ > \$@
43
44nobase_include_HEADERS = \$(libphosphor_dbus_hpp_SOURCES)
45
46.PHONY: clean-dbus
47clean-dbus:
48 for i in \$(libphosphor_dbus_cpp_SOURCES) \\
49 \$(libphosphor_dbus_hpp_SOURCES); \\
50 do \\
51 test -e \$\$i && rm \$\$i ; \\
52 test -d \`dirname \$\$i\` && rmdir -p \`dirname \$\$i\` ; \\
53 true; \\
54 done
55MAKEFILE