Subject: bug#79466: 31.0.50; Build in a separate directory

From: Helmut Eller <[email-masked]>
Date: Thu, 18 Sep 2025 10:01:19 +0200

The file INSTALL under 3b) says that it should be possible to build in a
separate directory.  However this doesn't seem to work.  I did something
like

  cd /tmp
  mkdir build
  cd build
  /path/to/source/configure -C CFLAGS="-O0 -g3
  make

After some progress this aborts with:

  ...
  GEN      ../etc/DOC
/usr/bin/ld: cannot find dispnew.o: No such file or directory
/usr/bin/ld: cannot find frame.o: No such file or directory
/usr/bin/ld: cannot find scroll.o: No such file or directory
  ...

It seems that changing the .c.o rule in src/Makefile like so

 .c.o:
-       $(AM_V_CC)$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $(PROFILING_CFLAGS) $<
+       $(AM_V_CC)$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $(PROFILING_CFLAGS) $< -o $@

allows the build to complete.  However the .elc files still end up in
the source directory.  This might actually be useful, but I'm not sure
that it's intended.

Should we fix this?