about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Makefile.in121
1 files changed, 89 insertions, 32 deletions
diff --git a/Src/Makefile.in b/Src/Makefile.in
index 453159e17..22b983c1b 100644
--- a/Src/Makefile.in
+++ b/Src/Makefile.in
@@ -28,8 +28,16 @@ subdir = Src
 dir_top = ..
 SUBDIRS =
 
-@@version.mk@@
-@@defs.mk@@
+@VERSION_MK@
+
+# source/build directories
+VPATH           = @srcdir@
+sdir            = @srcdir@
+sdir_top        = @top_srcdir@
+INSTALL         = @INSTALL@
+LN		= @LN@
+
+@DEFS_MK@
 
 sdir_src      = $(sdir)
 dir_src       = .
@@ -40,10 +48,13 @@ LINK        = $(CC) $(LDFLAGS) $(EXELDFLAGS) $(EXTRA_LDFLAGS) -o $@
 DLLINK      = $(DLLD) $(LDFLAGS) $(LIBLDFLAGS) $(DLLDFLAGS) -o $@
 
 all: bin modules
+.PHONY: all
 
 bin: zsh
+.PHONY: bin
 
 modules: headers
+.PHONY: modules
 
 MAIN_OBJS = main.o
 
@@ -55,12 +66,17 @@ NLIST = `cat stamp-modobjs`
 LIBZSH = libzsh-$(VERSION).$(DL_EXT)
 NIBZSH =
 
-LDRUNPATH = LD_RUN_PATH=$(libdir)/zsh
+ZSH_EXPORT = $(EXPOPT)zsh.export
+ZSH_NXPORT =
+ENTRYOBJ   = modentry..o
+NNTRYOBJ   =
+
+LDRUNPATH = LD_RUN_PATH=$(libdir)/$(tzsh)
 NDRUNPATH =
 
-zsh: $(@L@IBZSH) $(@L@STMP) $(MAIN_OBJS)
+zsh: $(@L@IBZSH) $(@L@STMP) $(MAIN_OBJS) zsh.export
 	rm -f $@
-	$(@L@DRUNPATH) $(LINK) $(MAIN_OBJS) $(@L@LIST) $(@L@IBZSH) $(LIBS)
+	$(@L@DRUNPATH) $(LINK) $(MAIN_OBJS) $(@L@LIST) $(ZSH_@E@XPORT) $(@L@IBZSH) $(LIBS)
 
 $(LIBZSH): $(LIBOBJS) $(NSTMP)
 	rm -f $@
@@ -76,12 +92,17 @@ stamp-modobjs: modobjs
 	fi
 
 modobjs: headers rm-modobjs-tmp
+.PHONY: modobjs
 
 rm-modobjs-tmp:
 	rm -f stamp-modobjs.tmp
+.PHONY: rm-modobjs-tmp
 
-Makemod modules.index prep: modules-bltin
-	( cd $(sdir_top) && $(SHELL) $(subdir)/mkmodindex.sh $(subdir) ) \
+@CONFIG_MK@
+
+Makemod modules.index prep: modules-bltin $(CONFIG_INCS)
+	( cd $(sdir_top) && OMIT_MODULES="$(OMIT_MODULES)" \
+	$(SHELL) $(subdir)/mkmodindex.sh $(subdir) ) \
 	    > modules.index.tmp
 	@if cmp -s modules.index.tmp modules.index; then \
 	    rm -f modules.index.tmp; \
@@ -100,20 +121,36 @@ Makemod modules.index prep: modules-bltin
 	cd $(dir_top) && \
 	    $(SHELL) $$top_srcdir/$(subdir)/mkmakemod.sh $(subdir) Makemod
 	@$(MAKE) -f Makemod $(MAKEDEFS) prep || rm -f Makemod
+.PHONY: prep
 
 FORCE:
+.PHONY: FORCE
 
 # ========== LINKING IN MODULES ==========
 
-modules-bltin:
-	if test @D@ = N; then \
-	    cat $(sdir)/xmods.conf > $@; \
-	elif test @RTLD_GLOBAL_OK@ != yes; then \
-	    echo comp1 > $@; \
+mymods.conf:
+	@echo Linking with the standard modules.
+
+modules-bltin:: mymods.conf
+	@if test -f mymods.conf; then \
+	    echo cat mymods.conf \> $@; \
+	    cat mymods.conf > $@; \
+	fi
+
+modules-bltin:: $(dir_top)/config.status $(sdir)/xmods.conf
+	if test -f mymods.conf; then \
+	    cat mymods.conf > $@; \
+	elif test @D@ = N; then \
+	    sed -n '/L.* /{s/^.* //;p;}' < $(sdir)/xmods.conf > $@; \
 	else \
 	    echo > $@; \
 	fi
 
+modules: $(@E@NTRYOBJ)
+
+$(ENTRYOBJ): FORCE
+	@$(MAKE) -f Makemod $(MAKEDEFS) $@
+
 # ========== ANSI TO K&R CONVERSION ==========
 
 ANSI_KNR = ansi2knr
@@ -132,64 +169,84 @@ ansi2knr: ansi2knr.o
 
 install: install.bin install.modules
 uninstall: uninstall.bin uninstall.modules
+.PHONY: install uninstall
 
 install.bin: install.bin-here
 uninstall.bin: uninstall.bin-here
+.PHONY: install.bin uninstall.bin
 
 # install binary, creating install directory if necessary
 install.bin-here: zsh install.bin-@L@
-	$(sdir_top)/mkinstalldirs $(bindir)
-	$(INSTALL_PROGRAM) zsh $(bindir)/zsh-$(VERSION)
-	if test -f $(bindir)/zsh; then \
-	    rm -f $(bindir)/zsh.old; \
-	    ln $(bindir)/zsh $(bindir)/zsh.old; \
+	$(sdir_top)/mkinstalldirs $(DESTDIR)$(bindir)
+	$(INSTALL_PROGRAM) $(STRIPFLAGS) zsh $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION)
+	if test -f $(DESTDIR)$(bindir)/$(tzsh); then \
+	    rm -f $(DESTDIR)$(bindir)/$(tzsh).old; \
+	    $(LN) $(DESTDIR)$(bindir)/$(tzsh) $(DESTDIR)$(bindir)/$(tzsh).old; \
 	else :; fi
-	rm -f $(bindir)/zsh.new
-	ln $(bindir)/zsh-$(VERSION) $(bindir)/zsh.new
-	mv $(bindir)/zsh.new $(bindir)/zsh
+	rm -f $(DESTDIR)$(bindir)/$(tzsh).new
+	$(LN) $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION) $(DESTDIR)$(bindir)/$(tzsh).new
+	mv $(DESTDIR)$(bindir)/$(tzsh).new $(DESTDIR)$(bindir)/$(tzsh)
+.PHONY: install.bin-here
 
 install.bin-N:
 install.bin-L: $(LIBZSH)
-	$(sdir_top)/mkinstalldirs $(libdir)/zsh
-	$(INSTALL_PROGRAM) $(LIBZSH) $(libdir)/zsh/$(LIBZSH)
+	$(sdir_top)/mkinstalldirs $(DESTDIR)$(libdir)/$(tzsh)
+	$(INSTALL_PROGRAM) $(LIBZSH) $(DESTDIR)$(libdir)/$(tzsh)/$(LIBZSH)
+.PHONY: install.bin-N install.bin-L
 
 # uninstall binary
 uninstall.bin-here: uninstall.bin-@L@
-	rm -f $(bindir)/zsh-$(VERSION) $(bindir)/zsh
+	rm -f $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION) $(DESTDIR)$(bindir)/$(tzsh)
+.PHONY: uninstall.bin-here uninstall.bin-@L@
 
 uninstall.bin-N:
 uninstall.bin-L:
-	rm -f $(libdir)/zsh/$(LIBZSH)
+	rm -f $(DESTDIR)$(libdir)/$(tzsh)/$(LIBZSH)
+.PHONY: uninstall.bin-N uninstall.bin-L
 
 # ========== DEPENDENCIES FOR CLEANUP ==========
 
-@@clean.mk@@
+# Since module cleanup rules depend on Makemod, they come first.  This
+# forces module stuff to get cleaned before Makemod itself gets
+# deleted.
 
 mostlyclean-here:
 	rm -f stamp-modobjs stamp-modobjs.tmp
+.PHONY: mostlyclean-here
 
 clean-here:
 	rm -f modules.index.tmp modules.stamp zsh ansi2knr.o ansi2knr
+	rm -f modules.index modules-bltin
 	rm -f libzsh-*.$(DL_EXT)
+.PHONY: clean-here
 
 distclean-here:
 	rm -f TAGS tags
-	rm -f modules.index modules-bltin Makefile
+	rm -f Makefile mymods.conf
+.PHONY: distclean-here
 
 mostlyclean: mostlyclean-modules
 clean: clean-modules
 distclean: distclean-modules
 realclean: realclean-modules
+.PHONY: mostlyclean clean distclean realclean
+
+# Don't remake Makemod just to delete things, even if it doesn't exist.
+mostlyclean-modules clean-modules distclean-modules realclean-modules: modules.index
+	if test -f Makemod; then \
+	  $(MAKE) -f Makemod $(MAKEDEFS) `echo $@ | sed 's/-modules//'`; \
+	fi; \
+	exit 0
+.PHONY: mostlyclean-modules clean-modules distclean-modules \
+	realclean-modules
 
-mostlyclean-modules clean-modules distclean-modules realclean-modules: Makemod
-	@$(MAKE) -f Makemod $(MAKEDEFS) `echo $@ | sed 's/-modules//'`
+@CLEAN_MK@
 
 # ========== RECURSIVE MAKES ==========
 
 install.modules uninstall.modules \
-modobjs modules headers proto $(MAIN_OBJS): Makemod
+modobjs modules headers proto $(MAIN_OBJS) zsh.export: Makemod
 	@$(MAKE) -f Makemod $(MAKEDEFS) $@
+.PHONY: install.modules uninstall.modules
 
-# ========== DEPENDENCIES FOR MAINTENANCE ==========
-
-@@config.mk@@
+$(MAIN_OBJS): $(sdir)/zsh.h