home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / rcs567s.zip / rcs / src / ms / Makefile < prev    next >
Makefile  |  1995-05-01  |  6KB  |  186 lines

  1. # ms/Makefile
  2. # This file is part of RCS.
  3. #
  4. # RCS is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8. #
  9. # RCS is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with RCS; see the file COPYING.  If not, write to
  16. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  17. #
  18. # Report problems and direct all questions to:
  19. #
  20. #    rcs-bugs@cs.purdue.edu
  21. #
  22.  
  23. # This Makefile allows building OS/2 and DOS executables for RCS. It
  24. # supports the Microsoft/IBM NMAKE program, DMAKE and GNU make. The
  25. # compilers supported are emx 0.9 or newer (gcc 2.6.1) to create
  26. # 32-bit OS/2 or 32-bit DOS executables, Microsoft C 6.00A to create
  27. # 16-bit OS/2 or 16-bit DOS executables and Borland C++ 3.0 to create
  28. # 16-bit DOS executables.
  29.  
  30. # default target
  31. default:
  32.     @echo "Available targets:"
  33.     @echo "    emx emx-debug emxdos"
  34.     @echo "    msc msc-debug mscdos mscdos-debug"
  35.  
  36. # ----- start of configuration section -----
  37.  
  38. # emx 0.9 (gcc) -> 32-bit OS/2 executables
  39. emx:
  40.     $(MAKE) all -f ms/Makefile EMX="" \
  41.     CC="gcc -Zomf" \
  42.     CCFLAGS="-O -D__OS2__" \
  43.     LDFLAGS="-Zstack 512 -Zcrtdll -s ms/rcs.def" \
  44.     DLDFLAGS="-Zdll -Zcrtdll -s"
  45. emx-debug:
  46.     $(MAKE) all -f ms/Makefile EMX="" O=.o A=.a \
  47.     CC="gcc -g" \
  48.     CCFLAGS="-D__OS2__"
  49.  
  50. # emx 0.9 (gcc) -> 32-bit DOS executables
  51. emxdos:
  52.     $(MAKE) all -f ms/Makefile EMX="" OS="dos" O=.o A=.a \
  53.     CC="gcc" \
  54.     CCFLAGS="-O -D__MSDOS__" \
  55.     LDFLAGS="-s"
  56.  
  57. # Microsoft C 6.00A -> 16-bit OS/2 (and DOS, family mode) executables
  58. # remove the -Lp option if the default libraries are the protected mode ones
  59. msc:
  60.     $(MAKE) all -f ms/Makefile MSC="" \
  61.     CC="cl -nologo -AS" \
  62.     CCFLAGS="-Zp -G2s -Ocegit -D__MSC__ -D__OS2__" \
  63.     LDFLAGS="-F 4000 -Lp setargv.obj ms\rcs.def -link /noe"
  64. #    BIND="bind -nologo" \
  65. #    BFLAGS="-n DOSGETPROCADDR DOSLOADMODULE DOSFREEMODULE"
  66. msc-debug:
  67.     $(MAKE) all -f ms/Makefile MSC="" \
  68.     CC="cl -nologo -Zi -AM" \
  69.     CCFLAGS="-Zp -G2 -Od -D__MSC__ -D__OS2__" \
  70.     LDFLAGS="-F 4000 -Lp ms\rcs.def -link /noe"
  71.  
  72. # Microsoft C 6.00A -> 16-bit DOS executables
  73. # remove the -Lr option if the default libraries are the real mode ones
  74. mscdos:
  75.     $(MAKE) all -f ms/Makefile MSC="" OS="dos" \
  76.     CC="cl -nologo -AS" \
  77.     CCFLAGS="-Zp -G2s -Ocegit -D__MSC__ -D__MSDOS__" \
  78.     LDFLAGS="-F 4000 -Lr setargv.obj -link /noe"
  79. mscdos-debug:
  80.     $(MAKE) all -f ms/Makefile MSC="" OS="dos" \
  81.     CC="cl -nologo -Zi -AM" \
  82.     CCFLAGS="-Zp -G2s -Od -D__MSC__ -D__MSDOS__" \
  83.     LDFLAGS="-F 4000 -Lr -link /noe"
  84.  
  85. # defaults:
  86.  
  87. O = .obj
  88. A = .lib
  89. X = .exe
  90.  
  91. OS = os2
  92. EMX = emx
  93. MSC = msc
  94. BCC = bcc
  95.  
  96. # other macros:
  97. CFLAGS = $(CCFLAGS) -Ims -Dmain=rcsmain
  98. OTHER_OBJECT = getcwdsl$O spawnvpq$O login$(OS)$O
  99. REMOVE = del
  100. BIND = echo
  101. BFLAGS = done
  102.  
  103. # ----- end of configuration section -----
  104. # You shouldn't have to change anything past this point.
  105.  
  106. # all commands
  107. RCSCOMMANDS = ci.exe co.exe ident.exe merge.exe rcs.exe \
  108.     rcsclean.exe rcsdiff.exe rcsmerge.exe rlog.exe
  109.  
  110. .SUFFIXES: .c $O .exe
  111.  
  112. .c$O:
  113.     $(CC) $(CFLAGS) -c $<
  114.  
  115. $O.exe:
  116.     $(CC) $< rcslib$A -o $@ $(LDFLAGS)
  117.     @$(BIND) $@ $(BFLAGS)
  118.  
  119. all: $(RCSCOMMANDS)
  120.  
  121. RCSLIB1 = rcslex$O rcssyn$O rcsgen$O rcsedit$O rcskeys$O rcsmap$O
  122. RCSLIB2 = rcsrev$O rcsutil$O rcsfnms$O partime$O maketime$O
  123. RCSLIB3 = rcskeep$O rcsfcmp$O rcstime$O merger$O version$O
  124. RCSLIB = $(RCSLIB1) $(RCSLIB2) $(RCSLIB3) $(OTHER_OBJECT)
  125.  
  126. # dynamic/shared library variant, emx, OS/2 only
  127. $(EMX)rcslib.lib: dllinit$O ms/rcslib.def rcslib.dll
  128.     emximp -o $@ ms/rcslib.def
  129.     emxomfar r $@ dllinit$O
  130. $(EMX)rcslib.dll: dllmain$O $(RCSLIB) ms/rcslib.def
  131.     $(CC) dllmain$O $(RCSLIB) -o $@ ms/rcslib.def $(DLDFLAGS)
  132.  
  133. # For the library targets to work under DOS too, we need to get around
  134. # the stupid DOS command line length limit by using multiple commands.
  135.  
  136. # static library variant, emx
  137. $(EMX)rcslib.a: libinit$O $(RCSLIB)
  138.     -$(REMOVE) $@
  139.     ar cr $@ $(RCSLIB1)
  140.     ar cr $@ $(RCSLIB2)
  141.     ar cr $@ $(RCSLIB3)
  142.     ar cr $@ libinit$O $(OTHER_OBJECT)
  143.     ar s $@
  144.  
  145. # static library variant, MS C
  146. $(MSC)rcslib$A: libinit$O $(RCSLIB)
  147.     -$(REMOVE) $@
  148.     lib /nologo /noi $@ $(RCSLIB1);
  149.     lib /nologo /noi $@ $(RCSLIB2);
  150.     lib /nologo /noi $@ $(RCSLIB3);
  151.     lib /nologo /noi $@ libinit$O $(OTHER_OBJECT);
  152.  
  153. # static library variant, Borland C++
  154. $(BCC)rcslib$A: libinit$O $(RCSLIB)
  155.     -$(REMOVE) $@
  156.     tlib $@ $(RCSLIB1)
  157.     tlib $@ $(RCSLIB2)
  158.     tlib $@ $(RCSLIB3)
  159.     tlib $@ libinit$O $(OTHER_OBJECT)
  160.  
  161. $(RCSCOMMANDS) : rcslib$A
  162.  
  163. OBJECT=    ci$O co$O ident$O maketime$O merge$O merger$O partime$O \
  164.     rcs$O rcsclean$O rcsdiff$O rcsedit$O rcsfcmp$O rcsfnms$O \
  165.     rcsgen$O rcskeep$O rcskeys$O rcslex$O rcsmap$O rcsmerge$O \
  166.     rcsrev$O rcssyn$O rcsutil$O rlog$O version$O
  167.  
  168. $(OBJECT) : ms/conf.h rcsbase.h
  169.  
  170. getcwdsl$O: ms/getcwdsl.c
  171.     $(CC) $(CFLAGS) -c ms/getcwdsl.c
  172. spawnvpq$O: ms/spawnvpq.c
  173.     $(CC) $(CFLAGS) -c ms/spawnvpq.c
  174. login$(OS)$O: ms/login$(OS).c
  175.     $(CC) $(CFLAGS) -c ms/login$(OS).c
  176.  
  177. libinit$O: ms/libinit.c
  178.     $(CC) $(CFLAGS) -c ms/libinit.c
  179. dllinit$O: ms/libinit.c
  180.     $(CC) $(CFLAGS) -DDLLINIT -c ms/libinit.c -o $@
  181. dllmain$O: ms/dllmain.c
  182.     $(CC) $(CFLAGS) -c ms/dllmain.c
  183.  
  184. clean:
  185.     -$(REMOVE) *.o *.a *.obj *.lib *.bak conf.err $(RCSCOMMANDS)
  186.