From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 4C7163895445; Tue, 26 May 2020 08:20:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C7163895445 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: revamp localtime.o build rule X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: 49a843b407d234ea588378196aac20eefc2a587a X-Git-Newrev: 4d5efe1e1d3dc7672934efce1bdc9151e7cd307d Message-Id: <20200526082054.4C7163895445@sourceware.org> Date: Tue, 26 May 2020 08:20:54 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 May 2020 08:20:54 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=4d5efe1e1d3dc7672934efce1bdc9151e7cd307d commit 4d5efe1e1d3dc7672934efce1bdc9151e7cd307d Author: Corinna Vinschen Date: Mon May 25 17:40:27 2020 +0200 Cygwin: revamp localtime.o build rule Rename localtime.c.patched to localtime.patched.c to keep the correct language suffix. Create localtime.patched.c in the build dir rather than in the source dir. Decouple the build rule for creating localtime.patched.c from the rule to build localtime.o, so we don't have to rebuild the patched source file all the time. Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/Makefile.in | 11 +++++++---- winsup/cygwin/tzcode/localtime_wrapper.c | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in index 1801b1a11..3a175c61c 100644 --- a/winsup/cygwin/Makefile.in +++ b/winsup/cygwin/Makefile.in @@ -670,7 +670,7 @@ uninstall-man: done clean distclean realclean: - -rm -f *.o *.dll *.dbg *.a *.exp junk *.base version.cc *.exe *.d *stamp* *_magic.h sigfe.s cygwin.def globals.h + -rm -f *.o *.dll *.dbg *.a *.exp junk *.base version.cc *.exe *.d *stamp* *_magic.h sigfe.s cygwin.def globals.h localtime.patched.c -@$(MAKE) -C ${cygserver_blddir} libclean maintainer-clean: clean @@ -734,9 +734,12 @@ dcrt0.o sigproc.o: child_info_magic.h shared.o: shared_info_magic.h -localtime.o: $(srcdir)/tzcode/localtime_wrapper.c $(srcdir)/tzcode/localtime.c.patch - (cd $(srcdir)/tzcode && \ - patch -u -o localtime.c.patched localtime.c localtime.c.patch) +localtime.patched.c: tzcode/localtime.c tzcode/localtime.c.patch + patch -u -o localtime.patched.c \ + $(srcdir)/tzcode/localtime.c \ + $(srcdir)/tzcode/localtime.c.patch + +localtime.o: tzcode/localtime_wrapper.c localtime.patched.c $(CC) ${COMMON_CFLAGS} ${localtime_CFLAGS} \ -I$(target_builddir)/winsup/cygwin \ -I$(srcdir) -I$(srcdir)/tzcode -c -o $@ $< diff --git a/winsup/cygwin/tzcode/localtime_wrapper.c b/winsup/cygwin/tzcode/localtime_wrapper.c index 72e2f93ab..1c7cd928d 100644 --- a/winsup/cygwin/tzcode/localtime_wrapper.c +++ b/winsup/cygwin/tzcode/localtime_wrapper.c @@ -122,7 +122,7 @@ tzgetwintzi (char *wildabbr, char *outbuf) (2) add conditional call to Cygwin's tzgetwintzi() from tzsetlcl() (3) add Cygwin's historical "posixrules" support to tzloadbody() */ -#include "localtime.c.patched" +#include "localtime.patched.c" // Don't forget these Cygwin-specific additions from this point to EOF EXPORT_ALIAS (tzset_unlocked, _tzset_unlocked)