Patrick Williams | 0be05ee | 2016-12-09 14:30:45 -0600 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Patrick Williams | ad2310e | 2016-12-09 17:47:04 -0600 | [diff] [blame] | 3 | cd $1 |
| 4 | |
Patrick Williams | 0be05ee | 2016-12-09 14:30:45 -0600 | [diff] [blame] | 5 | toplevel_dirs=xyz |
| 6 | interfaces=`find $toplevel_dirs -name "*.interface.yaml"` |
| 7 | |
| 8 | for i in ${interfaces}; |
| 9 | do |
| 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 Williams | e1a8f36 | 2016-12-10 07:42:08 -0600 | [diff] [blame] | 16 | \$(SDBUSPLUSPLUS) -r \$(srcdir) interface server-cpp ${iface} > \$@ |
Patrick Williams | 0be05ee | 2016-12-09 14:30:45 -0600 | [diff] [blame] | 17 | |
| 18 | ${i%.interface.yaml}/server.hpp: ${i} |
| 19 | @mkdir -p \`dirname \$@\` |
Patrick Williams | e1a8f36 | 2016-12-10 07:42:08 -0600 | [diff] [blame] | 20 | \$(SDBUSPLUSPLUS) -r \$(srcdir) interface server-header ${iface} > \$@ |
Patrick Williams | 0be05ee | 2016-12-09 14:30:45 -0600 | [diff] [blame] | 21 | |
| 22 | MAKEFILE |
| 23 | |
| 24 | done |
| 25 | |
| 26 | echo "libphosphor_dbus_cpp_SOURCES = \\" |
| 27 | for i in ${interfaces}; |
| 28 | do |
| 29 | echo " ${i%.interface.yaml}/server.cpp \\" |
| 30 | done |
| 31 | echo |
| 32 | |
| 33 | echo "libphosphor_dbus_hpp_SOURCES = \\" |
| 34 | for i in ${interfaces}; |
| 35 | do |
| 36 | echo " ${i%.interface.yaml}/server.hpp \\" |
| 37 | done |
| 38 | echo |
| 39 | |
| 40 | cat << MAKEFILE |
| 41 | libphosphor_dbus.cpp: \$(libphosphor_dbus_cpp_SOURCES) |
| 42 | cat \$^ > \$@ |
| 43 | |
| 44 | nobase_include_HEADERS = \$(libphosphor_dbus_hpp_SOURCES) |
| 45 | |
| 46 | .PHONY: clean-dbus |
| 47 | clean-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 |
| 55 | MAKEFILE |