XEmacs 21.4.20 "Double Solitaire".
[chise/xemacs-chise.git.1] / lib-src / Makefile.in.in
index fcc6f86..30fbb7b 100644 (file)
@@ -53,8 +53,14 @@ exec_prefix=@exec_prefix@
 bindir=@bindir@
 libdir=@libdir@
 srcdir=@srcdir@
+datadir=@datadir@
+instvardir=@instvardir@
+top_srcdir=@top_srcdir@
 archlibdir=@archlibdir@
 configuration=@configuration@
+moduledir=@moduledir@
+sitemoduledir=@sitemoduledir@
+
 ## ==================== Utility Programs for the Build =================
 
 INSTALL = @install_pp@ @INSTALL@
@@ -67,34 +73,68 @@ INSTALL_DATA = @INSTALL_DATA@
 #define NOT_C_CODE
 #include "../src/config.h"
 
-## Things that a user might actually run,
-## which should be installed in bindir.
-INSTALLABLES_BASE = etags ctags b2m gnuclient ootags
-INSTALLABLE_SCRIPTS = rcs-checkin pstogif gnudoit gnuattach
+#ifndef WIN32_NATIVE
+#define INSTALL_GNUSERV
+#endif
+
+## ----------------------------------------------------------------
+## Things that a user might actually run directly,
+## which should be installed in ${bindir}.
+
+PUBLIC_INSTALLABLE_EXES=\
+#ifdef INSTALL_GNUSERV
+ gnuclient\
+#endif
+#ifdef HAVE_SHLIB
+ ellcc\
+#endif
 #ifdef HAVE_MS_WINDOWS
-INSTALLABLES = $(INSTALLABLES_BASE) runemacs
-#else
-INSTALLABLES = $(INSTALLABLES_BASE) 
+ winclient\
 #endif
+ etags ctags b2m ootags
 
+PUBLIC_INSTALLABLE_SCRIPTS=\
+#ifdef INSTALL_GNUSERV
+ gnudoit gnuattach\
+#endif
+ rcs-checkin
+
+PUBLIC_INSTALLABLES = ${PUBLIC_INSTALLABLE_EXES} ${PUBLIC_INSTALLABLE_SCRIPTS}
+
+## ----------------------------------------------------------------
+## Things that XEmacs runs internally on the user's behalf,
+## which should be installed in ${archlibdir}.
 
-## Things that Emacs runs internally, or during the build process,
-## which should not be installed in bindir.
-UTILITIES= make-path wakeup profile make-docfile digest-doc \
-       sorted-doc movemail cvtmail fakemail yow hexl \
-       gnuserv mmencode
-## These need to be conditional on I18N3 make-msgfile make-po
+PRIVATE_INSTALLABLE_EXES=\
+#ifdef INSTALL_GNUSERV
+ gnuserv\
+#endif
+#ifdef WIN32_NATIVE
+ i minitar\
+#else
+ fakemail\
+#endif
+ wakeup profile make-docfile digest-doc\
+ sorted-doc movemail cvtmail yow hexl mmencode
 
-## Like UTILITIES, but they are not system-dependent, and should not be
-## deleted by the distclean target.
 GEN_SCRIPTS = rcs2log vcdiff gzip-el.sh
 PKG_SCRIPTS = add-big-package.sh
-SCRIPTS = $(GEN_SCRIPTS) $(PKG_SCRIPTS)
+PRIVATE_INSTALLABLE_SCRIPTS = $(GEN_SCRIPTS) $(PKG_SCRIPTS)
 
-EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
+PRIVATE_INSTALLABLES = ${PRIVATE_INSTALLABLE_EXES} ${PRIVATE_INSTALLABLE_SCRIPTS}
+
+## These need to be conditional on I18N3: make-msgfile make-po
+
+## ----------------------------------------------------------------
+## Things that XEmacs uses during the build process itself.
+## Not installed.
+
+BUILD_UTILITIES = make-path make-dump-id
+
+EXES    = ${PUBLIC_INSTALLABLE_EXES} ${PRIVATE_INSTALLABLE_EXES} ${BUILD_UTILITIES}
+SCRIPTS = ${PUBLIC_INSTALLABLE_SCRIPTS} ${PRIVATE_INSTALLABLE_SCRIPTS}
+PROGS   = ${EXES} ${SCRIPTS}
 
-SOURCES = COPYING ChangeLog Makefile.in.in README aixcc.lex emacs.csh \
-       makedoc.com *.[chy] $(SCRIPTS)
 ## Additional -D flags for movemail (add to MOVE_FLAGS if desired):
 ## MAIL_USE_POP                Support mail retrieval from a POP mailbox.
 ## MAIL_USE_MMDF               Support MMDF mailboxes.
@@ -138,7 +178,13 @@ ld_libs_general=@ld_libs_general@
 
 ## We need to #define emacs to get the right versions of some files.
 
-cppflags = -Demacs -I../src $(CPPFLAGS)
+## To understand the order of -I flags, consider what happens if you run
+## ./configure in the source tree, and then run
+## $(srcdir).2.26/configure in some other build tree.
+## Where will the generated files like config.h be included from?
+## This is also why you _must_ use <...> instead of "..." 
+## when #include'ing generated files.
+cppflags = -I. -I../src -I$(srcdir) -I$(top_srcdir)/src $(CPPFLAGS)
 cflags   = $(CFLAGS) $(cppflags) $(c_switch_general)
 ldflags  = $(LDFLAGS) $(ld_switch_general) $(ld_libs_general)
 
@@ -149,14 +195,15 @@ ldflags  = $(LDFLAGS) $(ld_switch_general) $(ld_libs_general)
 .c.o:
        ${CC} -c $(cflags) $<
 
-all: ${UTILITIES} ${INSTALLABLES} srcdir-symlink.stamp
+.PHONY : all maybe-blessmail install uninstall check
+
+all: ${PROGS}
 
 ## Make symlinks for shell scripts if using --srcdir
-srcdir-symlink.stamp:
+${SCRIPTS}:
        for f in ${SCRIPTS}; do \
                if test ! -r $$f; then ${LN_S} ${srcdir}/$$f $$f; fi; \
-       done; \
-       touch $@;
+       done
 
 #undef MOVEMAIL_NEEDS_BLESSING
 #if !defined (MAIL_USE_FLOCK) && ! defined (MAIL_USE_LOCKF)
@@ -194,56 +241,45 @@ ${archlibdir}: all
        @echo; echo "Installing utilities run internally by XEmacs."
        ./make-path ${archlibdir}
        if test "`(cd ${archlibdir} && $(pwd))`" != "`$(pwd)`"; then \
-         for f in ${UTILITIES}; do \
+         for f in ${PRIVATE_INSTALLABLE_EXES}; do \
            (cd .. && $(INSTALL_PROGRAM) lib-src/$$f ${archlibdir}/$$f) ; \
          done ; \
        fi
        if test "`(cd ${archlibdir} && $(pwd))`" \
             != "`(cd ${srcdir}     && $(pwd))`"; then \
-         for f in ${SCRIPTS}; do \
+         for f in ${PRIVATE_INSTALLABLE_SCRIPTS}; do \
            (cd .. && $(INSTALL_PROGRAM) ${srcdir}/$$f ${archlibdir}/$$f); \
          done ; \
        fi
 
-## We do not need to install "wakeup" explicitly, because it will be
-## copied when this whole directory is copied.
-.PHONY : all maybe-blessmail install uninstall
 install: ${archlibdir}
        @echo; echo "Installing utilities for users to run."
-       for file in ${INSTALLABLES} ; do \
+       for file in ${PUBLIC_INSTALLABLE_EXES} ; do \
          (cd .. && $(INSTALL_PROGRAM) lib-src/$${file} ${bindir}/$${file}) ; \
        done
-       for file in ${INSTALLABLE_SCRIPTS} ; do \
+       for file in ${PUBLIC_INSTALLABLE_SCRIPTS} ; do \
          (cd .. && $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file}) ; \
        done
 
 uninstall:
-       (cd ${bindir} && \
-        $(RM) ${INSTALLABLES} ${INSTALLABLE_SCRIPTS})
-       (cd ${archlibdir} && \
-        $(RM) ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
+       cd ${bindir} && $(RM) ${PUBLIC_INSTALLABLES}
+       cd ${archlibdir} && $(RM) ${PRIVATE_INSTALLABLES}
 
 .PHONY: mostlyclean clean distclean realclean extraclean
 mostlyclean:
        $(RM) *.o *.i core
 clean: mostlyclean
-       $(RM) ${INSTALLABLES} ${UTILITIES} *.exe
+       $(RM) ${EXES} *.exe
 distclean: clean
-       $(RM) DOC *.tab.c *.tab.h aixcc.c TAGS
-       $(RM) Makefile Makefile.in blessmail config.values
+       $(RM) DOC *.tab.c *.tab.h TAGS ellcc.h
+       $(RM) GNUmakefile Makefile Makefile.in blessmail config.values
 realclean: distclean
 extraclean: distclean
        $(RM) *~ \#*
 
-.PHONY: unlock relock check
-unlock:
-       chmod u+w $(SOURCES)
-relock:
-       chmod u-w $(SOURCES)
-
 ## Test the contents of the directory.
 check:
-       @echo "We don't have any tests for XEmacs yet."
+       @echo "We don't have any tests for lib-src yet."
 
 TAGS: etags
        etags *.[ch]
@@ -254,35 +290,29 @@ getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
        ${CC} -c $(cflags) ${srcdir}/getopt.c
 getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
        ${CC} -c $(cflags) ${srcdir}/getopt1.c
-alloca.o: ${srcdir}/../src/alloca.c
+alloca.o: ${top_srcdir}/src/alloca.c
        ${CC} -c $(cflags) ${srcdir}/../src/alloca.c
 
-regex.o: ${srcdir}/../src/regex.c ${srcdir}/../src/regex.h
-       $(CC) -c `echo $(cflags) | sed 's/-Demacs/ /'` \
-               -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
+regex.o: ${srcdir}/../src/regex.c ${top_srcdir}/src/regex.h
+       $(CC) -c $(cflags) \
+       -DINHIBIT_STRING_HEADER ${top_srcdir}/src/regex.c
 
-etags_args = -I. $(cflags) -I${srcdir} -I${srcdir}/../src \
-       -DVERSION='"${version}"' ${srcdir}/etags.c \
+etags_args = $(cflags) -DVERSION='"${version}"' ${srcdir}/etags.c \
        $(GETOPTOBJS) regex.o $(ldflags)
-etags_deps   = ${srcdir}/etags.c $(GETOPTDEPS) regex.o ../src/config.h
+etags_deps = ${srcdir}/etags.c $(GETOPTDEPS) regex.o ../src/config.h
 
 etags: ${etags_deps}
        $(CC) ${etags_args} -o $@
 
-runemacs_args = -I. $(cflags) -I${srcdir} -I${srcdir}/../src \
-       -DVERSION='"${version}"' ${srcdir}/../nt/runemacs.c \
-       $(ldflags) -Wl,--subsystem,windows
-runemacs_deps   = ${srcdir}/../nt/runemacs.c ${srcdir}/../nt/xemacs.ico ../src/config.h
+ellcc_args = $(cflags) ${srcdir}/ellcc.c $(ldflags)
+ellcc_deps = ${srcdir}/ellcc.c ellcc.h ../src/config.h
 
-runemacs: ${runemacs_deps}
-       echo "runemacs ICON DISCARDABLE \"../nt/xemacs.ico\"" \
-       | windres -o runemacs_res.o
-       $(CC) runemacs_res.o ${runemacs_args} -o $@
+ellcc: ${ellcc_deps}
+       $(CC) ${ellcc_args} -o $@
 
-ootags_args = -I. $(cflags) -I${srcdir} -I${srcdir}/../src \
-       -DVERSION='"${version}"' ${srcdir}/ootags.c \
+ootags_args = $(cflags) -DVERSION='"${version}"' ${srcdir}/ootags.c \
        $(GETOPTOBJS) regex.o $(ldflags)
-ootags_deps   = ${srcdir}/ootags.c $(GETOPTDEPS) regex.o ../src/config.h
+ootags_deps = ${srcdir}/ootags.c $(GETOPTDEPS) regex.o ../src/config.h
 
 ootags: ${ootags_deps}
        $(CC) ${ootags_args} -o $@
@@ -302,7 +332,7 @@ make-docfile: ${srcdir}/make-docfile.c
        $(CC) $(cflags) ${srcdir}/make-docfile.c $(ldflags) -o $@
 
 digest-doc: ${srcdir}/digest-doc.c
-       $(CC) $(cflags) ${srcdir}/digest-doc.c $(ldflags) -o $@
+       $(CC) -Demacs $(cflags) ${srcdir}/digest-doc.c $(ldflags) -o $@
 
 sorted-doc: ${srcdir}/sorted-doc.c
        $(CC) $(cflags) ${srcdir}/sorted-doc.c $(ldflags) -o $@
@@ -324,6 +354,15 @@ fakemail: ${srcdir}/fakemail.c ../src/config.h
 yow: ${srcdir}/yow.c ../src/paths.h
        $(CC) $(cflags) ${srcdir}/yow.c $(ldflags) -o $@
 
+i: ${srcdir}/i.c
+       $(CC) $(cflags) ${srcdir}/i.c $(ldflags) -o $@
+
+minitar: ${srcdir}/../nt/minitar.c
+       $(CC) $(cflags) ${srcdir}/../nt/minitar.c $(ldflags) -lz -o $@
+
+winclient: ${srcdir}/winclient.c
+       $(CC) $(cflags) ${srcdir}/winclient.c $(ldflags) -o $@
+
 hexl: ${srcdir}/hexl.c
        $(CC) $(cflags) ${srcdir}/hexl.c $(ldflags) -o $@
 
@@ -333,6 +372,9 @@ make-msgfile: ${srcdir}/make-msgfile.c
 make-po: ${srcdir}/make-po.c
        $(CC) $(cflags) ${srcdir}/make-po.c $(ldflags) -o $@
 
+make-dump-id: ${srcdir}/make-dump-id.c
+       $(CC) $(cflags) ${srcdir}/make-dump-id.c $(ldflags) -o $@
+
 cflags_gnuserv  = $(CFLAGS) $(cppflags) $(c_switch_all)
 ldflags_gnuserv = $(LDFLAGS) $(ld_switch_all) @libs_xauth@ $(ld_libs_general)
 gnuslib.o: ${srcdir}/gnuslib.c ${srcdir}/gnuserv.h ../src/config.h
@@ -345,20 +387,11 @@ gnuserv: ${srcdir}/gnuserv.c gnuslib.o ${srcdir}/gnuserv.h
 ## mmencode binary is used by tm - but is really part of the metamail package
 ## mmencode.c was merged copy of mmencode.c and codes.c of metamail
 mmencode : ${srcdir}/mmencode.c
-       $(CC) $(cflags) ${srcdir}/mmencode.c -o $@
+       $(CC) $(cflags) ${srcdir}/mmencode.c $(ldflags) -o $@
 
 
 ## The timer utility (timer.c, getdate.y) is not used in XEmacs
 ## because XEmacs provides built-in timer facilities.
 
 make-path: ${srcdir}/make-path.c ../src/config.h
-       $(CC) $(cflags) ${srcdir}/make-path.c -o $@
-
-## These are NOT included in INSTALLABLES or UTILITIES.
-## See ../src/Makefile.in.in.
-aixcc: ${srcdir}/aixcc.c
-       $(CC) $(cflags) ${srcdir}/aixcc.c -o $@
-
-aixcc.c: ${srcdir}/aixcc.lex
-       lex ${srcdir}/aixcc.lex
-       mv lex.yy.c aixcc.c
+       $(CC) -Demacs $(cflags) ${srcdir}/make-path.c $(ldflags) -o $@