Move python object files to python subdirectory
authorTom Tromey <tom@tromey.com>
Tue, 21 Nov 2017 20:17:31 +0000 (13:17 -0700)
committerTom Tromey <tom@tromey.com>
Mon, 27 Nov 2017 23:53:25 +0000 (16:53 -0700)
Move the object files corresponding to python/*.c to the python
subdirectory in the build tree.

Because special CFLAGS are passed just to Python compilations, this
patch also required the addition of a pattern rule to update
INTERNAL_CFLAGS for here.

ChangeLog
2017-11-27  Tom Tromey  <tom@tromey.com>

* Makefile.in (SUBDIR_PYTHON_OBS): Redefine.
(CONFIG_SRC_SUBDIR): Add python.
(%.o): Remove python rule.
(python/%.o): New rule.
* configure: Rebuild.
* configure.ac (CONFIG_OBS): Refer to python/python.o

gdb/ChangeLog
gdb/Makefile.in
gdb/configure
gdb/configure.ac

index c91a45b8c8a5f923611630e5ea7feffef6320ca5..412720c08208fb9714dd413e680c7dbaa5d45766 100644 (file)
@@ -1,3 +1,12 @@
+2017-11-27  Tom Tromey  <tom@tromey.com>
+
+       * Makefile.in (SUBDIR_PYTHON_OBS): Redefine.
+       (CONFIG_SRC_SUBDIR): Add python.
+       (%.o): Remove python rule.
+       (python/%.o): New rule.
+       * configure: Rebuild.
+       * configure.ac (CONFIG_OBS): Refer to python/python.o
+
 2017-11-27  Tom Tromey  <tom@tromey.com>
 
        * configure: Rebuild.
index bcb34cc9ed94e6b72647c85df593b26a367c24ee..c1b2e655f04e6850bb68294b3b8ca0c1962e5220 100644 (file)
@@ -362,50 +362,6 @@ SUBDIR_GUILE_CFLAGS =
 #
 # python sub directory definitons
 #
-SUBDIR_PYTHON_OBS = \
-       py-arch.o \
-       py-auto-load.o \
-       py-block.o \
-       py-bpevent.o \
-       py-breakpoint.o \
-       py-cmd.o \
-       py-continueevent.o \
-       py-event.o \
-       py-evtregistry.o \
-       py-evts.o \
-       py-exitedevent.o \
-       py-finishbreakpoint.o \
-       py-frame.o \
-       py-framefilter.o \
-       py-function.o \
-       py-gdb-readline.o \
-       py-inferior.o \
-       py-infevents.o \
-       py-infthread.o \
-       py-instruction.o \
-       py-lazy-string.o \
-       py-linetable.o \
-       py-newobjfileevent.o \
-       py-objfile.o \
-       py-param.o \
-       py-prettyprint.o \
-       py-progspace.o \
-       py-record.o \
-       py-record-btrace.o \
-       py-record-full.o \
-       py-signalevent.o \
-       py-stopevent.o \
-       py-symbol.o \
-       py-symtab.o \
-       py-threadevent.o \
-       py-type.o \
-       py-unwind.o \
-       py-utils.o \
-       py-value.o \
-       py-varobj.o \
-       py-xmethods.o \
-       python.o
-
 SUBDIR_PYTHON_SRCS = \
        python/py-arch.c \
        python/py-auto-load.c \
@@ -450,6 +406,8 @@ SUBDIR_PYTHON_SRCS = \
        python/py-xmethods.c \
        python/python.c
 
+SUBDIR_PYTHON_OBS = $(patsubst %.c,%.o,$(SUBDIR_PYTHON_SRCS))
+
 SUBDIR_PYTHON_DEPS =
 SUBDIR_PYTHON_LDFLAGS =
 SUBDIR_PYTHON_CFLAGS =
@@ -560,7 +518,7 @@ CONFIG_INSTALL = @CONFIG_INSTALL@
 CONFIG_UNINSTALL = @CONFIG_UNINSTALL@
 HAVE_NATIVE_GCORE_TARGET = @HAVE_NATIVE_GCORE_TARGET@
 
-CONFIG_SRC_SUBDIR = arch cli mi compile tui unittests guile
+CONFIG_SRC_SUBDIR = arch cli mi compile tui unittests guile python
 CONFIG_DEP_SUBDIR = $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR))
 
 # -I. for config files.
@@ -1850,6 +1808,9 @@ all: gdb$(EXEEXT) $(CONFIG_ALL)
 $(CONFIG_DEP_SUBDIR):
        $(SHELL) $(srcdir)/../mkinstalldirs $@
 
+# Python files need special flags.
+python/%.o: INTERNAL_CFLAGS += $(PYTHON_CFLAGS)
+
 # Rules for compiling .c files in the various source subdirectories.
 %.o: ${srcdir}/common/%.c
        $(COMPILE) $<
@@ -1863,10 +1824,6 @@ $(CONFIG_DEP_SUBDIR):
        $(COMPILE) $<
        $(POSTCOMPILE)
 
-%.o: $(srcdir)/python/%.c
-       $(COMPILE) $(PYTHON_CFLAGS) $<
-       $(POSTCOMPILE)
-
 %.o: ${srcdir}/target/%.c
        $(COMPILE) $<
        $(POSTCOMPILE)
index f3e0ce6cf8bb565ffd1b0bfdf5df9dac443ec4f4..3c64bb151e99d08ef9b4568bbf7ae218b4698722 100755 (executable)
@@ -10718,7 +10718,7 @@ $as_echo "${python_has_threads}" >&6; }
 else
   # Even if Python support is not compiled in, we need to have this file
   # included so that the "python" command, et.al., still exists.
-  CONFIG_OBS="$CONFIG_OBS python.o"
+  CONFIG_OBS="$CONFIG_OBS python/python.o"
   CONFIG_SRCS="$CONFIG_SRCS python/python.c"
 fi
 
index 00a36be13cfce49baec7a71658b02eff28ec95e9..de24cfa68767306854b28ad4e1936042d9605272 100644 (file)
@@ -1027,7 +1027,7 @@ if test "${have_libpython}" != no; then
 else
   # Even if Python support is not compiled in, we need to have this file
   # included so that the "python" command, et.al., still exists.
-  CONFIG_OBS="$CONFIG_OBS python.o"
+  CONFIG_OBS="$CONFIG_OBS python/python.o"
   CONFIG_SRCS="$CONFIG_SRCS python/python.c"
 fi
 
This page took 0.0397 seconds and 4 git commands to generate.