3 # make-dist: create an Emacs distribution tar file from the current
4 # source tree. This basically creates a duplicate directory
5 # structure, and then hard links into it only those files that should
6 # be distributed. This means that if you add a file with an odd name,
7 # you should make sure that this script will include it.
11 # Exit if a command fails.
14 # Print out each line we read, for debugging's sake.
20 while [ $# -gt 0 ]; do
30 echo "${progname}: Unrecognized argument: $1" >&2
37 # Make sure we're running in the right place.
38 if [ ! -d src
-o ! -f src
/lisp.h
-o ! -d lisp
-o ! -f lisp
/version.el
]; then
39 echo "${progname}: must run in the top directory of the Emacs" >&2
40 echo "distribution tree. Cd to that directory and try again." >&2
44 # Find out which version of Emacs this is.
45 version
=`grep 'defconst[ ]*emacs-version' lisp/version.el \
46 | sed -e 's/^.*"\([0-9]+\.[0-9]+\)\..*$/\1/'`
47 if [ ! "${version}" ]; then
48 echo "${progname}: can't find current emacs version in ./lisp/version.el." >&2
52 # Make sure the subdirectory is available.
53 tempparent
="make-dist.$$"
54 if [ -d ${tempparent} ]; then
55 echo "${progname}: staging directory ${tempparent} already exists.
56 Perhaps a previous invocation of ${progname} failed to clean up
57 after itself. Check that directories whose names are of the form
58 make-dist.NNNNN don't contain any important information, remove them,
63 echo "Creating staging directory: ${tempparent}"
65 emacsname
="emacs-${version}"
66 tempdir
="${tempparent}/${emacsname}"
68 echo "Creating top directory: ${tempdir}"
71 # We copy in the top-level files before creating the subdirectories in
72 # hopes that this will make the top-level files appear first in the
73 # tar file; this means that people can start reading the INSTALL and
74 # README while the rest of the tar file is still unpacking. Whoopee.
75 echo "Copying top-level files."
76 ln GETTING.GNU.SOFTWARE INSTALL PROBLEMS README
${tempdir}
77 ln ChangeLog Makefile.
in build-install.
in configure make-dist
${tempdir}
79 echo "Creating subdirectories."
80 for subdir
in lisp lisp
/term src src
/m src
/s lib-src oldXMenu \
81 etc lock local-lisp arch-lib cpp info man shortnames
; do
82 mkdir
${tempdir}/${subdir}
86 # Don't distribute =*.el files, site-init.el, or site-load.el.
88 ln [a-zA-Z
]*.el ..
/${tempdir}/lisp
89 ln [a-zA-Z
]*.elc ..
/${tempdir}/lisp
90 ln [a-zA-Z
]*.defns ..
/${tempdir}/lisp
91 ln ChangeLog README ..
/${tempdir}/lisp
93 rm -f site-init site-init.el site-init.elc
94 rm -f site-load site-load.el site-load.elc
)
96 echo "Copying lisp/term."
97 # Don't distribute =*.el files.
99 ln [a-zA-Z
]*.el ..
/..
/${tempdir}/lisp
/term
100 ln [a-zA-Z
]*.elc ..
/..
/${tempdir}/lisp
/term
101 ln README ..
/..
/${tempdir}/lisp
/term
)
104 # Don't distribute =*.[ch] files, or the configured versions of
105 # config.h.in, paths.h.in, or Makefile.in.
107 ln [a-zA-Z
]*.c ..
/${tempdir}/src
108 ln [a-zA-Z
]*.h ..
/${tempdir}/src
109 ln [a-zA-Z
]*.s ..
/${tempdir}/src
110 ln README Makefile.
in ymakefile ChangeLog config.h.
in paths.h.
in \
112 ln .gdbinit .dbxinit ..
/${tempdir}/src
113 ln *.com
*.opt vms-pp.trans vmsbuild ..
/${tempdir}/src
115 etags
*.h
*.c ..
/lisp
/*.el
)
117 echo "Copying src/m."
119 ln README
*.h ..
/..
/${tempdir}/src
/m
)
121 echo "Copying src/s."
123 ln README
*.h ..
/..
/${tempdir}/src
/s
)
125 echo "Copying lib-src."
127 ln [a-zA-Z
]*.c
[a-zA-Z
]*.h
[a-zA-Z
]*.y
[a-zA-Z
]*.
lex ..
/${tempdir}/lib-src
128 ln ChangeLog Makefile.
in README testfile ..
/${tempdir}/lib-src
)
130 echo "Copying oldXMenu."
132 ln *.c
*.h ..
/${tempdir}/oldXMenu
133 ln README Makefile Imakefile ChangeLog ..
/${tempdir}/oldXMenu
)
136 # Don't distribute DOC files, backups, autosaves, or tex litter.
138 ln [0-9a-zA-Z]* ..
/${tempdir}/etc
140 # Avoid an error when expanding the wildcards later.
141 for dummy
in DOC-dummy dummy~ \
#dummy\# dummy.dvi dummy.log; do
144 rm -f DOC
* *~ \
#*\# *.dvi *.log core)
146 # For now, we comment these out, since I'm not changing them any.
147 #!! echo "Copying cpp."
149 #!! ln cccp.c cexp.y Makefile README ../${tempdir}/cpp)
151 #!! echo "Copying info."
152 #!! # Don't distribute backups or autosaves.
154 #!! ln [a-zA-Z]* ../${tempdir}/info
155 #!! cd ../${tempdir}/info
156 #!! # Avoid an error when expanding the wildcards later.
157 #!! ln emacs dummy~ ; ln emacs \#dummy\#
158 #!! rm -f *~ \#*\# core)
160 #!! echo "Copying man."
162 #!! ln *.tex *.texinfo *.texi *.aux *.cps *.fns *.kys *.vrs ../${tempdir}/man
163 #!! ln *.c ../${tempdir}/man
164 #!! ln ChangeLog Makefile README split-man ../${tempdir}/man)
166 echo "Copying shortnames."
168 ln *.c ..
/${tempdir}/shortnames
169 ln Makefile reserved special ..
/${tempdir}/shortnames
)
171 echo "Making sure copying notices are symlinks."
172 if [ -f ${tempdir}/etc
/COPYING
]; then
173 rm ${tempdir}/etc
/COPYING
174 ln etc
/COPYING
${tempdir}/etc
/COPYING
176 for subdir
in lisp src lib-src info shortnames
; do
177 if [ -f ${tempdir}/${subdir}/COPYING
]; then
178 rm ${tempdir}/${subdir}/COPYING
180 ln -s ..
/etc
/COPYING
${tempdir}/${subdir}
183 if [ "${make_tar}" = yes ]; then
184 echo "Creating tar file."
185 (cd ${tempparent}; tar cvf - ${emacsname}) | compress > ${emacsname}.
tar.Z
188 if [ "${clean_up}" = yes ]; then
189 echo "Cleaning up the staging directory."