From patchwork Tue Nov 21 22:10:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 24423 Received: (qmail 40839 invoked by alias); 21 Nov 2017 22:10:35 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 40765 invoked by uid 89); 21 Nov 2017 22:10:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KB_WAM_FROM_NAME_SINGLEWORD, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=guile, HX-HELO:sk:gateway, 4038, SHELL X-HELO: gateway30.websitewelcome.com Received: from gateway30.websitewelcome.com (HELO gateway30.websitewelcome.com) (192.185.193.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Nov 2017 22:10:29 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway30.websitewelcome.com (Postfix) with ESMTP id D528B13F20 for ; Tue, 21 Nov 2017 16:10:27 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id HGkNeexlNpOTvHGkNeLbYk; Tue, 21 Nov 2017 16:10:27 -0600 Received: from 71-218-90-63.hlrn.qwest.net ([71.218.90.63]:35604 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1eHGkN-0048Hi-LO; Tue, 21 Nov 2017 16:10:27 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 08/13] Move python object files to python subdirectory Date: Tue, 21 Nov 2017 15:10:18 -0700 Message-Id: <20171121221023.23992-9-tom@tromey.com> In-Reply-To: <20171121221023.23992-1-tom@tromey.com> References: <20171121221023.23992-1-tom@tromey.com> X-BWhitelist: no X-Source-L: No X-Exim-ID: 1eHGkN-0048Hi-LO X-Source-Sender: 71-218-90-63.hlrn.qwest.net (bapiya.Home) [71.218.90.63]:35604 X-Source-Auth: tom+tromey.com X-Email-Count: 9 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes 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-21 Tom Tromey * 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 | 9 +++++++++ gdb/Makefile.in | 55 ++++++------------------------------------------------- gdb/configure | 2 +- gdb/configure.ac | 2 +- 4 files changed, 17 insertions(+), 51 deletions(-) diff --git a/gdb/Makefile.in b/gdb/Makefile.in index aab3a38588..93d819e11d 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -359,50 +359,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 \ @@ -447,6 +403,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 = @@ -556,7 +514,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. @@ -1844,6 +1802,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) $< @@ -1857,10 +1818,6 @@ $(CONFIG_DEP_SUBDIR): $(COMPILE) $< $(POSTCOMPILE) -%.o: $(srcdir)/python/%.c - $(COMPILE) $(PYTHON_CFLAGS) $< - $(POSTCOMPILE) - %.o: ${srcdir}/target/%.c $(COMPILE) $< $(POSTCOMPILE) diff --git a/gdb/configure b/gdb/configure index e5a5b7c34f..2c24ed4034 100755 --- a/gdb/configure +++ b/gdb/configure @@ -10219,7 +10219,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 diff --git a/gdb/configure.ac b/gdb/configure.ac index b9d456bc7c..3799278cdf 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1005,7 +1005,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