home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / me34src.zip / me3 / Makefile < prev    next >
Makefile  |  1995-01-14  |  9KB  |  273 lines

  1. # Top level makefile for ME/MC
  2. # Invokes make in each of the sub-directories to make everything,
  3. #   passing flags down to each sub-directory make.
  4. #
  5. # There are a bunch of targets that build for various platforms, see first:
  6. #   for a list.
  7. #
  8. # To clean up the .o files (leaving libraries): "make clean"
  9. # To remove everything but the source:        "make realclean"
  10. #
  11. # To install:
  12. #   Check the "Installation" section (below) then:  "make install"
  13. #
  14. # If your platform is not in the first: list, and a generic target doesn't
  15. #   work, try configuring the following and "make all_of_ME"
  16. #    util/os.h
  17. #    me/config.h
  18. #    me/Makefile
  19. #    comserver/Makefile
  20. #    ./Makefile (this file!)
  21. #
  22. # Caution: assumes you are using GNUmake. If you are not, you should be!
  23. #    ++jrb  bammi@cadence.com
  24. #
  25. # I commented out the GNUmake-isms.  It makes me/Makefile more painful to
  26. #   configure.  Other than that, Atari is only affected if SUBDIRS is not
  27. #   configured correctly.  I marked the changes with "GNUmake:".  --cd
  28. #   Affected Makefiles:  me/Makefile, comserver/Makefile
  29.  
  30. ##########################################################################
  31. ##             start of user configuration            ##
  32. ##########################################################################
  33.  
  34. # Choose your compiler
  35. #   For most systems just cc
  36. #   You may prefer to use gcc
  37. #   For the atariST specify your cross or native gcc
  38.  
  39. CC=cc
  40. #CC=gcc        # gcc unix/atariST
  41. #CC=cgcc    # gcc atariST TOS/MiNT
  42.  
  43. # Choose the base compile flags for your C compiler. These flags
  44. # are used for everything that is compiled. K&R or ANSI C ok.
  45. #   For HP-UX and ANSI C, use "-O -Aa", else "-O"
  46. #   For Apollo and ANSI C, use "-O -Aansi", else "-O"
  47. #   For everybody else, "-O" should be OK
  48. #   For the atariST:  Use -O2 -fstrength-reduce
  49. #   On a  Sun-sparc with gcc-2.1, I have tested "-O2 -g".
  50. #     For our SpacStation-10, I used "-O" and "-O -Xa".  "-O" was fine.
  51. # Normal case: -O
  52. BASECFLAGS = -O
  53. #BASECFLAGS = -O2 -g        # gcc unix
  54. #BASECFLAGS = -ml -A  -d -f- -N -P-c -w-pia    # Borland C++, no ASM
  55. #BASECFLAGS = -ml -A- -d -f- -N -P-c -w-pia    # Borland C++, using ASM
  56. #BASECFLAGS = -O2 -fomit-frame-pointer -fstrength-reduce   # gcc atariST-TOS
  57. #BASECFLAGS = -O -mint        # gcc atariST-MiNT
  58.  
  59. # Choose the flags for the loader. These are not applied when compiling.
  60. #   For most unixen use nothing.
  61. #   On the atariST, nothing is fine.
  62. #   -lsocket : Newer Suns.  Use if the loader complains about
  63. #        Undefined Symbol socket.
  64. # LDFLAGS = -lsocket    # Newer Suns
  65. # LDFLAGS = -v        # cc unixen / gcc atariST-TOS
  66. # LDFLAGS = -mint    # gcc atariST-MiNT
  67.  
  68. # Name of your archiver and ranlib
  69. #   On unixen "ar" and "ranlib"
  70. #   On the atariST car (or gcc-ar on native) and "car s"
  71. #   On newer Suns or systems with no ranlib, use "echo"
  72. AR=ar        # unixen
  73. RANLIB=ranlib    # unixen
  74. # RANLIB = echo    # Newer Suns
  75. # AR = car        # atariST
  76. # RANLIB = car s    # atariST
  77.  
  78. # The subdirectories in which we are going to make stuff
  79. #   unixen:  util ed mc comserver mutt me
  80. #   atariST: util ed mc mutt me
  81. # Note:  You only need "comserver" if you are going to use the compute
  82. #   server.  If you don't want it (or are having trouble compiling it),
  83. #   remove it from SUBDIRS and turn it off in me/Makefile (set PROCESS to
  84. #   blank) and me/config.h (set COMPUTE_SERVER to 0)
  85. #
  86. SUBDIRS = util ed mc comserver mutt        # unixen
  87. # SUBDIRS = util ed mc                 # atariST -cross
  88. # SUBDIRS = util ed mc mutt             # atariST -native
  89.  
  90. # The following should only be defined if you are compiling for the atariST
  91. # (these variables are tested in subdir/Makefiles to test conditions)
  92. #   For unixen don't define them.
  93. #
  94. ATARI=        # unixen
  95. ATARIOS=    # unixen
  96. # ATARI=atariST        # define this if atariST, MiNT or TOS
  97. # ATARIOS=TOS        # define this only if atariST-TOS
  98. # ATARIOS=MiNT        # define this only if atariST-MiNT
  99.  
  100. # Installation directories:
  101. #  BIN is where to put the binaries (me3 and mc2)
  102. #  MUTTLIB is where to put the ME3 extension libraries.
  103. #    Make sure this directory matches what you have in me/config.h
  104. #  DOC is where to put the documation files.  Normally the same as MUTTLIB
  105. #    because that makes it easy for ME to look for the doc files.
  106. # Normal Unix case:
  107. #   BIN = /usr/local/bin
  108. #   MUTTLIB = /usr/local/me3
  109. #   DOC = $(MUTTLIB)
  110. # Normal MS-DOS case:
  111. #   BIN = C:/bin or whatever you have for a bin directory
  112. #   MUTTLIB = C:/me3
  113. #   DOC = $(MUTTLIB)
  114. BIN = /usr/local/bin
  115. MUTTLIB = /usr/local/me3
  116. DOC = $(MUTTLIB)
  117.  
  118. ##########################################################################
  119. ##            End of User Configuration            ##
  120. ##########################################################################
  121.  
  122. first: 
  123.     @echo "To compile ME (me/me or me/xme):"
  124.     @echo "Borland C (MS-DOS):  make -f Makefile.bc"
  125.     @echo "Apollo:       make termcap_ME"
  126.     @echo "HP-UX:        make termcap_ME"
  127.     @echo "HP-UX X11:    make HPXme"
  128.     @echo "IBM AIX:      make termcap_ME"
  129.     @echo "IBM AIX X11:  make Xme"
  130.     @echo "Sun BSD:      make bsd"
  131.     @echo "Sun SYSV:     make Sun_sysv"
  132.     @echo "Sun SYSV X11: make Sun_sysv_Xme"
  133.     @echo "If you have configured the Makefiles and want"
  134.     @echo "  use them as they are: make all_of_ME"
  135.     @echo 
  136.     @echo "To install:"
  137.     @echo "Make sure ./Makefile BIN and MUTTLIB are correct"
  138.     @echo "  then make install (you may need to be super-user).
  139.     @echo "(make -f Makefile.bc install on MS-DOS).
  140.     @echo 
  141.     @echo "To clean up:"
  142.     @echo "Remove compile droppings:    make clean"
  143.     @echo "Remove everything but source: make realclean"
  144.     @echo "To clean just the me directory: make clean_me"
  145.     @echo "  (For example, to build the X version after building the termcap version)"
  146.     @echo "(make -f Makefile.bc clean on MS-DOS).
  147.     @echo 
  148.  
  149. announce:
  150.     @echo ">>>>>>>>>>>>>>>>Building the Mutt World<<<<<<<<<<<<<<<<<<<<<"
  151.  
  152. ##################################################################
  153. ####            Build most things              ####
  154. ##################################################################
  155.  
  156. all_of_ME:
  157.     for dir in $(SUBDIRS) me; do \
  158.     (cd $$dir; \
  159.     $(MAKE) CC="$(CC)" BASECFLAGS="$(BASECFLAGS)" LDFLAGS="$(LDFLAGS)" AR="$(AR)" RANLIB="$(RANLIB)" ATARI="$(ATARI)" ATARIOS="$(ATARIOS)"; \
  160.     ) \
  161.     done
  162.  
  163. all_but_ME:
  164.     for dir in $(SUBDIRS); do \
  165.     (cd $$dir; \
  166.     $(MAKE) CC="$(CC)" BASECFLAGS="$(BASECFLAGS)" LDFLAGS="$(LDFLAGS)" AR="$(AR)" RANLIB="$(RANLIB)" ATARI="$(ATARI)" ATARIOS="$(ATARIOS)"; \
  167.     ) \
  168.     done
  169.  
  170. ##################################################################
  171. ####            Build X ME                  ####
  172. ##################################################################
  173.  
  174. HPXme: announce all_but_ME
  175.     (cd me; \
  176.     $(MAKE) Xme CC="$(CC)" \
  177.     BASECFLAGS="$(BASECFLAGS) -I/usr/include/X11R5 -DXIO=1" \
  178.     LDFLAGS="$(LDFLAGS) -L/usr/lib/X11R5" AR="$(AR)" RANLIB="$(RANLIB)" \
  179.     ATARI="$(ATARI)" ATARIOS="$(ATARIOS)"; \
  180.     )
  181.  
  182. Xme: announce all_but_ME
  183.     (cd me; \
  184.     $(MAKE) Xme CC="$(CC)" \
  185.     BASECFLAGS="$(BASECFLAGS) -DXIO=1" \
  186.     LDFLAGS="$(LDFLAGS)" AR="$(AR)" RANLIB="$(RANLIB)" \
  187.     ATARI="$(ATARI)" ATARIOS="$(ATARIOS)"; \
  188.     )
  189.  
  190. ##################################################################
  191. ####            Build Termcap ME              ####
  192. ##################################################################
  193.  
  194. termcap_ME: announce all_but_ME
  195.     (cd me; \
  196.     $(MAKE) termcap_ME CC="$(CC)" \
  197.     BASECFLAGS="$(BASECFLAGS)" \
  198.     LDFLAGS="$(LDFLAGS)" AR="$(AR)" RANLIB="$(RANLIB)" \
  199.     ATARI="$(ATARI)" ATARIOS="$(ATARIOS)"; \
  200.     )
  201.  
  202. ##################################################################
  203. ####            Build on Suns                  ####
  204. ##################################################################
  205.  
  206. SunSysV: announce 
  207.     for dir in $(SUBDIRS); do \
  208.     (cd $$dir; \
  209.     $(MAKE) CC="$(CC)" BASECFLAGS="-O -Xa -DSYSV_OS=1" \
  210.     LDFLAGS="-lsocket" AR="ar" RANLIB="echo" ATARI="" ATARIOS=""; \
  211.     ) \
  212.     done
  213.  
  214. Sun_sysv: SunSysV
  215.     (cd me; \
  216.     $(MAKE) termcap_ME CC="$(CC)" BASECFLAGS="-O -Xa -DSYSV_OS=1" \
  217.     LDFLAGS="-lsocket" AR="ar" RANLIB="echo" ATARI="" ATARIOS=""; \
  218.     )
  219.  
  220. Sun_sysv_Xme: SunSysV
  221.     (cd me; \
  222.     $(MAKE) Xme CC="$(CC)" \
  223.     BASECFLAGS="-O -Xa -DSYSV_OS=1 -DXIO=1 -I/usr/openwin/share/include" \
  224.     LDFLAGS="-lsocket -L/usr/openwin/lib -R/usr/openwin/lib" \
  225.     AR="ar" RANLIB="echo" ATARI="" ATARIOS=""; \
  226.     )
  227.  
  228.  
  229. BSD: announce 
  230.     for dir in $(SUBDIRS); do \
  231.     (cd $$dir; \
  232.     $(MAKE) CC="$(CC)" BASECFLAGS="-O -DBSD_OS=1" \
  233.     LDFLAGS="" AR="ar" RANLIB="ranlib" ATARI="" ATARIOS=""; \
  234.     ) \
  235.     done
  236.  
  237. bsd: BSD
  238.     (cd me; \
  239.     $(MAKE) termcap_ME CC="$(CC)" BASECFLAGS="-O -DBSD_OS=1" \
  240.     LDFLAGS="" AR="ar" RANLIB="ranlib" ATARI="" ATARIOS=""; \
  241.     )
  242.  
  243. ##################################################################
  244. ####            Clean Up                  ####
  245. ##################################################################
  246.  
  247. # clean: just cleans up objects
  248. clean:
  249.     for dir in $(SUBDIRS) me; do \
  250.     (cd $$dir; $(MAKE) clean; ) \
  251.     done
  252.  
  253. # realclean: cleanup objects, libraries, executables and .mco's
  254. realclean:
  255.     for dir in $(SUBDIRS) me; do \
  256.     ( cd $$dir; $(MAKE) realclean; ) \
  257.     done
  258.  
  259. clean_me:
  260.     ( cd me; $(MAKE) clean; )
  261.  
  262. ##################################################################
  263. ####            Install ME                  ####
  264. ##################################################################
  265.  
  266. install:
  267.     -cp me/me me/xme mc/mc2 $(BIN)
  268. #    ln -s $(BIN)/me3 $(BIN)/me
  269.     @-mkdir -p $(MUTTLIB)
  270.     cp mutt/package/*.mco $(MUTTLIB)
  271.     @-mkdir -p $(DOC)
  272.     cp doc/*.doc doc/web.idx $(DOC)
  273.