Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3b2da54

Browse files
committed
For automatic dependency tracking, replace our sed hackery with the GCC-
-built-in mechanism through the -MP flag. Adjust the file extensions tolook more like Automake practice. This frees up the .d suffix for use byDTrace.
1 parent0144eb9 commit3b2da54

File tree

1 file changed

+5
-27
lines changed

1 file changed

+5
-27
lines changed

‎src/Makefile.global.in

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*-makefile-*-
2-
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.223 2006/07/20 09:30:18 petere Exp $
2+
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.224 2006/07/21 22:37:37 petere Exp $
33

44
#------------------------------------------------------------------------------
55
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -511,17 +511,6 @@ install-strip:
511511
# Next time we invoke make we will have top-notch information about
512512
# whether this file needs to be updated. The dependency files are kept
513513
# in the .deps subdirectory of each directory.
514-
#
515-
# The sed command is necessary to post-process the dependency file:
516-
# Each dependency file becomes a target of its own, without
517-
# dependencies or commands. This is because if you happen to remove a
518-
# file that is a dependency (say, you rename a header file) the
519-
# dependency would point to a non-existing file and make would fail.
520-
# But if the file is listed as a target of its own, without
521-
# prerequisites and commands, and doesn't exist then make will
522-
# consider it updated. (That in turn also has the nice side effect
523-
# that make will update all files that depended on the now removed
524-
# file.)
525514

526515
autodepend = @autodepend@
527516

@@ -532,38 +521,27 @@ COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
532521
endif
533522

534523
DEPDIR = .deps
535-
df =$(DEPDIR)/$(*F)
536-
537-
# This converts a .d file in the current directory to a .P file in the .deps
538-
# subdirectory, with the dummy targets as explained above.
539-
definepostprocess-depend
540-
@if test ! -d$(DEPDIR); then mkdir -p$(DEPDIR); fi
541-
@cp$*.d$(df).P
542-
@sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//'\
543-
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $(df).P
544-
@rm -f$*.d
545-
endef
546524

547525
ifeq ($(GCC), yes)
548526

549527
# GCC allows us to create object and dependency file in one invocation.
550528
%.o :%.c
551-
$(COMPILE.c) -o$@$< -MMD
552-
$(postprocess-depend)
529+
@iftest! -d$(DEPDIR);then mkdir -p$(DEPDIR);fi
530+
$(COMPILE.c) -o$@$< -MMD -MP -MF$(DEPDIR)/$(*F).Po
553531

554532
endif# GCC
555533

556534
# Include all the dependency files generated for the current
557535
# directory. List /dev/null as dummy because if the wildcard expands
558536
# to nothing then make would complain.
559-
-include$(wildcard$(DEPDIR)/*.P) /dev/null
537+
-include$(wildcard$(DEPDIR)/*.Po) /dev/null
560538

561539
# hook for clean-up
562540
cleandistcleanmaintainer-clean: clean-deps
563541

564542
.PHONY: clean-deps
565543
clean-deps:
566-
@rm -rf$(DEPDIR)*.d
544+
@rm -rf$(DEPDIR)
567545

568546
endif# autodepend
569547

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp