1 ############################################################
5 # in case there is no default target (very unlikely)
10 ##############################
11 # dependency generation
14 depend:: depend-postrecurse
15 depend-postrecurse: depend-recurse
16 depend-recurse: depend-prerecurse
21 depend-postrecurse: depend-update-makefile
23 ALL_DEP_SRCS= $(SRCS) $(EXTRADEPSRCS)
25 # be sure to check ALL_DEP_SRCS against *what it would be if SRCS and
26 # EXTRADEPSRCS are both empty*
27 $(BUILDTOP)/.depend-verify-srcdir:
28 @if test "$(srcdir)" = "." ; then \
29 echo 1>&2 error: cannot build dependencies with srcdir=. ; \
30 echo 1>&2 "(can't distinguish generated files from source files)" ; \
31 echo 1>&2 "Run 'make distclean' and create a separate build dir" ; \
33 elif test -f "$(top_srcdir)/include/autoconf.h"; then \
34 echo 1>&2 "error: generated headers found in source tree" ; \
35 echo 1>&2 "Run 'make distclean' in source tree first" ; \
38 if test -r $(BUILDTOP)/.depend-verify-srcdir; then :; \
39 else (set -x; touch $(BUILDTOP)/.depend-verify-srcdir); fi \
41 $(BUILDTOP)/.depend-verify-et: depend-verify-et-$(COM_ERR_VERSION)
43 @if test -r $(BUILDTOP)/.depend-verify-et; then :; \
44 else (set -x; touch $(BUILDTOP)/.depend-verify-et); fi
45 depend-verify-et-sys depend-verify-et-intlsys:
46 @echo 1>&2 error: cannot build dependencies using system et package
48 $(BUILDTOP)/.depend-verify-ss: depend-verify-ss-$(SS_VERSION)
50 @if test -r $(BUILDTOP)/.depend-verify-ss; then :; \
51 else (set -x; touch $(BUILDTOP)/.depend-verify-ss); fi
53 @echo 1>&2 error: cannot build dependencies using system ss package
55 $(BUILDTOP)/.depend-verify-gcc: depend-verify-gcc-@HAVE_GCC@
56 depend-verify-gcc-yes:
57 @if test -r $(BUILDTOP)/.depend-verify-gcc; then :; \
58 else (set -x; touch $(BUILDTOP)/.depend-verify-gcc); fi
60 @echo 1>&2 error: The '"depend"' rules are written for gcc.
61 @echo 1>&2 Please use gcc, or update the rules to handle your compiler.
64 DEP_CFG_VERIFY = $(BUILDTOP)/.depend-verify-srcdir \
65 $(BUILDTOP)/.depend-verify-et $(BUILDTOP)/.depend-verify-ss
66 DEP_VERIFY = $(DEP_CFG_VERIFY) $(BUILDTOP)/.depend-verify-gcc
68 .d: $(ALL_DEP_SRCS) $(DEP_CFG_VERIFY) depend-dependencies
69 if test "$(ALL_DEP_SRCS)" != " " ; then \
70 $(RM) .dtmp && $(MAKE) .dtmp && mv -f .dtmp .d ; \
75 # These are dependencies of the depend target that do not get fed to
76 # the compiler. Examples include generated header files.
79 # .dtmp must *always* be out of date so that $? can be used to perform
80 # VPATH searches on the sources.
82 # NOTE: This will fail when using Make programs whose VPATH support is
84 .dtmp: $(ALL_DEP_SRCS)
85 $(CC) -M -DDEPEND $(ALL_CFLAGS) $? > .dtmp
87 # NOTE: This will also generate spurious $(OUTPRE) and $(OBJEXT)
88 # references in rules for non-library objects in a directory where
89 # library objects happen to be built. It's mostly harmless.
90 .depend: .d $(top_srcdir)/util/depfix.pl
91 perl $(top_srcdir)/util/depfix.pl '$(top_srcdir)' '$(mydir)' \
92 '$(srcdir)' '$(BUILDTOP)' '$(STLIBOBJS)' < .d > .depend
94 # Temporarily keep the rule for removing the dependency line eater
95 # until we're sure we've gotten everything converted and excised the
96 # old stuff from Makefile.in files.
97 depend-update-makefile: .depend depend-recurse
98 if test "$(ALL_DEP_SRCS)" != " " ; then \
99 $(CP) .depend $(srcdir)/deps.new ; \
101 echo "# No dependencies here." > $(srcdir)/deps.new ; \
103 $(top_srcdir)/config/move-if-changed $(srcdir)/deps.new $(srcdir)/deps
104 sed -e '/^# +++ Dependency line eater +++/,$$d' \
105 < $(srcdir)/Makefile.in > $(srcdir)/Makefile.in.new
106 $(top_srcdir)/config/move-if-changed $(srcdir)/Makefile.in.new \
107 $(srcdir)/Makefile.in
109 DEPTARGETS = .depend .d .dtmp $(DEP_VERIFY)
110 DEPTARGETS_CLEAN = .depend .d .dtmp $(DEPTARGETS_@srcdir@_@CONFIG_RELTOPDIR@)
111 DEPTARGETS_@top_srcdir@_. = $(DEP_VERIFY)
113 # Clear out dependencies. Should only be used temporarily, e.g., while
114 # moving or renaming headers and then rebuilding dependencies.
115 undepend:: undepend-postrecurse
117 undepend-postrecurse: undepend-recurse
118 if test -n "$(SRCS)" ; then \
119 sed -e '/^# +++ Dependency line eater +++/,$$d' \
120 < $(srcdir)/Makefile.in \
121 > $(srcdir)/Makefile.in.new ;\
122 echo "# +++ Dependency line eater +++" >> $(srcdir)/Makefile.in.new ;\
123 echo "# (dependencies temporarily removed)" >> $(srcdir)/Makefile.in.new ;\
124 $(top_srcdir)/config/move-if-changed $(srcdir)/Makefile.in.new $(srcdir)/Makefile.in;\
128 # end dependency generation
129 ##############################
132 check-unix:: check-pytests-@HAVE_PYTHON@
134 # Makefile.in should add rules to check-pytests to execute Python tests.
135 check-pytests-yes:: check-pytests
139 clean:: clean-$(WHAT)
142 $(RM) $(OBJS) $(DEPTARGETS_CLEAN) $(EXTRA_FILES)
143 $(RM) et-[ch]-*.et et-[ch]-*.[ch] testlog
144 -$(RM) -r $(top_srcdir)/autom4te.cache testdir
150 distclean:: distclean-$(WHAT)
152 distclean-normal-clean:
153 $(MAKE) NORECURSE=true clean
154 distclean-prerecurse: distclean-normal-clean
155 distclean-nuke-configure-state:
156 $(RM) config.log config.cache config.status Makefile
157 distclean-postrecurse: distclean-nuke-configure-state
159 Makefiles-prerecurse: Makefile
161 # mydir = relative path from top to this Makefile
162 Makefile: $(srcdir)/Makefile.in $(srcdir)/deps $(BUILDTOP)/config.status \
163 $(top_srcdir)/config/pre.in $(top_srcdir)/config/post.in
164 cd $(BUILDTOP) && $(SHELL) config.status $(mydir)/Makefile
165 $(BUILDTOP)/config.status: $(top_srcdir)/configure
166 cd $(BUILDTOP) && $(SHELL) config.status --recheck
167 # autom4te.cache supposedly improves performance with multiple runs, but
168 # it breaks across versions, and around MIT we've got plenty of version
169 # mixing. So nuke it.
170 $(top_srcdir)/configure: @MAINT@ \
171 $(top_srcdir)/configure.in \
172 $(top_srcdir)/patchlevel.h \
173 $(top_srcdir)/aclocal.m4
174 -$(RM) -r $(top_srcdir)/autom4te.cache
175 cd $(top_srcdir) && \
176 $(AUTOCONF) --include=$(CONFIG_RELTOPDIR) $(AUTOCONFFLAGS)
177 -$(RM) -r $(top_srcdir)/autom4te.cache
179 RECURSE_TARGETS=all-recurse clean-recurse distclean-recurse install-recurse \
180 generate-files-mac-recurse \
181 check-recurse depend-recurse undepend-recurse \
182 Makefiles-recurse install-headers-recurse
184 # MY_SUBDIRS overrides any setting of SUBDIRS generated by the
185 # configure script that generated this Makefile. This is needed when
186 # the configure script that produced this Makefile creates multiple
187 # Makefiles in different directories; the setting of SUBDIRS will be
190 # LOCAL_SUBDIRS seems to account for the case where the configure
191 # script doesn't call any other subsidiary configure scripts, but
192 # generates multiple Makefiles.
194 @case "`echo 'x$(MFLAGS)'|sed -e 's/^x//' -e 's/ --.*$$//'`" \
195 in *[ik]*) e="status=1" ;; *) e="exit 1";; esac; \
196 do_subdirs="$(SUBDIRS)" ; \
198 if test -n "$$do_subdirs" && test -z "$(NORECURSE)"; then \
199 for i in $$do_subdirs ; do \
200 if test -d $$i && test -r $$i/Makefile ; then \
201 case $$i in .);; *) \
202 target=`echo $@|sed s/-recurse//`; \
203 echo "making $$target in $(CURRENT_DIR)$$i..."; \
204 if (cd $$i ; $(MAKE) \
205 CURRENT_DIR=$(CURRENT_DIR)$$i/ $$target) then :; \
210 echo "Skipping missing directory $(CURRENT_DIR)$$i" ; \
219 ############################################################