home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / lucid / bug-lucid-emacs / text0143.txt < prev    next >
Encoding:
Text File  |  1993-07-04  |  1.9 KB  |  59 lines

  1.  
  2. In my opinion, it would be useful to fix etc/Makefile to be compatible
  3. with the VPATH feature of GNU make.  A context diff for that is bigger
  4. than the Makefile, so I'll enclose an entire Makefile instead.  For
  5. readability, it has irrelevant rules omitted; they can reasonably be
  6. reinstated, except for the explicit rules for targets that depend on
  7. .c files (the ones with the $(CC) commands).  Even those could be
  8. reinstated, if fixed the same way as those for, say, etags and ctags.
  9. The key is to use $@ and $< instead of explicit file names.
  10.  
  11. The motivation for this is something like
  12.  
  13.     mkdir -p /usr/local/lemacs/etc
  14.     cd /usr/local/lemacs/etc
  15.     etc=/home/free/lemacs-19.6/etc
  16.     make 'CC=gcc -O2' -f $etc/Makefile VPATH=$etc
  17.  
  18. That results in an otherwise empty directory full of the executables
  19. that belong in exec-directory.  Incidentally, it would also be useful
  20. not to distribute binaries in the etc directory; they have to be
  21. removed before this works.
  22.  
  23. Here's the stripped down Makefile:
  24.  
  25.  
  26. EXECUTABLES = test-distrib etags ctags wakeup make-docfile \
  27.    digest-doc sorted-doc movemail cvtmail fakemail yow env \
  28.    emacsserver emacsclient b2m hexl
  29.  
  30. all: ${EXECUTABLES}
  31.  
  32. .c:
  33.     $(CC) -o $@ ${CFLAGS} $< $(LOADLIBES)
  34.  
  35. # This justs verifies that the non-ASCII characters
  36. # in the file `testfile' have no been clobbered by
  37. # whatever means were used to copy and distribute Emacs.
  38. # If they were clobbered, all the .elc files were clobbered too.
  39. test: test-distrib
  40.     ./test-distrib
  41.  
  42. etags: etags.c
  43.     $(CC) -o $@ ${CFLAGS} -DETAGS $< $(LOADLIBES)
  44.  
  45. ctags: etags.c
  46.     $(CC) -o $@ ${CFLAGS} -DCTAGS $< $(LOADLIBES)
  47.  
  48. movemail: movemail.c ../src/config.h
  49. yow: yow.c ../src/paths.h
  50.  
  51. env: env.c ../src/config.h
  52.     $(CC) -o $@ -DEMACS ${CFLAGS} $< $(LOADLIBES)
  53.  
  54. # This one is NOT included in EXECUTABLES.
  55. # See ../src/ymakefile.
  56. emacstool: emacstool.c
  57.     $(CC) emacstool.c -o emacstool -g -lsuntool -lsunwindow -lpixrect $(LOADLIBES)
  58.  
  59.