scripts/gdb: provide linux constants
[linux-2.6-block.git] / scripts / gdb / linux / Makefile
index 6cf1ecf610579e692075251d3f7cf52806c559b4..cd129e65d1ffdbbb06e6f1096340e00f1cff8d9e 100644 (file)
@@ -8,4 +8,14 @@ ifneq ($(KBUILD_SRC),)
 endif
        @:
 
-clean-files := *.pyc *.pyo $(if $(KBUILD_SRC),*.py)
+quiet_cmd_gen_constants_py = GEN     $@
+      cmd_gen_constants_py = \
+       $(CPP) -E -x c -P $(c_flags) $< > $@ ;\
+       sed -i '1,/<!-- end-c-headers -->/d;' $@
+
+$(obj)/constants.py: $(SRCTREE)/$(obj)/constants.py.in
+       $(call if_changed,gen_constants_py)
+
+build_constants_py: $(obj)/constants.py
+
+clean-files := *.pyc *.pyo $(if $(KBUILD_SRC),*.py) $(obj)/constants.py