[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 2 Fragen zu Makefiles



Jonas Meurer <jmeurer@gmx.de> writes:

> Nun wäre es mir aber wesentlich lieber wenn ich nicht jedes neue
> .wml-file dort eintragen müsste, und statt dessen make alle .wml-files
> selber findet. Also nach dem Motto:
> HTMLS = (code dass alle .wml-files hier stehen, am besten ohne .wml)
> Geht das irgendwie?
> Dann würde ich für jedes subdir dieses Makefile verwenden, und hieraus
> entspringt meine 2. Frage:
> Geht das auch mit directories?

Ich geb keine Garantie ob ich alles wichtige rausgefischt habe, aber
das hier steht im Emacs Makefile (lisp-dir). Und sieht eigentlich nach
dem aus was du willst. Evtl. auch einfach Overkill, aber siehs dir an. :)

-----++----
SHELL = /bin/sh

lisp=/develop/Emacs/Emacs/emacs/lisp
VPATH=/develop/Emacs/Emacs/emacs/lisp
srcdir=/develop/Emacs/Emacs/emacs/lisp/..

# Common command to find subdirectories

setwins=subdirs=`find $$wd -type d -print`; \
	for file in $$subdirs; do \
	   case $$file in */Old | */RCS | */CVS | */CVS/* | */=* ) ;; \
		*) wins="$$wins $$file" ;; \
	   esac; \
        done

finder_setwins=subdirs=`find $$wd -type d -print`; \
	for file in $$subdirs; do \
	   case $$file in */Old | */RCS | */CVS | */CVS/* | */=* | */obsolete | */term ) ;; \
		*) wins="$$wins $$file" ;; \
	   esac; \
        done

subdirs.el:
	$(MAKE) $(MFLAGS) update-subdirs
update-subdirs: doit
	wd=$(lisp); $(setwins); \
	for file in $$wins; do \
	   $(srcdir)/update-subdirs $$file; \
	done;

.SUFFIXES: .elc .el

.el.elc: subdirs.el
	-$(emacs) -f batch-byte-compile $<

# Compile all Lisp files, except those from DONTCOMPILE,
# but don't recompile those that are up to date.

# All .elc files are made writable
# before compilation in case we checked out read-only (CVS option -r).
# Files MUST be compiled one by one.  If we compile several files in a
# row we can't make sure that the compilation environment is clean.
# We also set the load-path of the Emacs used for compilation to the
# current directory and its subdirectories, to make sure require's and
# load's in the files being compiled find the right files.

compile: subdirs.el doit
	find $(lisp) -name "*.elc" -print | xargs chmod +w >/dev/null 2>&1; \
	wd=$(lisp); $(setwins);	\
	elpat=`echo $$wins | tr ' 	' '\012\012' | \
		sed -e 's|\(.\)$$|\1/|' -e 's|^\./||' -e 's|$$|*.el|'`;	\
	els=`echo $$elpat $(DONTCOMPILE) $(COMPILE_FIRST) | \
		tr '	 ' '\012\012' | sort | uniq -u`; \
	for el in $(COMPILE_FIRST) $$els; do \
	  echo Compiling $$el; \
	  $(emacs) -f batch-byte-compile-if-not-done $$el || exit 1; \
	done

# Compile all Lisp files, except those from DONTCOMPILE.  This
# is like `compile' but compiles files unconditionally.
compile-always: subdirs.el doit
	find $(lisp) -name "*.elc" -print | xargs chmod +w >/dev/null 2>&1; \
	wd=$(lisp); $(setwins);	\
	elpat=`echo $$wins | tr ' 	' '\012\012' | \
		sed -e 's|\(.\)$$|\1/|' -e 's|^\./||' -e 's|$$|*.el|'`;	\
	els=`echo $$elpat $(DONTCOMPILE) $(COMPILE_FIRST) | \
		tr '	 ' '\012\012' | sort | uniq -u`; \
	for el in $(COMPILE_FIRST) $$els; do \
	  echo Compiling $$el; \
	  $(emacs) -f batch-byte-compile $$el || exit 1; \
	done
----++-----

Wenn Du willst send ich dir auch das ganze, falls ich da was vergessen
haben sollte. Ausser latürnich du hast den Emacs Source :)

-- 
begin  OjE-ist-scheisse.txt
bye, Joerg
Registered Linux User #97793 @ http://counter.li.org
end



Reply to: