diff options
| author | Po Lu <luangruo@yahoo.com> | 2023-07-19 09:53:58 +0800 |
|---|---|---|
| committer | Po Lu <luangruo@yahoo.com> | 2023-07-19 09:53:58 +0800 |
| commit | 69828fba2874e305079bf5f1a25834dbd620b2f3 (patch) | |
| tree | 2c2e5b3ddd12bb73ed4903d4e64ebc163a729e83 /src/Makefile.in | |
| parent | 5a3de76532056e03b674b1cb7d4e0d9e15a2a971 (diff) | |
Make sure Android builds are redumped upon changes to shortlisp
* build-aux/makecounter.sh: New script.
* src/Makefile.in (abs_top_builddir): New variable.
(BUILD_COUNTER_OBJ): Define to build-counter.o
if compiling for Android.
(build-counter.c): New target. Generate this file using
makecounter.sh upon changes to lisp.mk or shortlisp.
(lisp.mk): Make and load relative to abs_top_builddir.
(emacs$(EXEEXT)): Adjust acordingly.
(mostlyclean): Remove build-counter.c.
Diffstat (limited to 'src/Makefile.in')
| -rw-r--r-- | src/Makefile.in | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index 8cbdd67378c..36f3876f659 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -43,6 +43,10 @@ vpath %.c := $(srcdir) vpath %.h := $(srcdir) endif +# abs_top_builddir is the name of the toplevel build directory under +# cross-compiled builds. +abs_top_builddir = @abs_top_builddir@ + CC = @CC@ CXX = @CXX@ CFLAGS = @CFLAGS@ @@ -510,9 +514,22 @@ PRE_ALLOC_OBJ=@PRE_ALLOC_OBJ@ ## lastfile.o on Cygwin and MinGW, empty elsewhere. POST_ALLOC_OBJ=@POST_ALLOC_OBJ@ +## Builds using libemacs.so (Android) don't dump Emacs within this +## Makefile, but on device. Make sure the library hash changes for +## each change in shortlisp by linking an object that changes +## accordingly to it. +BUILD_COUNTER_OBJ = +ifeq ($(XCONFIGURE),android) +BUILD_COUNTER_OBJ = build-counter.o + +# This file is then compiled into build-counter.so +build-counter.c: $(abs_top_builddir)/src/lisp.mk $(shortlisp) + $(AM_V_GEN) $(top_srcdir)/build-aux/makecounter.sh $@ +endif + ## List of object files that make-docfile should not be told about. otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \ - $(POST_ALLOC_OBJ) $(WIDGET_OBJ) $(LIBOBJS) + $(POST_ALLOC_OBJ) $(WIDGET_OBJ) $(LIBOBJS) $(BUILD_COUNTER_OBJ) ## All object files linked into temacs. $(VMLIMIT_OBJ) should be first. ## (On MinGW, firstfile.o should be before vm-limit.o.) @@ -565,15 +582,19 @@ endif ## we need to remove leim-list, site-init, and site-load by hand. ## There's not much to choose between these two approaches, ## but the second one seems like it could be more future-proof. +## +## This list is placed in the toplevel build directory to prevent it +## from being unnecessarily regenerated by the successive use of this +## Makefile within cross/Makefile. shortlisp = -lisp.mk: $(lispsource)/loadup.el +$(abs_top_builddir)/src/lisp.mk: $(lispsource)/loadup.el ${AM_V_GEN}( printf 'shortlisp = \\\n'; \ sed -n 's/^[ \t]*(load "\([^"]*\)".*/\1/p' $< | \ sed -e 's/$$/.elc \\/' -e 's/\.el\.elc/.el/'; \ echo "" ) > $@.tmp $(AM_V_at)mv -f $@.tmp $@ --include lisp.mk +-include $(abs_top_builddir)/src/lisp.mk shortlisp_filter = leim/leim-list.el site-load.elc site-init.elc shortlisp := $(filter-out ${shortlisp_filter},${shortlisp}) ## Place loaddefs.el first, so it gets generated first, since it is on @@ -640,7 +661,7 @@ SYSTEM_TYPE = @SYSTEM_TYPE@ ## since not all pieces are used on all platforms. But DOC depends ## on all of $lisp, and emacs depends on DOC, so it is ok to use $lisp here. emacs$(EXEEXT): temacs$(EXEEXT) \ - lisp.mk $(etc)/DOC $(lisp) \ + $(abs_top_builddir)/src/lisp.mk $(etc)/DOC $(lisp) \ $(lispsource)/international/charprop.el ${charsets} ifeq ($(SYSTEM_TYPE),cygwin) find ${top_builddir} -name '*.eln' | rebase -v -O -T - @@ -808,7 +829,7 @@ ns-app: emacs$(EXEEXT) $(pdmp) mostlyclean: rm -f android-emacs libemacs.so - rm -f temacs$(EXEEXT) core ./*.core \#* ./*.o + rm -f temacs$(EXEEXT) core ./*.core \#* ./*.o build-counter.c rm -f dmpstruct.h rm -f emacs.pdmp rm -f ../etc/DOC |
