Makefile 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. # Visual C++ Makefile for PuTTY.
  2. #
  3. # Use `nmake' to build.
  4. #
  5. ##-- help
  6. #
  7. # Extra options you can set:
  8. #
  9. # - FWHACK=/DFWHACK
  10. # Enables a hack that tunnels through some firewall proxies.
  11. #
  12. # - VER=/DSNAPSHOT=1999-01-25
  13. # Generates executables whose About box report them as being a
  14. # development snapshot.
  15. #
  16. # - VER=/DRELEASE=0.43
  17. # Generates executables whose About box report them as being a
  18. # release version.
  19. #
  20. # - COMPAT=/DWIN32S_COMPAT
  21. # Generates a binary that works (minimally) with Win32s.
  22. #
  23. # - RCFL=/DASCIICTLS
  24. # Uses ASCII rather than Unicode to specify the tab control in
  25. # the resource file. Probably most useful when compiling with
  26. # Cygnus/mingw32, whose resource compiler may have less of a
  27. # problem with it.
  28. #
  29. ##--
  30. CFLAGS = /nologo /W3 /YX /O2 /Yd /D_WINDOWS /DDEBUG /ML /Fd
  31. # LFLAGS = /debug
  32. # Use MSVC DLL
  33. # CFLAGS = /nologo /W3 /YX /O2 /Yd /D_WINDOWS /DDEBUG /ML /Fd
  34. # Disable debug and incremental linking
  35. LFLAGS = /incremental:no
  36. .c.obj:
  37. cl $(COMPAT) $(FWHACK) $(CFLAGS) /c $*.c
  38. OBJ=obj
  39. RES=res
  40. ##-- objects putty puttytel
  41. GOBJS1 = window.$(OBJ) windlg.$(OBJ) terminal.$(OBJ) telnet.$(OBJ) raw.$(OBJ)
  42. GOBJS2 = xlat.$(OBJ) ldisc.$(OBJ) sizetip.$(OBJ)
  43. ##-- objects putty
  44. POBJS = ssh.$(OBJ) be_all.$(OBJ)
  45. ##-- objects puttytel
  46. TOBJS = be_nossh.$(OBJ)
  47. ##-- objects pscp
  48. SOBJS = scp.$(OBJ) windlg.$(OBJ) ssh.$(OBJ) be_none.$(OBJ)
  49. ##-- objects putty puttytel pscp
  50. MOBJS = misc.$(OBJ) version.$(OBJ)
  51. ##-- objects putty pscp
  52. OBJS1 = sshcrc.$(OBJ) sshdes.$(OBJ) sshmd5.$(OBJ) sshrsa.$(OBJ) sshrand.$(OBJ)
  53. OBJS2 = sshsha.$(OBJ) sshblowf.$(OBJ) noise.$(OBJ)
  54. ##-- resources putty
  55. PRESRC = win_res.$(RES)
  56. ##-- resources puttytel
  57. TRESRC = nosshres.$(RES)
  58. ##-- resources pscp
  59. SRESRC = scp.$(RES)
  60. ##--
  61. ##-- gui-apps
  62. # putty
  63. # puttytel
  64. ##-- console-apps
  65. # pscp
  66. ##--
  67. LIBS1 = advapi32.lib user32.lib gdi32.lib
  68. LIBS2 = wsock32.lib comctl32.lib comdlg32.lib
  69. all: putty.exe puttytel.exe pscp.exe
  70. putty.exe: $(GOBJS1) $(GOBJS2) $(POBJS) $(MOBJS) $(OBJS1) $(OBJS2) $(PRESRC) putty.rsp
  71. link $(LFLAGS) -out:putty.exe @putty.rsp
  72. puttytel.exe: $(GOBJS1) $(GOBJS2) $(TOBJS) $(MOBJS) $(TRESRC) puttytel.rsp
  73. link $(LFLAGS) -out:puttytel.exe @puttytel.rsp
  74. pscp.exe: $(SOBJS) $(MOBJS) $(OBJS1) $(OBJS2) $(OBJS3) $(SRESRC) pscp.rsp
  75. link $(LFLAGS) -out:pscp.exe @pscp.rsp
  76. putty.rsp: makefile
  77. echo /nologo /subsystem:windows > putty.rsp
  78. echo $(GOBJS1) >> putty.rsp
  79. echo $(GOBJS2) >> putty.rsp
  80. echo $(POBJS) >> putty.rsp
  81. echo $(MOBJS) >> putty.rsp
  82. echo $(OBJS1) >> putty.rsp
  83. echo $(OBJS2) >> putty.rsp
  84. echo $(PRESRC) >> putty.rsp
  85. echo $(LIBS1) >> putty.rsp
  86. echo $(LIBS2) >> putty.rsp
  87. puttytel.rsp: makefile
  88. echo /nologo /subsystem:windows > puttytel.rsp
  89. echo $(GOBJS1) >> puttytel.rsp
  90. echo $(GOBJS2) >> puttytel.rsp
  91. echo $(TOBJS) >> puttytel.rsp
  92. echo $(MOBJS) >> puttytel.rsp
  93. echo $(TRESRC) >> puttytel.rsp
  94. echo $(LIBS1) >> puttytel.rsp
  95. echo $(LIBS2) >> puttytel.rsp
  96. pscp.rsp: makefile
  97. echo /nologo /subsystem:console > pscp.rsp
  98. echo $(SOBJS) >> pscp.rsp
  99. echo $(MOBJS) >> pscp.rsp
  100. echo $(OBJS1) >> pscp.rsp
  101. echo $(OBJS2) >> pscp.rsp
  102. echo $(SRESRC) >> pscp.rsp
  103. echo $(LIBS1) >> pscp.rsp
  104. echo $(LIBS2) >> pscp.rsp
  105. ##-- dependencies
  106. window.$(OBJ): window.c putty.h win_res.h
  107. windlg.$(OBJ): windlg.c putty.h ssh.h win_res.h
  108. terminal.$(OBJ): terminal.c putty.h
  109. sizetip.$(OBJ): sizetip.c putty.h
  110. telnet.$(OBJ): telnet.c putty.h
  111. raw.$(OBJ): raw.c putty.h
  112. xlat.$(OBJ): xlat.c putty.h
  113. ldisc.$(OBJ): ldisc.c putty.h
  114. misc.$(OBJ): misc.c putty.h
  115. noise.$(OBJ): noise.c putty.h ssh.h
  116. ssh.$(OBJ): ssh.c ssh.h putty.h
  117. sshcrc.$(OBJ): sshcrc.c ssh.h
  118. sshdes.$(OBJ): sshdes.c ssh.h
  119. sshmd5.$(OBJ): sshmd5.c ssh.h
  120. sshrsa.$(OBJ): sshrsa.c ssh.h
  121. sshsha.$(OBJ): sshsha.c ssh.h
  122. sshrand.$(OBJ): sshrand.c ssh.h
  123. sshblowf.$(OBJ): sshblowf.c ssh.h
  124. scp.$(OBJ): scp.c putty.h scp.h
  125. version.$(OBJ): version.c
  126. be_all.$(OBJ): be_all.c
  127. be_nossh.$(OBJ): be_nossh.c
  128. be_none.$(OBJ): be_none.c
  129. ##--
  130. # Hack to force version.obj to be rebuilt always
  131. version.obj: versionpseudotarget
  132. @echo (built version.obj)
  133. versionpseudotarget:
  134. cl $(FWHACK) $(VER) $(CFLAGS) /c version.c
  135. ##-- dependencies
  136. win_res.$(RES): win_res.rc win_res.h putty.ico
  137. ##--
  138. win_res.$(RES):
  139. rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 win_res.rc
  140. ##-- dependencies
  141. nosshres.$(RES): nosshres.rc win_res.rc win_res.h putty.ico
  142. ##--
  143. nosshres.$(RES):
  144. rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 nosshres.rc
  145. ##-- dependencies
  146. scp.$(RES): scp.rc scp.ico
  147. ##--
  148. scp.$(RES):
  149. rc $(FWHACK) $(RCFL) -r -DWIN32 -D_WIN32 -DWINVER=0x0400 scp.rc
  150. clean:
  151. del *.obj
  152. del *.exe
  153. del *.res
  154. del *.pch
  155. del *.aps
  156. del *.ilk
  157. del *.pdb
  158. del *.rsp