summaryrefslogtreecommitdiff
path: root/generate.make
diff options
context:
space:
mode:
Diffstat (limited to 'generate.make')
-rw-r--r--generate.make33
1 files changed, 33 insertions, 0 deletions
diff --git a/generate.make b/generate.make
new file mode 100644
index 0000000..19ff2c5
--- /dev/null
+++ b/generate.make
@@ -0,0 +1,33 @@
+SHELL=bash
+
+MKDIR_FIRST = @mkdir -p ${@D}
+SRC_DIR := $(patsubst %/,%,$(dir ${MAKEFILE_LIST}))
+PIES := $(shell cd ${SRC_DIR}; find src/ -name '*.py')
+PIES := $(filter-out src/main-gdb-%.py,${PIES})
+
+export PATH:=$(realpath ${SRC_DIR}/tools):${PATH}
+
+vpath %.cpp ${SRC_DIR}
+vpath %.hpp ${SRC_DIR}
+vpath %.tcc ${SRC_DIR}
+vpath tools/% ${SRC_DIR}
+vpath %.py ${SRC_DIR}
+
+obj/generated.stamp:
+ $(MKDIR_FIRST)
+ touch $@
+obj/generated.stamp: obj/generate-proto2.stamp
+obj/generate-proto2.stamp: tools/protocol.py
+ $(MKDIR_FIRST)
+ rm -f obj/generated.stamp
+ mkdir -p ${SRC_DIR}/src/proto2
+ cd ${SRC_DIR} && protocol.py
+ touch $@
+obj/generated.stamp: obj/generate-debug-debug.stamp
+obj/generate-debug-debug.stamp: tools/debug-debug-scripts ${PIES}
+ $(MKDIR_FIRST)
+ rm -f obj/generated.stamp
+ mkdir -p ${SRC_DIR}/src/debug-debug
+ debug-debug-scripts $(wordlist 2,$(words $^),$^) > ${SRC_DIR}/src/debug-debug/test.cpp
+ touch $@
+