Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Makefile fixes
- X-seq: zsh-workers 2694
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxxx (Zsh hacking and development)
- Subject: Makefile fixes
- Date: Thu, 2 Jan 1997 02:54:53 +0100 (MET)
This patch moves two big scripts ans CFSED out of Makefile.in into separate
files. This will make compilation possible on machines where sed
complained about long labels. This patch applies to zsh-3.1.1-test1.
Zoltan
*** Src/Makefile.in 1996/12/31 02:28:09 3.1.1.14
--- Src/Makefile.in 1997/01/02 00:26:37
***************
*** 115,123 ****
DIST_SRCS = builtin.c compat.c cond.c exec.c glob.c hashtable.c hist.c \
init.c input.c jobs.c lex.c linklist.c loop.c main.c math.c mem.c module.c \
options.c params.c parse.c prompt.c signals.c subst.c text.c utils.c watch.c \
! Zle/zle_bindings.c Zle/zle_hist.c Zle/zle_main.c Zle/zle_misc.c \
! Zle/zle_move.c Zle/zle_refresh.c Zle/zle_tricky.c Zle/zle_utils.c \
! Zle/zle_vi.c Zle/zle_word.c Zle/zle.h Zle/compctl.c $(DIST_HDRS) version.h
# generated prototypes
PROTO = builtin.pro compat.pro cond.pro exec.pro glob.pro hashtable.pro \
--- 115,124 ----
DIST_SRCS = builtin.c compat.c cond.c exec.c glob.c hashtable.c hist.c \
init.c input.c jobs.c lex.c linklist.c loop.c main.c math.c mem.c module.c \
options.c params.c parse.c prompt.c signals.c subst.c text.c utils.c watch.c \
! Zle/zle_bindings.c Zle/zle_hist.c Zle/zle_keymap.c Zle/zle_main.c \
! Zle/zle_misc.c Zle/zle_move.c Zle/zle_refresh.c Zle/zle_tricky.c \
! Zle/zle_utils.c Zle/zle_vi.c Zle/zle_word.c Zle/zle.h Zle/compctl.c \
! $(DIST_HDRS) version.h
# generated prototypes
PROTO = builtin.pro compat.pro cond.pro exec.pro glob.pro hashtable.pro \
***************
*** 153,159 ****
XMODCF = $(srcdir)/xmods.conf
MODBINS = modules-bltin
! CFSED = ':1;/\\$$/{N;s/\\\n//;b1;};s/ / /g;/^ *$$/d'
# ========= DEPENDENCIES FOR BUILDING ==========
--- 154,160 ----
XMODCF = $(srcdir)/xmods.conf
MODBINS = modules-bltin
! CFSED = sed -n -f $(srcdir)/conf.sed -e
# ========= DEPENDENCIES FOR BUILDING ==========
***************
*** 206,263 ****
echo "Updated \`zshpaths.h'." ; \
fi
! bltinmods.list: $(MODBINS) $(XMODCF)
! @echo "Creating \`$@'."
! @( \
! binmods=`sed 's/^/ /;s/$$/ /' $(MODBINS)`; \
! sed=$(CFSED)';/^[^#:>]*>[^#:>]*$$/{s/>.*//;p;}'; \
! xmods=`sed -n -e "$$sed" $(XMODCF)`; \
! for mod in $$xmods; do \
! case $$binmods in \
! *" $$mod "*) ;; \
! *) echo "/* non-linked-in known module \`$$mod' */"; \
! sed=$(CFSED)';/^ *'$$mod' *>[^#:>]*$$/{s/.*>//;p;}'; \
! bins=`sed -n -e "$$sed" $(XMODCF)`; \
! for bin in $$bins; do \
! echo " add_autobin(\"$$bin\", \"$$mod\");"; \
! done; \
! sed=$(CFSED)';/^ *'$$mod' *:[^#:>]*$$/{s/.*://;p;}'; \
! deps=`sed -n -e "$$sed" $(XMODCF)`; \
! for dep in $$deps; do \
! case $$binmods in \
! *" $$dep "*) \
! echo " /* depends on \`$$dep' */" ;; \
! *) echo " add_dep(\"$$mod\", \"$$dep\");" ;; \
! esac; \
! done ;; \
! esac; \
! done; \
! echo; \
! donemods=" "; \
! for mod in $$binmods; do \
! echo "/* linked-in module \`$$mod' */"; \
! sed=$(CFSED)';/^ *'$$mod' *:[^#:>]*$$/{s/.*://;p;}'; \
! deps=`sed -n -e "$$sed" $(XMODCF)`; \
! for dep in $$deps; do \
! case $$donemods in \
! *" $$dep "*) \
! echo " /* depends on \`$$dep' */" ;; \
! *) echo >&2 "ERROR: linked-in module \`$$mod' depends on \`$$dep'"; \
! rm -f $@; \
! exit 1 ;; \
! esac; \
! done; \
! echo " mod.nam = \"$$mod\"; boot_$$mod(&mod);"; \
! donemods="$$donemods$$mod "; \
! done; \
! ) > $@
zshxmods.h: $(MODBINS) $(XMODCF)
@echo "Creating \`$@'."
@( \
binmods=`sed 's/^/ /;s/$$/ /' $(MODBINS)`; \
! sed=$(CFSED)';/^[^#:>]*>[^#:>]*$$/{s/>.*//;p;}'; \
! xmods=`sed -n -e "$$sed" $(XMODCF)`; \
for mod in $$xmods; do \
case $$binmods in \
*" $$mod "*) \
--- 207,221 ----
echo "Updated \`zshpaths.h'." ; \
fi
! bltinmods.list: $(MODBINS) $(XMODCF) mkbltnmlst.sh
! MODBINS=$(MODBINS) XMODCF=$(XMODCF) $(srcdir)/mkbltnmlst.sh $@
zshxmods.h: $(MODBINS) $(XMODCF)
@echo "Creating \`$@'."
@( \
binmods=`sed 's/^/ /;s/$$/ /' $(MODBINS)`; \
! sed='/^[^#:>]*>[^#:>]*$$/{s/>.*//;p;}'; \
! xmods=`$(CFSED) "$$sed" $(XMODCF)`; \
for mod in $$xmods; do \
case $$binmods in \
*" $$mod "*) \
***************
*** 273,325 ****
$(MODBINS):
if test @D@ = N; then \
! sed -n -e $(CFSED) -e '/^[^#:>]*>[^#:>]*$$/{s/>.*//;p;}' $(XMODCF) > $@; \
else \
echo > $@; \
fi
! proto: $(PROTO) proto-recursive FORCE
$(PROTO): makepro.sed
! $(NSTMP): FORCE
! @dn=true; \
! test -f $(NSTMP) || dn=false; \
! echo > $(NSTMP).tmp; \
! for mod in `cat $(MODBINS)`; do \
! sed=$(CFSED)';/^ *'$$mod' *:[^#:>]*$$/{s/.*://;p;}'; \
! objs=`sed -n -e "$$sed" $(MODCF)`; \
! if test -z "$$objs"; then \
! for dir in $(MODULE_DIRS); do \
! if test -f $(srcdir)/$$dir/$$mod.c; then \
! objs=$$dir/$$mod.o; \
! break; \
! fi; \
! done; \
! if test -z "$$objs"; then \
! echo >&2 \
! "ERROR: don't know how to build module $$mod"; \
! exit 1; \
! fi; \
! fi; \
! $(MAKE) $(MAKEDEFS) $$objs || exit 1; set -x; \
! if test $$dn = true; then \
! nobjs=`find . -name '*.o' -newer $(NSTMP) -print`; \
! for obj in $$objs; do \
! case $$nobjs in \
! *./$$obj*) dn=false ;; \
! esac; \
! done; \
! fi; \
! echo $$objs >> $(NSTMP).tmp; \
! done; \
! if $$dn && cmp -s $(NSTMP).tmp $(NSTMP); then \
! rm -f $(NSTMP).tmp; \
! echo "\`$(NSTMP)' is up to date."; \
! else \
! mv -f $(NSTMP).tmp $(NSTMP); \
! echo "Updated \`$(NSTMP)'."; \
! fi
FORCE:
--- 231,248 ----
$(MODBINS):
if test @D@ = N; then \
! $(CFSED) '/^[^#:>]*>[^#:>]*$$/{s/>.*//;p;}' $(XMODCF) > $@; \
else \
echo > $@; \
fi
! proto: $(PROTO) proto-recursive
$(PROTO): makepro.sed
! $(NSTMP): $(MODBINS) $(MODCF) mkstamp.sh proto FORCE
! @MODBINS=$(MODBINS) MODCF=$(MODCF) MODULE_DIRS="$(MODULE_DIRS)" \
! MAKE=$(MAKE) MAKEDEFS="$(MAKEDEFS)" $(srcdir)/mkstamp.sh $@
FORCE:
*** Src/conf.sed 1997/01/02 00:27:21 3.1.1.0
--- Src/conf.sed 1997/01/01 23:29:45
***************
*** 0 ****
--- 1,8 ----
+ :1
+ /\\$/ {
+ N
+ s/\\\n//
+ b1
+ }
+ s/ / /g
+ /^ *$$/d
*** Src/mkbltnmlst.sh 1997/01/02 00:27:22 3.1.1.0
--- Src/mkbltnmlst.sh 1997/01/01 23:52:06
***************
*** 0 ****
--- 1,66 ----
+ #! /bin/sh
+ #
+ # $Id$
+ #
+ # Written by Andrew Main
+ #
+ srcdir=`echo $0|sed 's%/[^/][^/]*$%%'`
+ test "x$srcdir" = "x$0" && srcdir=.
+ CFSED="${CFSED-sed -n -f $srcdir/conf.sed -e}"
+ MODBINS="${MODBINS-modules-bltin}"
+ XMODCF="${XMODCF-$srcdir/xmods.conf}"
+ binmods=`sed 's/^/ /;s/$/ /' $MODBINS`
+ sed='/^[^#:>]*>[^#:>]*$/{
+ s/>.*//
+ p
+ }'
+ xmods=`$CFSED "$sed" $XMODCF`
+ trap "rm -f $1; exit 1" 1 2 15
+ exec > $1
+ for mod in $xmods; do
+ case $binmods in
+ *" $mod "*) ;;
+ *) echo "/* non-linked-in known module \`$mod' */"
+ sed='/^ *'$mod' *>[^#:>]*$/{
+ s/.*>//
+ p
+ }'
+ bins=`$CFSED "$sed" $XMODCF`
+ for bin in $bins; do
+ echo " add_autobin(\"$bin\", \"$mod\");"
+ done
+ sed='/^ *'$mod' *:[^#:>]*$/{
+ s/.*://
+ p
+ }'
+ deps=`$CFSED "$sed" $XMODCF`
+ for dep in $deps; do
+ case $binmods in
+ *" $dep "*)
+ echo " /* depends on \`$dep' */" ;;
+ *) echo " add_dep(\"$mod\", \"$dep\");" ;;
+ esac
+ done ;;
+ esac
+ done
+ echo
+ donemods=" "
+ for mod in $binmods; do
+ echo "/* linked-in module \`$mod' */"
+ sed='/^ *'$mod' *:[^#:>]*$/{
+ s/.*://
+ p
+ }'
+ deps=`$CFSED "$sed" $XMODCF`
+ for dep in $deps; do
+ case $donemods in
+ *" $dep "*)
+ echo " /* depends on \`$dep' */" ;;
+ *) echo >&2 "ERROR: linked-in module \`$mod' depends on \`$dep'"
+ rm -f $1
+ exit 1 ;;
+ esac
+ done
+ echo " mod.nam = \"$mod\"; boot_$mod(&mod);"
+ donemods="$donemods$mod "
+ done
*** Src/mkstamp.sh 1997/01/02 00:27:21 3.1.1.0
--- Src/mkstamp.sh 1997/01/02 00:22:24
***************
*** 0 ****
--- 1,57 ----
+ #! /bin/sh
+ #
+ # $Id$
+ #
+ # Written by Andrew Main
+ #
+ srcdir=`echo $0|sed 's%/[^/][^/]*$%%'`
+ test "x$srcdir" = "x$0" && srcdir=.
+ CFSED=${CFSED-"sed -n -f $srcdir/conf.sed -e"}
+ MODBINS=${MODBINS-modules-bltin}
+ MODCF=${MODCF-$srcdir/mods.conf}
+ MODULE_DIRS=${MODULE_DIRS-'Modules Zle'}
+ MAKE=${MAKE-make}
+ STMP=$1
+
+ dn=true
+ test -f $STMP || dn=false
+ trap "rm -f $STMP.tmp; exit 1" 1 2 15
+ echo > $STMP.tmp
+ for mod in `cat $MODBINS`; do
+ sed='/^ *'$mod' *:[^#:>]*$/{
+ s/.*://
+ p
+ }'
+ objs=`$CFSED "$sed" $MODCF`
+ if test -z "$objs"; then
+ for dir in $MODULE_DIRS; do
+ if test -f $srcdir/$dir/$mod.c; then
+ objs=$dir/$mod.o
+ break
+ fi
+ done
+ if test -z "$objs"; then
+ echo >&2
+ "ERROR: don't know how to build module $mod"
+ rm -f $STMP.tmp
+ exit 1
+ fi
+ fi
+ eval "$MAKE $MAKEDEFS $objs" || { rm -f $STMP.tmp; exit 1; }
+ if test $dn = true; then
+ nobjs=`find . -name '*.o' -newer $STMP -print`
+ for obj in $objs; do
+ case $nobjs in
+ *./$obj*) dn=false ;;
+ esac
+ done
+ fi
+ echo $objs >> $STMP.tmp
+ done
+ if $dn && cmp -s $STMP.tmp $STMP; then
+ rm -f $STMP.tmp
+ echo "\`$STMP' is up to date."
+ else
+ mv -f $STMP.tmp $STMP
+ echo "Updated \`$STMP'."
+ fi
Messages sorted by:
Reverse Date,
Date,
Thread,
Author