Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

more Makefile fixes



-----BEGIN PGP SIGNED MESSAGE-----

Happy new year, everyone.

This patch tweaks the Makefiles some more, w.r.t. linked-in modules.
It uses an extra make variable, modified when recursing, to avoid using
either test -nt or find.  It moves the $(CFSED) commands into a separate
file, avoiding variation in the interpretation of labels.  It also makes
linked-in module objects be built in the module's subdirectory, avoiding
some unnecessary -I flags for compilation of zsh itself.  (And, of course,
making it possible for a module object to have unusual dependencies or
build rules without the Src/ Makefile having to know about it.)

This applies to the 3.1.1-test1 release.

 -zefram

      *** Src/Makefile.in	1996/12/31 17:08:40	1.28
      --- Src/Makefile.in	1997/01/01 04:38:34
      ***************
      *** 54,60 ****
        DLLDFLAGS = @DLLDFLAGS@
        EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
        
      ! INCLUDES = -I.. -I. -I$(srcdir) -I$(MODULE_DIR) -IZle -I$(srcdir)/Zle
        
        DNCFLAGS =
        
      --- 54,60 ----
        DLLDFLAGS = @DLLDFLAGS@
        EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
        
      ! INCLUDES = -I.. -I. -I$(srcdir)
        
        DNCFLAGS =
        
      ***************
      *** 75,80 ****
      --- 75,82 ----
        prefix='$(prefix)' exec_prefix='$(exec_prefix)' bindir='$(bindir)' \
        libdir='$(libdir)' infodir='$(infodir)' mandir='$(mandir)' manext='$(manext)'
        
      + EXTRA_BUILDACT = :
      + 
        KNR_OBJ=.o
        KNROBJ=._foo_
        
      ***************
      *** 86,96 ****
      --- 88,100 ----
        
        .c$(ANSI@U@OBJ):
        	$(COMPILE) -o $@ $<
      + 	@$(EXTRA_BUILDACT)
        
        .c$(KNR@U@OBJ):
        	./ansi2knr $< > $@.c
        	$(COMPILE) -o $@ $@.c
        	rm -f $@.c
      + 	@$(EXTRA_BUILDACT)
        
        .c.pro:
        	$(SED) -n -f $(srcdir)/makepro.sed $< > $@
      ***************
      *** 153,159 ****
        XMODCF  = $(srcdir)/xmods.conf
        MODBINS = modules-bltin
        
      ! CFSED   = ':1;/\\$$/{N;s/\\\n//;b1;};s/	/ /g;/^ *$$/d'
        
        # ========= DEPENDENCIES FOR BUILDING ==========
        
      --- 157,163 ----
        XMODCF  = $(srcdir)/xmods.conf
        MODBINS = modules-bltin
        
      ! CFSED   = -f $(srcdir)/conf.sed
        
        # ========= DEPENDENCIES FOR BUILDING ==========
        
      ***************
      *** 210,228 ****
        	@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 "*) \
      --- 214,232 ----
        	@echo "Creating \`$@'."
        	@( \
        	    binmods=`sed 's/^/ /;s/$$/ /' $(MODBINS)`; \
      ! 	    sed='/^[^:>]*>[^:>]*$$/{s/>.*//;p;}'; \
      ! 	    xmods=`sed -n $(CFSED) -e "$$sed" $(XMODCF)`; \
        	    for mod in $$xmods; do \
        		case $$binmods in \
        		    *" $$mod "*) ;; \
        		    *)  echo "/* non-linked-in known module \`$$mod' */"; \
      ! 			sed='/^ *'$$mod' *>[^:>]*$$/{s/.*>//;p;}'; \
      ! 			bins=`sed -n $(CFSED) -e "$$sed" $(XMODCF)`; \
        			for bin in $$bins; do \
        			    echo "    add_autobin(\"$$bin\", \"$$mod\");"; \
        			done; \
      ! 			sed='/^ *'$$mod' *:[^:>]*$$/{s/.*://;p;}'; \
      ! 			deps=`sed -n $(CFSED) -e "$$sed" $(XMODCF)`; \
        			for dep in $$deps; do \
        			    case $$binmods in \
        				*" $$dep "*) \
      ***************
      *** 236,243 ****
        	    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 "*) \
      --- 240,247 ----
        	    donemods=" "; \
        	    for mod in $$binmods; do \
        		echo "/* linked-in module \`$$mod' */"; \
      ! 		sed='/^ *'$$mod' *:[^:>]*$$/{s/.*://;p;}'; \
      ! 		deps=`sed -n $(CFSED) -e "$$sed" $(XMODCF)`; \
        		for dep in $$deps; do \
        		    case $$donemods in \
        			*" $$dep "*) \
      ***************
      *** 256,263 ****
        	@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 "*) \
      --- 260,267 ----
        	@echo "Creating \`$@'."
        	@( \
        	    binmods=`sed 's/^/ /;s/$$/ /' $(MODBINS)`; \
      ! 	    sed='/^[^:>]*>[^:>]*$$/{s/>.*//;p;}'; \
      ! 	    xmods=`sed -n $(CFSED) -e "$$sed" $(XMODCF)`; \
        	    for mod in $$xmods; do \
        		case $$binmods in \
        		    *" $$mod "*) \
      ***************
      *** 273,279 ****
        
        $(MODBINS):
        	if test @D@ = N; then \
      ! 	    sed -n -e $(CFSED) -e '/^[^#:>]*>[^#:>]*$$/{s/>.*//;p;}' $(XMODCF) > $@; \
        	else \
        	    echo > $@; \
        	fi
      --- 277,283 ----
        
        $(MODBINS):
        	if test @D@ = N; then \
      ! 	    sed -n $(CFSED) -e '/^[^:>]*>[^:>]*$$/{s/>.*//;p;}' $(XMODCF) > $@; \
        	else \
        	    echo > $@; \
        	fi
      ***************
      *** 283,294 ****
        $(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 \
      --- 287,297 ----
        $(PROTO): makepro.sed
        
        $(NSTMP): FORCE
      ! 	@act="rm -f `pwd`/$(NSTMP)"; \
        	echo > $(NSTMP).tmp; \
        	for mod in `cat $(MODBINS)`; do \
      ! 	    sed='/^ *'$$mod' *:[^:>]*$$/{s/.*://;p;}'; \
      ! 	    objs=`sed -n $(CFSED) -e "$$sed" $(MODCF)`; \
        	    if test -z "$$objs"; then \
        		for dir in $(MODULE_DIRS); do \
        		    if test -f $(srcdir)/$$dir/$$mod.c; then \
      ***************
      *** 302,319 ****
        		    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 \
      --- 305,318 ----
        		    exit 1; \
        		fi; \
        	    fi; \
      ! 	    bdir=`echo $$objs | sed 's, .*$$,,;s,^,./,;s,/[^/]*$$,,'`; \
      ! 	    bobjs=`echo '' $$objs | sed 's, [^ ]*/, ,g'`; \
      ! 	    ( cd $$bdir && \
      ! 		$(MAKE) $(MAKEDEFS) EXTRA_BUILDACT="$$act" $$bobjs ) || \
      ! 		    exit 1; \
        	    echo $$objs >> $(NSTMP).tmp; \
        	done; \
      ! 	if cmp -s $(NSTMP).tmp $(NSTMP); then \
        	    rm -f $(NSTMP).tmp; \
        	    echo "\`$(NSTMP)' is up to date."; \
        	else \
      *** ............/dev/null	Thu Sep  7 20:04:30 1995
      --- Src/conf.sed	Wed Jan  1 04:03:34 1997
      ***************
      *** 0 ****
      --- 1,9 ----
      + :1
      + /\\$/{
      +     N
      +     s/\\\n//
      +     b1
      + }
      + s/	/ /g
      + s/#.*$//
      + /^ *$/d
      *** Src/mods.conf	1996/12/26 19:13:27	1.2
      --- Src/mods.conf	1997/01/01 04:04:30
      ***************
      *** 13,20 ****
        # Each entry has the form:
        #     module_name : Dir/object.o ...
        #
      ! # Lines containing `#' *anywhere* are ignored, as are blank lines.  Lines may
      ! # be continued using the usual backslash/newline syntax.
        #
        # (This would be rather neater if we could rely on shell functions in sh.)
        #
      --- 13,20 ----
        # Each entry has the form:
        #     module_name : Dir/object.o ...
        #
      ! # `#' starts a comment, and blank lines are ignored.  Lines may be continued
      ! # using the usual backslash/newline syntax.
        #
        # (This would be rather neater if we could rely on shell functions in sh.)
        #
      *** Src/xmods.conf	1996/12/24 20:36:42	1.1
      --- Src/xmods.conf	1997/01/01 04:04:40
      ***************
      *** 18,25 ****
        # is linked in, the other modules must also be, and must be listed earlier in
        # modules-bltin (and, consequently, here).
        #
      ! # Lines containing `#' *anywhere* are ignored, as are blank lines.  Lines may
      ! # be continued using the usual backslash/newline syntax.
        #
        # (This would be rather neater if we could rely on shell functions in sh.)
        #
      --- 18,25 ----
        # is linked in, the other modules must also be, and must be listed earlier in
        # modules-bltin (and, consequently, here).
        #
      ! # `#' starts a comment, and blank lines are ignored.  Lines may be continued
      ! # using the usual backslash/newline syntax.
        #
        # (This would be rather neater if we could rely on shell functions in sh.)
        #
      *** Src/Modules/Makefile.in	1996/12/31 17:08:53	1.12
      --- Src/Modules/Makefile.in	1997/01/01 04:12:58
      ***************
      *** 64,69 ****
      --- 64,71 ----
        
        SED = sed
        
      + EXTRA_BUILDACT = :
      + 
        KNR_OBJ=.o
        KNROBJ=._foo_
        
      ***************
      *** 75,85 ****
      --- 77,89 ----
        
        .c$(ANSI@U@OBJ):
        	$(COMPILE) -o $@ $<
      + 	@$(EXTRA_BUILDACT)
        
        .c$(KNR@U@OBJ):
        	../ansi2knr $< > $@.c
        	$(COMPILE) -o $@ $@.c
        	rm -f $@.c
      + 	@$(EXTRA_BUILDACT)
        
        .c.$(ANSI@U@OBJ):
        	$(DLCOMPILE) -o $@ $<
      *** Src/Zle/Makefile.in	1996/12/31 17:08:55	1.12
      --- Src/Zle/Makefile.in	1997/01/01 04:34:25
      ***************
      *** 63,68 ****
      --- 63,70 ----
        
        SED = sed
        
      + EXTRA_BUILDACT = :
      + 
        KNR_OBJ=.o
        KNROBJ=._foo_
        
      ***************
      *** 74,84 ****
      --- 76,88 ----
        
        .c$(ANSI@U@OBJ):
        	$(COMPILE) -o $@ $<
      + 	@$(EXTRA_BUILDACT)
        
        .c$(KNR@U@OBJ):
        	../ansi2knr $< > $@.c
        	$(COMPILE) -o $@ $@.c
        	rm -f $@.c
      + 	@$(EXTRA_BUILDACT)
        
        .c.$(ANSI@U@OBJ):
        	$(DLCOMPILE) -o $@ $<

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBMsnv+XD/+HJTpU/hAQHl2QP/RfMnsg+drJbJiktGo20Y/xJgmmYRQ/uR
7Kp2Hs2GIDSQgMBETKyn7JQDVvEospEYabRHW8l0m13rwBbO4ud4fxKkD0HNwmZm
4BtMgs4y5JeeaP91r7iuiL7v1yLl7cIvpEUYCTcRh/bpMqjXqqWApYv1jSC44Z6H
7lL2KW1Q0Zc=
=bnZr
-----END PGP SIGNATURE-----



Messages sorted by: Reverse Date, Date, Thread, Author