PageRenderTime 71ms CodeModel.GetById 33ms RepoModel.GetById 1ms app.codeStats 0ms

/src/Makefile

https://github.com/id774-2/emacs
Makefile | 182 lines | 134 code | 15 blank | 33 comment | 7 complexity | e60e2a879fc7bb99f5eef099f7d8e0a6 MD5 | raw file
  1. # Makefile for GNU Emacs.
  2. # Copyright (C) 1985, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, 2002,
  3. # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
  4. # Free Software Foundation, Inc.
  5. # This file is part of GNU Emacs.
  6. # GNU Emacs is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. # GNU Emacs is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. # You should have received a copy of the GNU General Public License
  15. # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  16. # Note that this file is edited by msdos/sed1v2.inp for MSDOS. That
  17. # script may need modifying in sync with changes made here. Try to
  18. # avoid shell-ism because the DOS build has to use the DOS shell.
  19. # Don't try to replace the cpp processing using autoconf facilities,
  20. # says rms.
  21. # Replacing a particular part of the conditionals to work via autoconf
  22. # is OK.
  23. # Some of the conditionals might be dead now. Finding them and
  24. # deleting them would be fine.
  25. # Here are the things that we expect ../configure to edit.
  26. # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
  27. srcdir=/home/debian/local/github/emacs/src
  28. VPATH=/home/debian/local/github/emacs/src
  29. CC=gcc
  30. CPP=gcc -E
  31. CFLAGS=-g -O2 -Wdeclaration-after-statement -Wno-pointer-sign
  32. CPPFLAGS=-D_BSD_SOURCE
  33. LDFLAGS= -Wl,-znocombreloc
  34. LN_S=ln -s
  35. EXEEXT=
  36. version=23.2
  37. # Substitute an assignment for the MAKE variable, because
  38. # BSD doesn't have it as a default.
  39. # Don't use LIBS. configure puts stuff in it that either shouldn't be
  40. # linked with Emacs or is duplicated by the cpp stuff below.
  41. # LIBS = -lncurses -lm
  42. LIBOBJS =
  43. lispsource = ${srcdir}/../lisp/
  44. libsrc = ../lib-src/
  45. etc = ../etc/
  46. oldXMenudir = ../oldXMenu/
  47. lwlibdir = ../lwlib/
  48. lispdir = ../lisp/
  49. # Configuration files for .o files to depend on.
  50. M_FILE = ${srcdir}/m/intel386.h
  51. S_FILE = ${srcdir}/s/gnu-linux.h
  52. config_h = config.h $(M_FILE) $(S_FILE)
  53. bootstrap_exe = ../src/bootstrap-emacs${EXEEXT}
  54. OTHER_FILES =
  55. # ========================== start of cpp stuff =======================
  56. C_SWITCH_SYSTEM=
  57. SHELL=/bin/sh
  58. DEPFLAGS = -MMD -MF deps/$*.d
  59. STARTFILES = pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o
  60. ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} -D_BSD_SOURCE ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${DBUS_CFLAGS} ${GCONF_CFLAGS} ${CFLAGS} ${DEPFLAGS}
  61. ALL_OBJC_CFLAGS=$(ALL_CFLAGS)
  62. .SUFFIXES: .m
  63. .c.o:
  64. @-test -d deps || mkdir deps
  65. $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
  66. .m.o:
  67. @-test -d deps || mkdir deps
  68. $(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $<
  69. LIBSOUND=
  70. CFLAGS_SOUND=
  71. RSVG_LIBS=
  72. RSVG_CFLAGS=
  73. GNULIB_VAR =
  74. LD=$(CC) -nostdlib
  75. TEMACS_LDFLAGS = -z nocombreloc
  76. INTERVALS_H = dispextern.h intervals.h composite.h
  77. GETLOADAVG_LIBS =
  78. obj= dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o charset.o coding.o category.o ccl.o character.o chartab.o cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) emacs.o keyboard.o macros.o keymap.o sysdep.o buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o dired.o filemode.o cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o alloc.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o font.o print.o lread.o syntax.o unexelf.o bytecode.o process.o callproc.o region-cache.o sound.o atimer.o doprnt.o strftime.o intervals.o textprop.o composite.o md5.o $(MSDOS_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_DRIVERS)
  79. SOME_MACHINE_OBJECTS = dosfns.o msdos.o xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o fontset.o dbusbind.o nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o w32.o w32console.o w32fns.o w32heap.o w32inevt.o w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o $(FONT_DRIVERS)
  80. termcapobj = terminfo.o
  81. mallocobj = $(gmallocobj) $(rallocobj) vm-limit.o
  82. widgetobj=
  83. otherobj= $(termcapobj) lastfile.o $(mallocobj) $(widgetobj) $(LIBOBJS)
  84. lisp= ${lispsource}loaddefs.el ${lispsource}abbrev.elc ${lispsource}buff-menu.elc ${lispsource}button.elc ${lispsource}emacs-lisp/byte-run.elc ${lispsource}composite.elc ${lispsource}cus-face.elc ${lispsource}cus-start.elc ${lispsource}custom.elc ${lispsource}emacs-lisp/backquote.elc ${lispsource}emacs-lisp/lisp-mode.elc ${lispsource}emacs-lisp/lisp.elc ${lispsource}env.elc ${lispsource}faces.elc ${lispsource}files.elc ${lispsource}format.elc ${lispsource}facemenu.elc ${lispsource}emacs-lisp/float-sup.elc ${lispsource}frame.elc ${lispsource}help.elc ${lispsource}indent.elc ${lispsource}isearch.elc ${lispsource}rfn-eshadow.elc ${lispsource}loadup.el ${lispsource}bindings.elc ${lispsource}emacs-lisp/map-ynp.elc ${lispsource}menu-bar.elc ${lispsource}international/mule.elc ${lispsource}international/mule-conf.elc ${lispsource}international/mule-cmds.elc ${lispsource}international/characters.elc ${lispsource}international/charprop.el ${lispsource}case-table.elc ${lispsource}language/chinese.elc ${lispsource}language/cyrillic.elc ${lispsource}language/indian.elc ${lispsource}language/sinhala.el ${lispsource}language/english.el ${lispsource}language/ethiopic.elc ${lispsource}language/european.elc ${lispsource}language/czech.el ${lispsource}language/slovak.el ${lispsource}language/romanian.el ${lispsource}language/greek.el ${lispsource}language/hebrew.el ${lispsource}language/japanese.el ${lispsource}language/korean.el ${lispsource}language/lao.el ${lispsource}language/cham.el ${lispsource}language/tai-viet.el ${lispsource}language/thai.el ${lispsource}language/tibetan.elc ${lispsource}language/vietnamese.elc ${lispsource}language/misc-lang.el ${lispsource}language/utf-8-lang.el ${lispsource}language/georgian.el ${lispsource}language/khmer.el ${lispsource}language/burmese.el ${lispsource}paths.el ${lispsource}register.elc ${lispsource}replace.elc ${lispsource}simple.elc ${lispsource}minibuffer.elc ${lispsource}startup.elc ${lispsource}subr.elc ${lispsource}term/tty-colors.elc ${lispsource}font-core.elc ${lispsource}emacs-lisp/syntax.elc ${lispsource}font-lock.elc ${lispsource}jit-lock.elc ${lispsource}textmodes/fill.elc ${lispsource}textmodes/page.elc ${lispsource}textmodes/paragraphs.elc ${lispsource}textmodes/text-mode.elc ${lispsource}emacs-lisp/timer.elc ${lispsource}jka-cmpr-hook.elc ${lispsource}vc-hooks.elc ${lispsource}ediff-hook.elc ${lispsource}epa-hook.elc ${lispsource}widget.elc ${lispsource}window.elc ${lispsource}version.el
  85. shortlisp= ../lisp/loaddefs.el ../lisp/abbrev.elc ../lisp/buff-menu.elc ../lisp/button.elc ../lisp/emacs-lisp/byte-run.elc ../lisp/composite.elc ../lisp/cus-face.elc ../lisp/cus-start.elc ../lisp/custom.elc ../lisp/emacs-lisp/backquote.elc ../lisp/emacs-lisp/lisp-mode.elc ../lisp/emacs-lisp/lisp.elc ../lisp/facemenu.elc ../lisp/faces.elc ../lisp/files.elc ../lisp/emacs-lisp/float-sup.elc ../lisp/format.elc ../lisp/frame.elc ../lisp/help.elc ../lisp/indent.elc ../lisp/isearch.elc ../lisp/rfn-eshadow.elc ../lisp/loadup.el ../lisp/bindings.elc ../lisp/emacs-lisp/map-ynp.elc ../lisp/env.elc ../lisp/international/mule.elc ../lisp/international/mule-conf.elc ../lisp/international/mule-cmds.elc ../lisp/international/characters.elc ../lisp/case-table.elc ../lisp/language/chinese.elc ../lisp/language/cyrillic.elc ../lisp/language/indian.elc ../lisp/language/sinhala.el ../lisp/language/english.el ../lisp/language/ethiopic.elc ../lisp/language/european.elc ../lisp/language/czech.el ../lisp/language/slovak.el ../lisp/language/romanian.el ../lisp/language/greek.el ../lisp/language/hebrew.el ../lisp/language/japanese.el ../lisp/language/korean.el ../lisp/language/lao.el ../lisp/language/cham.el ../lisp/language/tai-viet.el ../lisp/language/thai.el ../lisp/language/tibetan.elc ../lisp/language/vietnamese.elc ../lisp/language/misc-lang.el ../lisp/language/utf-8-lang.el ../lisp/language/georgian.el ../lisp/language/khmer.el ../lisp/language/burmese.el ../lisp/menu-bar.elc ../lisp/paths.el ../lisp/register.elc ../lisp/replace.elc ../lisp/simple.elc ../lisp/minibuffer.elc ../lisp/startup.elc ../lisp/subr.elc ../lisp/term/tty-colors.elc ../lisp/font-core.elc ../lisp/emacs-lisp/syntax.elc ../lisp/font-lock.elc ../lisp/jit-lock.elc ../lisp/textmodes/fill.elc ../lisp/textmodes/page.elc ../lisp/textmodes/paragraphs.elc ../lisp/textmodes/text-mode.elc ../lisp/emacs-lisp/timer.elc ../lisp/vc-hooks.elc ../lisp/jka-cmpr-hook.elc ../lisp/ediff-hook.elc ../lisp/epa-hook.elc ../lisp/widget.elc ../lisp/window.elc ../lisp/version.el
  86. SOME_MACHINE_LISP = ../lisp/mouse.elc ../lisp/select.elc ../lisp/scroll-bar.elc ../lisp/ls-lisp.elc ../lisp/dos-fns.elc ../lisp/w32-fns.elc ../lisp/dos-w32.elc ../lisp/disp-table.elc ../lisp/dos-vars.elc ../lisp/tooltip.elc ../lisp/image.elc ../lisp/fringe.elc ../lisp/dnd.elc ../lisp/mwheel.elc ../lisp/tool-bar.elc ../lisp/x-dnd.elc ../lisp/font-setting.elc ../lisp/international/ccl.elc ../lisp/international/fontset.elc ../lisp/mouse.elc ../lisp/term/common-win.elc ../lisp/term/x-win.elc ../lisp/term/pc-win.elc ../lisp/term/internal.elc ../lisp/term/ns-win.elc ../lisp/term/w32-win.elc ../lisp/emacs-lisp/easymenu.elc
  87. LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) $(RSVG_LIBS) $(DBUS_LIBS) -lncurses $(GETLOADAVG_LIBS) ${GCONF_LIBS} $(GNULIB_VAR) -lm -lgcc -lc -lgcc /usr/lib/crtn.o $(GNULIB_VAR)
  88. RUN_TEMACS = `/bin/pwd`/temacs
  89. all: emacs${EXEEXT} $(OTHER_FILES)
  90. emacs${EXEEXT}: temacs${EXEEXT} ${etc}DOC ${lisp}
  91. LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump
  92. @: This new Emacs is as functional and more efficient then
  93. @: bootstrap-emacs, so let us replace it.
  94. -ln -f emacs${EXEEXT} bootstrap-emacs${EXEEXT}
  95. -./emacs -q -batch -f list-load-path-shadows
  96. ${etc}DOC: ${libsrc}make-docfile${EXEEXT} ${obj} ${lisp} ${SOME_MACHINE_LISP}
  97. -rm -f ${etc}DOC
  98. ${libsrc}make-docfile -d ${srcdir} ${SOME_MACHINE_OBJECTS} ${obj} > ${etc}DOC
  99. ${libsrc}make-docfile -a ${etc}DOC -d ${srcdir} ${SOME_MACHINE_LISP} ${shortlisp}
  100. ${libsrc}make-docfile${EXEEXT}:
  101. cd ${libsrc}; ${MAKE} ${MFLAGS} make-docfile${EXEEXT}
  102. buildobj.h: Makefile
  103. echo "#define BUILDOBJ \"${obj} ${otherobj} " "\"" > buildobj.h
  104. temacs${EXEEXT}: $(LOCALCPP) $(STARTFILES) stamp-oldxmenu ${obj} ${otherobj} prefix-args${EXEEXT}
  105. $(LD) `./prefix-args -Xlinker ${STARTFLAGS} ${TEMACS_LDFLAGS}` $(LDFLAGS) -o temacs ${STARTFILES} ${obj} ${otherobj} ${LIBES}
  106. prefix-args${EXEEXT}: prefix-args.o $(config_h)
  107. $(CC) $(LDFLAGS) prefix-args.o -o prefix-args
  108. stamp-oldxmenu:
  109. touch stamp-oldxmenu
  110. ../config.status:: epaths.in
  111. @echo "The file epaths.h needs to be set up from epaths.in."
  112. @echo "Please run the `configure' script again."
  113. exit 1
  114. ../config.status:: config.in
  115. @echo "The file config.h needs to be set up from config.in."
  116. @echo "Please run the `configure' script again."
  117. exit 1
  118. ecrt0.o: ecrt0.c $(config_h)
  119. @-test -d deps || mkdir deps
  120. $(CC) -c $(ALL_CFLAGS) ${srcdir}/ecrt0.c
  121. doc.o: buildobj.h
  122. mostlyclean:
  123. rm -f temacs${EXEEXT} prefix-args${EXEEXT} core *.core \#* *.o libXMenu11.a liblw.a
  124. rm -f ../etc/DOC
  125. rm -f bootstrap-emacs${EXEEXT} emacs-${version}${EXEEXT}
  126. rm -f buildobj.h
  127. clean: mostlyclean
  128. rm -f emacs-*.*.*${EXEEXT} emacs${EXEEXT}
  129. -rm -rf deps
  130. bootstrap-clean: clean
  131. rm -f epaths.h config.h Makefile.c config.stamp stamp-oldxmenu ../etc/DOC-*
  132. if test -f ./.gdbinit; then mv ./.gdbinit ./.gdbinit.save; if test -f "${srcdir}/.gdbinit"; then rm -f ./.gdbinit.save; else mv ./.gdbinit.save ./.gdbinit; fi; fi
  133. distclean: bootstrap-clean
  134. rm -f Makefile
  135. maintainer-clean: distclean
  136. @echo "This command is intended for maintainers to use;"
  137. @echo "it deletes files that may require special tools to rebuild."
  138. rm -f TAGS
  139. versionclean:
  140. -rm -f emacs${EXEEXT} emacs-*.*.*${EXEEXT} ../etc/DOC*
  141. extraclean: distclean
  142. -rm -f *~ \#* m/?*~ s/?*~
  143. ctagsfiles1 = [xyzXYZ]*.[hcm]
  144. ctagsfiles2 = [a-wA-W]*.[hcm]
  145. TAGS: $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2)
  146. ../lib-src/etags --include=TAGS-LISP --include=${lwlibdir}/TAGS --regex='/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2)
  147. frc:
  148. TAGS-LISP: frc
  149. $(MAKE) -f ${lispdir}Makefile TAGS-LISP ETAGS=../lib-src/etags
  150. $(lwlibdir)TAGS:
  151. (cd $(lwlibdir); $(MAKE) -f $(lwlibdir)Makefile tags ETAGS=../lib-src/etags)
  152. tags: TAGS TAGS-LISP $(lwlibdir)TAGS
  153. .PHONY: tags
  154. .SUFFIXES: .elc .el
  155. .el.elc:
  156. @cd ../lisp; $(MAKE) $(MFLAGS) compile-onefile THEFILE=$< EMACS=${bootstrap_exe}
  157. ${lisp} ${SOME_MACHINE_LISP}: $(BOOTSTRAPEMACS)
  158. ${lispsource}loaddefs.el: $(BOOTSTRAPEMACS)
  159. cd ../lisp; $(MAKE) $(MFLAGS) autoloads EMACS=${bootstrap_exe}
  160. bootstrap-emacs${EXEEXT}: temacs${EXEEXT}
  161. cd ../lisp; $(MAKE) $(MFLAGS) update-subdirs
  162. $(RUN_TEMACS) --batch --load loadup bootstrap
  163. mv -f emacs${EXEEXT} bootstrap-emacs${EXEEXT}
  164. @: Compile some files earlier to speed up further compilation.
  165. cd ../lisp; $(MAKE) $(MFLAGS) compile-first EMACS=${bootstrap_exe}
  166. ALLOBJS=$(STARTFILES) ${obj} ${otherobj} prefix-args.o
  167. -include $(ALLOBJS:%.o=deps/%.d)