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@
## Things that a user might actually run,
## which should be installed in bindir.
+#ifdef WINDOWSNT
+INSTALLABLES_BASE = etags ctags b2m ootags
+#else
INSTALLABLES_BASE = etags ctags b2m gnuclient ootags
-INSTALLABLE_SCRIPTS = rcs-checkin pstogif gnudoit gnuattach
+#endif
+INSTALLABLE_SCRIPTS = rcs-checkin gnudoit gnuattach
+#ifdef HAVE_SHLIB
#ifdef HAVE_MS_WINDOWS
-INSTALLABLES = $(INSTALLABLES_BASE) runemacs
+INSTALLABLES = $(INSTALLABLES_BASE) runxemacs rungnuclient ellcc
#else
-INSTALLABLES = $(INSTALLABLES_BASE)
+INSTALLABLES = $(INSTALLABLES_BASE) ellcc
+#endif
+#else
+#ifdef HAVE_MS_WINDOWS
+INSTALLABLES = $(INSTALLABLES_BASE) runxemacs rungnuclient
+#else
+INSTALLABLES = $(INSTALLABLES_BASE)
+#endif
#endif
## Things that Emacs runs internally, or during the build process,
## which should not be installed in bindir.
+#ifdef WINDOWSNT
+UTILITIES= make-path wakeup profile make-docfile digest-doc \
+ sorted-doc movemail cvtmail yow hexl \
+ mmencode
+#else
UTILITIES= make-path wakeup profile make-docfile digest-doc \
sorted-doc movemail cvtmail fakemail yow hexl \
gnuserv mmencode
+#endif
## These need to be conditional on I18N3 make-msgfile make-po
## Like UTILITIES, but they are not system-dependent, and should not be
## 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 = -Demacs -I. -I../src -I$(srcdir) -I$(top_srcdir)/src $(CPPFLAGS)
cflags = $(CFLAGS) $(cppflags) $(c_switch_general)
ldflags = $(LDFLAGS) $(ld_switch_general) $(ld_libs_general)
.c.o:
${CC} -c $(cflags) $<
+.PHONY : all maybe-blessmail install uninstall
+
all: ${UTILITIES} ${INSTALLABLES} srcdir-symlink.stamp
## Make symlinks for shell scripts if using --srcdir
## 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 \
clean: mostlyclean
$(RM) ${INSTALLABLES} ${UTILITIES} *.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 aixcc.c TAGS ellcc.h
+ $(RM) GNUmakefile Makefile Makefile.in blessmail config.values
realclean: distclean
extraclean: distclean
$(RM) *~ \#*
${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
+regex.o: ${srcdir}/../src/regex.c ${top_srcdir}/src/regex.h
$(CC) -c `echo $(cflags) | sed 's/-Demacs/ /'` \
- -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
+ -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
+
+ellcc: ${ellcc_deps}
+ $(CC) ${ellcc_args} -o $@
+
+run_args = $(cflags) -DVERSION='"${version}"' ${srcdir}/run.c \
+ $(ldflags) -Wl,--subsystem,windows -e _mainCRTStartup
+run_deps = ${srcdir}/run.c ${srcdir}/run.h ${srcdir}/run.rc \
+ ${srcdir}/../nt/xemacs.ico ${srcdir}/../nt/file.ico \
+ ${srcdir}/../nt/lisp.ico
+
+run: ${run_deps}
+ windres --include-dir ${srcdir}/../nt -i run.rc -o run_res.o
+ $(CC) run_res.o ${run_args} -o $@
+ strip $@.exe
+
+runxemacs: run
+ cp run.exe $@.exe
-runemacs: ${runemacs_deps}
- echo "runemacs ICON DISCARDABLE \"../nt/xemacs.ico\"" \
- | windres -o runemacs_res.o
- $(CC) runemacs_res.o ${runemacs_args} -o $@
+rungnuclient: run
+ cp run.exe $@.exe
-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 $@
b2m: ${srcdir}/b2m.c ../src/config.h
$(CC) $(cflags) ${srcdir}/b2m.c $(ldflags) -o $@
-movemail: ${srcdir}/movemail.c ${srcdir}/pop.c ${srcdir}/pop.h ../src/config.h
- $(CC) $(cflags) ${MOVE_FLAGS} ${srcdir}/movemail.c ${srcdir}/pop.c $(ldflags) ${MOVE_LIBS} -o $@
+movemail: ${srcdir}/movemail.c ${srcdir}/pop.c ${srcdir}/pop.h $(GETOPTDEPS) regex.o \
+ ../src/config.h
+ $(CC) $(cflags) ${MOVE_FLAGS} ${srcdir}/movemail.c ${srcdir}/pop.c \
+ $(GETOPTOBJS) regex.o $(ldflags) ${MOVE_LIBS} -o $@
cvtmail: ${srcdir}/cvtmail.c
$(CC) $(cflags) ${srcdir}/cvtmail.c $(ldflags) -o $@