xref: /freebsd/crypto/krb5/src/config/post.in (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1*7f2fe78bSCy Schubert############################################################
2*7f2fe78bSCy Schubert## config/post.in
3*7f2fe78bSCy Schubert##
4*7f2fe78bSCy Schubert
5*7f2fe78bSCy Schubert# in case there is no default target (very unlikely)
6*7f2fe78bSCy Schubertall:
7*7f2fe78bSCy Schubert
8*7f2fe78bSCy Schubertcheck-windows:
9*7f2fe78bSCy Schubert
10*7f2fe78bSCy Schubert# In a few parts of "make check" we run shell scripts which run
11*7f2fe78bSCy Schubert# programs linked against krb5 libraries.  On macOS 10.11 and higher,
12*7f2fe78bSCy Schubert# DYLD_LIBRARY_PATH is cleared by the shell unless System Integrity
13*7f2fe78bSCy Schubert# Protection is turned off, so we need to set runtime linker
14*7f2fe78bSCy Schubert# environment variables from within test scripts.  A Makefile.in which
15*7f2fe78bSCy Schubert# runs shell script tests should make its check rule depend on
16*7f2fe78bSCy Schubert# runenv.sh and make each script begin with ". ./runenv.sh".
17*7f2fe78bSCy Schubertrunenv.sh:
18*7f2fe78bSCy Schubert	$(RUN_SETUP); for i in $(RUN_VARS); do \
19*7f2fe78bSCy Schubert		eval echo "$$i=\\\"\$$$$i\\\""; \
20*7f2fe78bSCy Schubert		echo "export $$i"; done > $@
21*7f2fe78bSCy Schubert
22*7f2fe78bSCy Schubert##############################
23*7f2fe78bSCy Schubert# dependency generation
24*7f2fe78bSCy Schubert#
25*7f2fe78bSCy Schubert
26*7f2fe78bSCy Schubertdepend: depend-postrecurse
27*7f2fe78bSCy Schubertdepend-postrecurse: depend-recurse
28*7f2fe78bSCy Schubertdepend-recurse: depend-prerecurse
29*7f2fe78bSCy Schubert
30*7f2fe78bSCy Schubertdepend-prerecurse:
31*7f2fe78bSCy Schubertdepend-postrecurse:
32*7f2fe78bSCy Schubert
33*7f2fe78bSCy Schubertdepend-postrecurse: depend-update-makefile
34*7f2fe78bSCy Schubert
35*7f2fe78bSCy SchubertALL_DEP_SRCS= $(SRCS) $(EXTRADEPSRCS)
36*7f2fe78bSCy Schubert
37*7f2fe78bSCy Schubert# be sure to check ALL_DEP_SRCS against *what it would be if SRCS and
38*7f2fe78bSCy Schubert# EXTRADEPSRCS are both empty*
39*7f2fe78bSCy Schubert$(BUILDTOP)/.depend-verify-srcdir:
40*7f2fe78bSCy Schubert	@if test "$(srcdir)" = "." ; then \
41*7f2fe78bSCy Schubert		echo 1>&2 error: cannot build dependencies with srcdir=. ; \
42*7f2fe78bSCy Schubert		echo 1>&2 "(can't distinguish generated files from source files)" ; \
43*7f2fe78bSCy Schubert		echo 1>&2 "Run 'make distclean' and create a separate build dir" ; \
44*7f2fe78bSCy Schubert		exit 1 ; \
45*7f2fe78bSCy Schubert	elif test -f "$(top_srcdir)/include/autoconf.h"; then \
46*7f2fe78bSCy Schubert		echo 1>&2 "error: generated headers found in source tree" ; \
47*7f2fe78bSCy Schubert		echo 1>&2 "Run 'make distclean' in source tree first" ; \
48*7f2fe78bSCy Schubert		exit 1 ; \
49*7f2fe78bSCy Schubert	else \
50*7f2fe78bSCy Schubert		if test -r $(BUILDTOP)/.depend-verify-srcdir; then :; \
51*7f2fe78bSCy Schubert			else (set -x; touch $(BUILDTOP)/.depend-verify-srcdir); fi \
52*7f2fe78bSCy Schubert	fi
53*7f2fe78bSCy Schubert$(BUILDTOP)/.depend-verify-et: depend-verify-et-$(COM_ERR_VERSION)
54*7f2fe78bSCy Schubertdepend-verify-et-k5:
55*7f2fe78bSCy Schubert	@if test -r $(BUILDTOP)/.depend-verify-et; then :; \
56*7f2fe78bSCy Schubert		else (set -x; touch $(BUILDTOP)/.depend-verify-et); fi
57*7f2fe78bSCy Schubertdepend-verify-et-sys depend-verify-et-intlsys:
58*7f2fe78bSCy Schubert	@echo 1>&2 error: cannot build dependencies using system et package
59*7f2fe78bSCy Schubert	@exit 1
60*7f2fe78bSCy Schubert$(BUILDTOP)/.depend-verify-ss: depend-verify-ss-$(SS_VERSION)
61*7f2fe78bSCy Schubertdepend-verify-ss-k5:
62*7f2fe78bSCy Schubert	@if test -r $(BUILDTOP)/.depend-verify-ss; then :; \
63*7f2fe78bSCy Schubert		else (set -x; touch $(BUILDTOP)/.depend-verify-ss); fi
64*7f2fe78bSCy Schubertdepend-verify-ss-sys:
65*7f2fe78bSCy Schubert	@echo 1>&2 error: cannot build dependencies using system ss package
66*7f2fe78bSCy Schubert	@exit 1
67*7f2fe78bSCy Schubert$(BUILDTOP)/.depend-verify-verto: depend-verify-verto-$(VERTO_VERSION)
68*7f2fe78bSCy Schubertdepend-verify-verto-k5:
69*7f2fe78bSCy Schubert	@if test -r $(BUILDTOP)/.depend-verify-verto; then :; \
70*7f2fe78bSCy Schubert		else (set -x; touch $(BUILDTOP)/.depend-verify-verto); fi
71*7f2fe78bSCy Schubertdepend-verify-verto-sys:
72*7f2fe78bSCy Schubert	@echo 1>&2 error: cannot build dependencies using system verto package
73*7f2fe78bSCy Schubert	@echo 1>&2 Please configure with --without-system-verto
74*7f2fe78bSCy Schubert	@exit 1
75*7f2fe78bSCy Schubert$(BUILDTOP)/.depend-verify-gcc: depend-verify-gcc-@HAVE_GCC@
76*7f2fe78bSCy Schubertdepend-verify-gcc-yes:
77*7f2fe78bSCy Schubert	@if test -r $(BUILDTOP)/.depend-verify-gcc; then :; \
78*7f2fe78bSCy Schubert		else (set -x; touch $(BUILDTOP)/.depend-verify-gcc); fi
79*7f2fe78bSCy Schubertdepend-verify-gcc-no:
80*7f2fe78bSCy Schubert	@echo 1>&2 error: The '"depend"' rules are written for gcc.
81*7f2fe78bSCy Schubert	@echo 1>&2 Please use gcc, or update the rules to handle your compiler.
82*7f2fe78bSCy Schubert	@exit 1
83*7f2fe78bSCy Schubert
84*7f2fe78bSCy SchubertDEP_CFG_VERIFY = $(BUILDTOP)/.depend-verify-srcdir \
85*7f2fe78bSCy Schubert	$(BUILDTOP)/.depend-verify-et $(BUILDTOP)/.depend-verify-ss \
86*7f2fe78bSCy Schubert	$(BUILDTOP)/.depend-verify-verto
87*7f2fe78bSCy SchubertDEP_VERIFY = $(DEP_CFG_VERIFY) $(BUILDTOP)/.depend-verify-gcc
88*7f2fe78bSCy Schubert
89*7f2fe78bSCy Schubert.d: $(ALL_DEP_SRCS) $(DEP_CFG_VERIFY) depend-dependencies
90*7f2fe78bSCy Schubert	if test "$(ALL_DEP_SRCS)" != " " ; then \
91*7f2fe78bSCy Schubert		$(RM) .dtmp && $(MAKE) .dtmp && mv -f .dtmp .d ; \
92*7f2fe78bSCy Schubert	else \
93*7f2fe78bSCy Schubert		touch .d ; \
94*7f2fe78bSCy Schubert	fi
95*7f2fe78bSCy Schubert
96*7f2fe78bSCy Schubert# These are dependencies of the depend target that do not get fed to
97*7f2fe78bSCy Schubert# the compiler.  Examples include generated header files.
98*7f2fe78bSCy Schubertdepend-dependencies:
99*7f2fe78bSCy Schubert
100*7f2fe78bSCy Schubert# .dtmp must *always* be out of date so that $? can be used to perform
101*7f2fe78bSCy Schubert# VPATH searches on the sources.
102*7f2fe78bSCy Schubert#
103*7f2fe78bSCy Schubert# NOTE: This will fail when using Make programs whose VPATH support is
104*7f2fe78bSCy Schubert# broken.
105*7f2fe78bSCy Schubert.dtmp: $(ALL_DEP_SRCS)
106*7f2fe78bSCy Schubert	$(CC) -M -DDEPEND $(ALL_CFLAGS) $? > .dtmp
107*7f2fe78bSCy Schubert
108*7f2fe78bSCy Schubert# NOTE: This will also generate spurious $(OUTPRE) and $(OBJEXT)
109*7f2fe78bSCy Schubert# references in rules for non-library objects in a directory where
110*7f2fe78bSCy Schubert# library objects happen to be built.  It's mostly harmless.
111*7f2fe78bSCy Schubert.depend: .d $(top_srcdir)/util/depfix.pl
112*7f2fe78bSCy Schubert	perl $(top_srcdir)/util/depfix.pl '$(top_srcdir)' '$(mydir)' \
113*7f2fe78bSCy Schubert		'$(srcdir)' '$(BUILDTOP)' '$(STLIBOBJS)' < .d > .depend
114*7f2fe78bSCy Schubert
115*7f2fe78bSCy Schubert# Temporarily keep the rule for removing the dependency line eater
116*7f2fe78bSCy Schubert# until we're sure we've gotten everything converted and excised the
117*7f2fe78bSCy Schubert# old stuff from Makefile.in files.
118*7f2fe78bSCy Schubertdepend-update-makefile: .depend depend-recurse
119*7f2fe78bSCy Schubert	if test "$(ALL_DEP_SRCS)" != " " ; then \
120*7f2fe78bSCy Schubert		$(CP) .depend $(srcdir)/deps.new ; \
121*7f2fe78bSCy Schubert	else \
122*7f2fe78bSCy Schubert		echo "# No dependencies here." > $(srcdir)/deps.new ; \
123*7f2fe78bSCy Schubert	fi
124*7f2fe78bSCy Schubert	$(top_srcdir)/config/move-if-changed $(srcdir)/deps.new $(srcdir)/deps
125*7f2fe78bSCy Schubert	sed -e '/^# +++ Dependency line eater +++/,$$d' \
126*7f2fe78bSCy Schubert		< $(srcdir)/Makefile.in > $(srcdir)/Makefile.in.new
127*7f2fe78bSCy Schubert	$(top_srcdir)/config/move-if-changed $(srcdir)/Makefile.in.new \
128*7f2fe78bSCy Schubert		$(srcdir)/Makefile.in
129*7f2fe78bSCy Schubert
130*7f2fe78bSCy SchubertDEPTARGETS = .depend .d .dtmp $(DEP_VERIFY)
131*7f2fe78bSCy SchubertDEPTARGETS_CLEAN = .depend .d .dtmp $(DEPTARGETS_@srcdir@_@CONFIG_RELTOPDIR@)
132*7f2fe78bSCy SchubertDEPTARGETS_@top_srcdir@_. = $(DEP_VERIFY)
133*7f2fe78bSCy Schubert
134*7f2fe78bSCy Schubert# Clear out dependencies.  Should only be used temporarily, e.g., while
135*7f2fe78bSCy Schubert# moving or renaming headers and then rebuilding dependencies.
136*7f2fe78bSCy Schubertundepend: undepend-postrecurse
137*7f2fe78bSCy Schubertundepend-recurse:
138*7f2fe78bSCy Schubertundepend-postrecurse: undepend-recurse
139*7f2fe78bSCy Schubert	if test -n "$(SRCS)" ; then \
140*7f2fe78bSCy Schubert		sed -e '/^# +++ Dependency line eater +++/,$$d' \
141*7f2fe78bSCy Schubert			< $(srcdir)/Makefile.in \
142*7f2fe78bSCy Schubert			> $(srcdir)/Makefile.in.new ;\
143*7f2fe78bSCy Schubert		echo "# +++ Dependency line eater +++" >> $(srcdir)/Makefile.in.new ;\
144*7f2fe78bSCy Schubert		echo "# (dependencies temporarily removed)" >> $(srcdir)/Makefile.in.new ;\
145*7f2fe78bSCy Schubert		$(top_srcdir)/config/move-if-changed $(srcdir)/Makefile.in.new $(srcdir)/Makefile.in;\
146*7f2fe78bSCy Schubert	else :; fi
147*7f2fe78bSCy Schubert
148*7f2fe78bSCy Schubert#
149*7f2fe78bSCy Schubert# end dependency generation
150*7f2fe78bSCy Schubert##############################
151*7f2fe78bSCy Schubert
152*7f2fe78bSCy Schubert# Python tests
153*7f2fe78bSCy Schubertcheck-unix: check-pytests-@HAVE_PYTHON@
154*7f2fe78bSCy Schubert
155*7f2fe78bSCy Schubert# Makefile.in should add rules to check-pytests to execute Python tests.
156*7f2fe78bSCy Schubertcheck-pytests-yes: check-pytests
157*7f2fe78bSCy Schubertcheck-pytests-no:
158*7f2fe78bSCy Schubertcheck-pytests:
159*7f2fe78bSCy Schubert
160*7f2fe78bSCy Schubert# cmocka tests
161*7f2fe78bSCy Schubertcheck-unix: check-cmocka-@HAVE_CMOCKA@
162*7f2fe78bSCy Schubert
163*7f2fe78bSCy Schubertcheck-cmocka-yes: check-cmocka
164*7f2fe78bSCy Schubertcheck-cmocka-no:
165*7f2fe78bSCy Schubertcheck-cmocka:
166*7f2fe78bSCy Schubert
167*7f2fe78bSCy Schubertclean: clean-$(WHAT)
168*7f2fe78bSCy Schubert
169*7f2fe78bSCy Schubertclean-unix::
170*7f2fe78bSCy Schubert	$(RM) $(OBJS) $(DEPTARGETS_CLEAN) $(EXTRA_FILES)
171*7f2fe78bSCy Schubert	$(RM) et-[ch]-*.et et-[ch]-*.[ch] testlog testtrace runenv.sh
172*7f2fe78bSCy Schubert	-$(RM) -r testdir
173*7f2fe78bSCy Schubert
174*7f2fe78bSCy Schubertclean-windows::
175*7f2fe78bSCy Schubert	$(RM) *.$(OBJEXT)
176*7f2fe78bSCy Schubert	$(RM) msvc.pdb *.err
177*7f2fe78bSCy Schubert
178*7f2fe78bSCy Schubertdistclean: distclean-$(WHAT)
179*7f2fe78bSCy Schubert
180*7f2fe78bSCy Schubertdistclean-normal-clean:
181*7f2fe78bSCy Schubert	$(MAKE) NORECURSE=true clean
182*7f2fe78bSCy Schubertdistclean-prerecurse: distclean-normal-clean
183*7f2fe78bSCy Schubertdistclean-nuke-configure-state:
184*7f2fe78bSCy Schubert	$(RM) config.log config.cache config.status Makefile
185*7f2fe78bSCy Schubertdistclean-postrecurse: distclean-nuke-configure-state
186*7f2fe78bSCy Schubert
187*7f2fe78bSCy SchubertMakefiles-prerecurse: Makefile
188*7f2fe78bSCy Schubert
189*7f2fe78bSCy Schubert# mydir = relative path from top to this Makefile
190*7f2fe78bSCy SchubertMakefile: $(srcdir)/Makefile.in $(srcdir)/deps $(BUILDTOP)/config.status \
191*7f2fe78bSCy Schubert		$(top_srcdir)/config/pre.in $(top_srcdir)/config/post.in
192*7f2fe78bSCy Schubert	(cd $(BUILDTOP) && $(SHELL) config.status $(mydir)/Makefile)
193*7f2fe78bSCy Schubert$(BUILDTOP)/config.status: $(top_srcdir)/configure
194*7f2fe78bSCy Schubert	(cd $(BUILDTOP) && $(SHELL) config.status --recheck)
195*7f2fe78bSCy Schubert$(top_srcdir)/configure: @MAINT@ \
196*7f2fe78bSCy Schubert		$(top_srcdir)/configure.ac \
197*7f2fe78bSCy Schubert		$(top_srcdir)/patchlevel.h \
198*7f2fe78bSCy Schubert		$(top_srcdir)/aclocal.m4
199*7f2fe78bSCy Schubert	(cd $(top_srcdir) && \
200*7f2fe78bSCy Schubert		$(AUTOCONF) -f --include=$(CONFIG_RELTOPDIR) $(AUTOCONFFLAGS))
201*7f2fe78bSCy Schubert
202*7f2fe78bSCy SchubertRECURSE_TARGETS=all-recurse clean-recurse distclean-recurse install-recurse \
203*7f2fe78bSCy Schubert	generate-files-mac-recurse \
204*7f2fe78bSCy Schubert	check-recurse depend-recurse undepend-recurse \
205*7f2fe78bSCy Schubert	Makefiles-recurse install-headers-recurse
206*7f2fe78bSCy Schubert
207*7f2fe78bSCy Schubert# MY_SUBDIRS overrides any setting of SUBDIRS generated by the
208*7f2fe78bSCy Schubert# configure script that generated this Makefile.  This is needed when
209*7f2fe78bSCy Schubert# the configure script that produced this Makefile creates multiple
210*7f2fe78bSCy Schubert# Makefiles in different directories; the setting of SUBDIRS will be
211*7f2fe78bSCy Schubert# the same in each.
212*7f2fe78bSCy Schubert#
213*7f2fe78bSCy Schubert# LOCAL_SUBDIRS seems to account for the case where the configure
214*7f2fe78bSCy Schubert# script doesn't call any other subsidiary configure scripts, but
215*7f2fe78bSCy Schubert# generates multiple Makefiles.
216*7f2fe78bSCy Schubert$(RECURSE_TARGETS):
217*7f2fe78bSCy Schubert	@case "`echo 'x$(MFLAGS)'|sed -e 's/^x//' -e 's/ --.*$$//'`" \
218*7f2fe78bSCy Schubert		in *[ik]*) e="status=1" ;; *) e="exit 1";; esac; \
219*7f2fe78bSCy Schubert	do_subdirs="$(SUBDIRS)" ; \
220*7f2fe78bSCy Schubert	status=0; \
221*7f2fe78bSCy Schubert	if test -n "$$do_subdirs" && test -z "$(NORECURSE)"; then \
222*7f2fe78bSCy Schubert	for i in $$do_subdirs ; do \
223*7f2fe78bSCy Schubert		if test -d $$i && test -r $$i/Makefile ; then \
224*7f2fe78bSCy Schubert		case $$i in .);; *) \
225*7f2fe78bSCy Schubert			target=`echo $@|sed s/-recurse//`; \
226*7f2fe78bSCy Schubert			echo "making $$target in $(CURRENT_DIR)$$i..."; \
227*7f2fe78bSCy Schubert			if (cd $$i ; $(MAKE) \
228*7f2fe78bSCy Schubert			    CURRENT_DIR=$(CURRENT_DIR)$$i/ $$target) then :; \
229*7f2fe78bSCy Schubert			else eval $$e; fi; \
230*7f2fe78bSCy Schubert			;; \
231*7f2fe78bSCy Schubert		esac; \
232*7f2fe78bSCy Schubert		else \
233*7f2fe78bSCy Schubert			echo "Skipping missing directory $(CURRENT_DIR)$$i" ; \
234*7f2fe78bSCy Schubert		fi; \
235*7f2fe78bSCy Schubert	done; \
236*7f2fe78bSCy Schubert	else :; \
237*7f2fe78bSCy Schubert	fi;\
238*7f2fe78bSCy Schubert	exit $$status
239*7f2fe78bSCy Schubert
240*7f2fe78bSCy Schubert##
241*7f2fe78bSCy Schubert## end of post.in
242*7f2fe78bSCy Schubert############################################################
243