aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2023-07-19 09:53:58 +0800
committerPo Lu2023-07-19 09:53:58 +0800
commit69828fba2874e305079bf5f1a25834dbd620b2f3 (patch)
tree2c2e5b3ddd12bb73ed4903d4e64ebc163a729e83 /src
parent5a3de76532056e03b674b1cb7d4e0d9e15a2a971 (diff)
downloademacs-69828fba2874e305079bf5f1a25834dbd620b2f3.tar.gz
emacs-69828fba2874e305079bf5f1a25834dbd620b2f3.zip
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')
-rw-r--r--src/Makefile.in31
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)
43vpath %.h := $(srcdir) 43vpath %.h := $(srcdir)
44endif 44endif
45 45
46# abs_top_builddir is the name of the toplevel build directory under
47# cross-compiled builds.
48abs_top_builddir = @abs_top_builddir@
49
46CC = @CC@ 50CC = @CC@
47CXX = @CXX@ 51CXX = @CXX@
48CFLAGS = @CFLAGS@ 52CFLAGS = @CFLAGS@
@@ -510,9 +514,22 @@ PRE_ALLOC_OBJ=@PRE_ALLOC_OBJ@
510## lastfile.o on Cygwin and MinGW, empty elsewhere. 514## lastfile.o on Cygwin and MinGW, empty elsewhere.
511POST_ALLOC_OBJ=@POST_ALLOC_OBJ@ 515POST_ALLOC_OBJ=@POST_ALLOC_OBJ@
512 516
517## Builds using libemacs.so (Android) don't dump Emacs within this
518## Makefile, but on device. Make sure the library hash changes for
519## each change in shortlisp by linking an object that changes
520## accordingly to it.
521BUILD_COUNTER_OBJ =
522ifeq ($(XCONFIGURE),android)
523BUILD_COUNTER_OBJ = build-counter.o
524
525# This file is then compiled into build-counter.so
526build-counter.c: $(abs_top_builddir)/src/lisp.mk $(shortlisp)
527 $(AM_V_GEN) $(top_srcdir)/build-aux/makecounter.sh $@
528endif
529
513## List of object files that make-docfile should not be told about. 530## List of object files that make-docfile should not be told about.
514otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \ 531otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \
515 $(POST_ALLOC_OBJ) $(WIDGET_OBJ) $(LIBOBJS) 532 $(POST_ALLOC_OBJ) $(WIDGET_OBJ) $(LIBOBJS) $(BUILD_COUNTER_OBJ)
516 533
517## All object files linked into temacs. $(VMLIMIT_OBJ) should be first. 534## All object files linked into temacs. $(VMLIMIT_OBJ) should be first.
518## (On MinGW, firstfile.o should be before vm-limit.o.) 535## (On MinGW, firstfile.o should be before vm-limit.o.)
@@ -565,15 +582,19 @@ endif
565## we need to remove leim-list, site-init, and site-load by hand. 582## we need to remove leim-list, site-init, and site-load by hand.
566## There's not much to choose between these two approaches, 583## There's not much to choose between these two approaches,
567## but the second one seems like it could be more future-proof. 584## but the second one seems like it could be more future-proof.
585##
586## This list is placed in the toplevel build directory to prevent it
587## from being unnecessarily regenerated by the successive use of this
588## Makefile within cross/Makefile.
568shortlisp = 589shortlisp =
569lisp.mk: $(lispsource)/loadup.el 590$(abs_top_builddir)/src/lisp.mk: $(lispsource)/loadup.el
570 ${AM_V_GEN}( printf 'shortlisp = \\\n'; \ 591 ${AM_V_GEN}( printf 'shortlisp = \\\n'; \
571 sed -n 's/^[ \t]*(load "\([^"]*\)".*/\1/p' $< | \ 592 sed -n 's/^[ \t]*(load "\([^"]*\)".*/\1/p' $< | \
572 sed -e 's/$$/.elc \\/' -e 's/\.el\.elc/.el/'; \ 593 sed -e 's/$$/.elc \\/' -e 's/\.el\.elc/.el/'; \
573 echo "" ) > $@.tmp 594 echo "" ) > $@.tmp
574 $(AM_V_at)mv -f $@.tmp $@ 595 $(AM_V_at)mv -f $@.tmp $@
575 596
576-include lisp.mk 597-include $(abs_top_builddir)/src/lisp.mk
577shortlisp_filter = leim/leim-list.el site-load.elc site-init.elc 598shortlisp_filter = leim/leim-list.el site-load.elc site-init.elc
578shortlisp := $(filter-out ${shortlisp_filter},${shortlisp}) 599shortlisp := $(filter-out ${shortlisp_filter},${shortlisp})
579## Place loaddefs.el first, so it gets generated first, since it is on 600## Place loaddefs.el first, so it gets generated first, since it is on
@@ -640,7 +661,7 @@ SYSTEM_TYPE = @SYSTEM_TYPE@
640## since not all pieces are used on all platforms. But DOC depends 661## since not all pieces are used on all platforms. But DOC depends
641## on all of $lisp, and emacs depends on DOC, so it is ok to use $lisp here. 662## on all of $lisp, and emacs depends on DOC, so it is ok to use $lisp here.
642emacs$(EXEEXT): temacs$(EXEEXT) \ 663emacs$(EXEEXT): temacs$(EXEEXT) \
643 lisp.mk $(etc)/DOC $(lisp) \ 664 $(abs_top_builddir)/src/lisp.mk $(etc)/DOC $(lisp) \
644 $(lispsource)/international/charprop.el ${charsets} 665 $(lispsource)/international/charprop.el ${charsets}
645ifeq ($(SYSTEM_TYPE),cygwin) 666ifeq ($(SYSTEM_TYPE),cygwin)
646 find ${top_builddir} -name '*.eln' | rebase -v -O -T - 667 find ${top_builddir} -name '*.eln' | rebase -v -O -T -
@@ -808,7 +829,7 @@ ns-app: emacs$(EXEEXT) $(pdmp)
808 829
809mostlyclean: 830mostlyclean:
810 rm -f android-emacs libemacs.so 831 rm -f android-emacs libemacs.so
811 rm -f temacs$(EXEEXT) core ./*.core \#* ./*.o 832 rm -f temacs$(EXEEXT) core ./*.core \#* ./*.o build-counter.c
812 rm -f dmpstruct.h 833 rm -f dmpstruct.h
813 rm -f emacs.pdmp 834 rm -f emacs.pdmp
814 rm -f ../etc/DOC 835 rm -f ../etc/DOC