mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-23 16:40:24 +02:00
Merge of 21501: fixed a cygwin install target to make sure the bindir exists.
This commit is contained in:
parent
abf6da9b02
commit
18e408f3de
1 changed files with 34 additions and 60 deletions
|
@ -50,7 +50,7 @@ DLLINK = $(DLLD) $(LDFLAGS) $(LIBLDFLAGS) $(DLLDFLAGS) -o $@
|
|||
all: bin modules
|
||||
.PHONY: all
|
||||
|
||||
bin: zsh
|
||||
bin: zsh$(EXEEXT)
|
||||
.PHONY: bin
|
||||
|
||||
modules: headers
|
||||
|
@ -58,6 +58,8 @@ modules: headers
|
|||
|
||||
MAIN_OBJS = main.o
|
||||
|
||||
L = @L@
|
||||
|
||||
LSTMP =
|
||||
LLIST =
|
||||
NSTMP = stamp-modobjs
|
||||
|
@ -65,6 +67,8 @@ NLIST = `cat stamp-modobjs`
|
|||
|
||||
LIBZSH = libzsh-$(VERSION).$(DL_EXT)
|
||||
NIBZSH =
|
||||
INSTLIB = @INSTLIB@
|
||||
UNINSTLIB = @UNINSTLIB@
|
||||
|
||||
ZSH_EXPORT = $(EXPOPT)zsh.export
|
||||
ZSH_NXPORT =
|
||||
|
@ -74,13 +78,18 @@ NNTRYOBJ =
|
|||
LDRUNPATH = LD_RUN_PATH=$(libdir)/$(tzsh)
|
||||
NDRUNPATH =
|
||||
|
||||
zsh: $(@L@IBZSH) $(@L@STMP) $(MAIN_OBJS) zsh.export
|
||||
EXTRAZSHOBJS = @EXTRAZSHOBJS@
|
||||
|
||||
zsh$(EXEEXT): $(@L@IBZSH) $(@L@STMP) $(MAIN_OBJS) zsh.export $(EXTRAZSHOBJS)
|
||||
rm -f $@
|
||||
$(@L@DRUNPATH) $(LINK) $(MAIN_OBJS) $(@L@LIST) $(ZSH_@E@XPORT) $(@L@IBZSH) $(LIBS)
|
||||
$(@L@DRUNPATH) $(LINK) $(MAIN_OBJS) $(EXTRAZSHOBJS) $(@L@LIST) $(ZSH_@E@XPORT) $(@L@IBZSH) $(LIBS)
|
||||
|
||||
$(LIBZSH): $(LIBOBJS) $(NSTMP)
|
||||
rm -f $@
|
||||
$(DLLINK) $(LIBOBJS) $(NLIST)
|
||||
$(DLLINK) $(LIBOBJS) $(NLIST) $(LIBS)
|
||||
|
||||
zsh.res.o: $(sdir)/zsh.rc $(sdir)/zsh.ico
|
||||
windres -O coff --include-dir $(sdir) -i $(sdir)/zsh.rc -o zsh.res.o
|
||||
|
||||
stamp-modobjs: modobjs
|
||||
@if cmp -s stamp-modobjs.tmp stamp-modobjs; then \
|
||||
|
@ -100,17 +109,7 @@ rm-modobjs-tmp:
|
|||
|
||||
@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; \
|
||||
echo "\`modules.index' is up to date."; \
|
||||
else \
|
||||
mv -f modules.index.tmp modules.index; \
|
||||
echo "Updated \`modules.index'."; \
|
||||
fi
|
||||
Makemod prep: $(CONFIG_INCS) $(dir_top)/config.modules
|
||||
@case $(sdir_top) in \
|
||||
/*) top_srcdir=$(sdir_top) ;; \
|
||||
*) top_srcdir=$(subdir)/$(sdir_top) ;; \
|
||||
|
@ -131,40 +130,11 @@ FORCE:
|
|||
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:: Makefile $(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
|
||||
ANSIKNR =
|
||||
|
||||
Makemod: $(ANSI@U@KNR)
|
||||
|
||||
ansi2knr.o: ansi2knr.c
|
||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(sdir)/ansi2knr.c
|
||||
|
||||
ansi2knr: ansi2knr.o
|
||||
rm -f $@
|
||||
$(CC) $(LDFLAGS) $(EXELDFLAGS) -o $@ ansi2knr.o
|
||||
|
||||
# ========== DEPENDENCIES FOR INSTALLING ==========
|
||||
|
||||
install: install.bin install.modules
|
||||
|
@ -176,33 +146,38 @@ 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 $(DESTDIR)$(bindir)
|
||||
$(INSTALL_PROGRAM) $(STRIPFLAGS) zsh $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION)
|
||||
if test -f $(DESTDIR)$(bindir)/$(tzsh); then \
|
||||
install.bin-here: zsh$(EXEEXT) $(INSTLIB)
|
||||
${SHELL} $(sdir_top)/mkinstalldirs $(DESTDIR)$(bindir)
|
||||
$(INSTALL_PROGRAM) $(STRIPFLAGS) zsh$(EXEEXT) $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION)$(EXEEXT)
|
||||
if test -f $(DESTDIR)$(bindir)/$(tzsh)$(EXEEXT); then \
|
||||
rm -f $(DESTDIR)$(bindir)/$(tzsh).old; \
|
||||
$(LN) $(DESTDIR)$(bindir)/$(tzsh) $(DESTDIR)$(bindir)/$(tzsh).old; \
|
||||
$(LN) $(DESTDIR)$(bindir)/$(tzsh)$(EXEEXT) $(DESTDIR)$(bindir)/$(tzsh).old; \
|
||||
else :; fi
|
||||
rm -f $(DESTDIR)$(bindir)/$(tzsh).new
|
||||
$(LN) $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION) $(DESTDIR)$(bindir)/$(tzsh).new
|
||||
mv $(DESTDIR)$(bindir)/$(tzsh).new $(DESTDIR)$(bindir)/$(tzsh)
|
||||
$(LN) $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION)$(EXEEXT) $(DESTDIR)$(bindir)/$(tzsh).new
|
||||
mv $(DESTDIR)$(bindir)/$(tzsh).new $(DESTDIR)$(bindir)/$(tzsh)$(EXEEXT)
|
||||
.PHONY: install.bin-here
|
||||
|
||||
install.bin-N:
|
||||
install.bin-L: $(LIBZSH)
|
||||
$(sdir_top)/mkinstalldirs $(DESTDIR)$(libdir)/$(tzsh)
|
||||
${SHELL} $(sdir_top)/mkinstalldirs $(DESTDIR)$(libdir)/$(tzsh)
|
||||
$(INSTALL_PROGRAM) $(LIBZSH) $(DESTDIR)$(libdir)/$(tzsh)/$(LIBZSH)
|
||||
.PHONY: install.bin-N install.bin-L
|
||||
install.cygwin-lib: $(LIBZSH)
|
||||
${SHELL} $(sdir_top)/mkinstalldirs $(DESTDIR)$(bindir)
|
||||
$(INSTALL_PROGRAM) $(LIBZSH) $(DESTDIR)$(bindir)/$(LIBZSH)
|
||||
.PHONY: install.bin-N install.bin-L install.cygwin-lib
|
||||
|
||||
# uninstall binary
|
||||
uninstall.bin-here: uninstall.bin-@L@
|
||||
rm -f $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION) $(DESTDIR)$(bindir)/$(tzsh)
|
||||
uninstall.bin-here: $(UNINSTLIB)
|
||||
rm -f $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION) $(DESTDIR)$(bindir)/$(tzsh)$(EXEEXT)
|
||||
.PHONY: uninstall.bin-here uninstall.bin-@L@
|
||||
|
||||
uninstall.bin-N:
|
||||
uninstall.bin-L:
|
||||
rm -f $(DESTDIR)$(libdir)/$(tzsh)/$(LIBZSH)
|
||||
.PHONY: uninstall.bin-N uninstall.bin-L
|
||||
uninstall.cygwin-lib:
|
||||
rm -f $(DESTDIR)$(bindir)/$(LIBZSH)
|
||||
.PHONY: uninstall.bin-N uninstall.bin-L uninstall.cygwin-lib
|
||||
|
||||
# ========== DEPENDENCIES FOR CLEANUP ==========
|
||||
|
||||
|
@ -215,14 +190,13 @@ mostlyclean-here:
|
|||
.PHONY: mostlyclean-here
|
||||
|
||||
clean-here:
|
||||
rm -f modules.index.tmp modules.stamp zsh ansi2knr.o ansi2knr
|
||||
rm -f modules.index modules-bltin
|
||||
rm -f modules.stamp zsh$(EXEEXT)
|
||||
rm -f libzsh-*.$(DL_EXT)
|
||||
.PHONY: clean-here
|
||||
|
||||
distclean-here:
|
||||
rm -f TAGS tags
|
||||
rm -f Makefile mymods.conf
|
||||
rm -f Makefile
|
||||
.PHONY: distclean-here
|
||||
|
||||
mostlyclean: mostlyclean-modules
|
||||
|
@ -232,7 +206,7 @@ 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
|
||||
mostlyclean-modules clean-modules distclean-modules realclean-modules:
|
||||
if test -f Makemod; then \
|
||||
$(MAKE) -f Makemod $(MAKEDEFS) `echo $@ | sed 's/-modules//'`; \
|
||||
fi; \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue