winint.mak 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. # Copyright (C) 1997, 2003 Aladdin Enterprises. All rights reserved.
  2. #
  3. # This software is provided AS-IS with no warranty, either express or
  4. # implied.
  5. #
  6. # This software is distributed under license and may not be copied,
  7. # modified or distributed except as expressly authorized under the terms
  8. # of the license contained in the file LICENSE in this distribution.
  9. #
  10. # For more information about licensing, please refer to
  11. # http://www.ghostscript.com/licensing/. For information on
  12. # commercial licensing, go to http://www.artifex.com/licensing/ or
  13. # contact Artifex Software, Inc., 101 Lucas Valley Road #110,
  14. # San Rafael, CA 94903, U.S.A., +1(415)492-9861.
  15. # $Id: winint.mak,v 1.26 2005/04/12 22:05:40 giles Exp $
  16. # Common interpreter makefile section for 32-bit MS Windows.
  17. # This makefile must be acceptable to Microsoft Visual C++, Watcom C++,
  18. # and Borland C++. For this reason, the only conditional directives
  19. # allowed are !if[n]def, !else, and !endif.
  20. # Include the generic makefile.
  21. !include $(PSSRCDIR)\int.mak
  22. !include $(PSSRCDIR)\cfonts.mak
  23. # Define the C++ compiler invocation for library modules.
  24. GLCPP=$(CPP) $(CO) $(I_)$(GLI_)$(_I)
  25. # Define the compilation rule for Windows interpreter code.
  26. # This requires PS*_ to be defined, so it has to come after int.mak.
  27. PSCCWIN=$(CC_WX) $(CCWINFLAGS) $(I_)$(PSI_)$(_I) $(PSF_)
  28. # Define the name of this makefile.
  29. WININT_MAK=$(PSSRC)winint.mak
  30. # Define the location of the WinZip self-extracting-archive-maker.
  31. !ifndef WINZIPSE_XE
  32. !ifdef WIN64
  33. WINZIPSE_XE="C:\Program Files (x86)\WinZip Self-Extractor\WZIPSE32.EXE"
  34. !else
  35. WINZIPSE_XE="C:\Program Files\WinZip Self-Extractor\WZIPSE32.EXE"
  36. !endif
  37. !endif
  38. # Define the name and location of the zip archive maker.
  39. !ifndef ZIP_XE
  40. ZIP_XE="zip.exe" -X
  41. !endif
  42. # Define the setup and install programs, which are only suitable
  43. # for the DLL build.
  44. # If MAKEDLL==0, these names are never referenced.
  45. !ifndef SETUP_XE_NAME
  46. SETUP_XE_NAME=setupgs.exe
  47. !endif
  48. !ifndef SETUP_XE
  49. SETUP_XE=$(BINDIR)\$(SETUP_XE_NAME)
  50. !endif
  51. !ifndef UNINSTALL_XE_NAME
  52. UNINSTALL_XE_NAME=uninstgs.exe
  53. !endif
  54. !ifndef UNINSTALL_XE
  55. UNINSTALL_XE=$(BINDIR)\$(UNINSTALL_XE_NAME)
  56. !endif
  57. # Define the RCOMP switch for including INCDIR.
  58. !if "$(INCDIR)"==""
  59. i_INCDIR=
  60. !else
  61. i_INCDIR=-i$(INCDIR)
  62. !endif
  63. # ----------------------------- Main program ------------------------------ #
  64. ICONS=$(GLGEN)gswin.ico $(GLGEN)gswin16.ico
  65. GS_ALL=$(INT_ALL) $(INTASM)\
  66. $(LIB_ALL) $(LIBCTR) $(ld_tr) $(GSDLL_OBJ).res $(PSSRC)$(GSDLL).def $(ICONS)
  67. dwdll_h=$(PSSRC)dwdll.h
  68. dwimg_h=$(GLSRC)dwimg.h
  69. dwtrace_h=$(GLSRC)dwtrace.h
  70. dwmain_h=$(PSSRC)dwmain.h
  71. dwtext_h=$(GLSRC)dwtext.h
  72. dwreg_h=$(GLSRC)dwreg.h
  73. # Make the icons from their text form.
  74. $(GLGEN)gswin.ico: $(GLSRC)gswin.icx $(ECHOGS_XE) $(WININT_MAK)
  75. $(ECHOGS_XE) -wb $(GLGEN)gswin.ico -n -X -r $(GLSRC)gswin.icx
  76. $(GLGEN)gswin16.ico: $(GLSRC)gswin16.icx $(ECHOGS_XE) $(WININT_MAK)
  77. $(ECHOGS_XE) -wb $(GLGEN)gswin16.ico -n -X -r $(GLSRC)gswin16.icx
  78. # resources for short EXE loader (no dialogs)
  79. $(GS_OBJ).res: $(PSSRC)dwmain.rc $(dwmain_h) $(ICONS) $(WININT_MAK)
  80. $(ECHOGS_XE) -w $(PSGEN)_exe.rc -x 23 define -s gstext_ico $(GLGENDIR)\gswin.ico
  81. $(ECHOGS_XE) -a $(PSGEN)_exe.rc -x 23 define -s gsgraph_ico $(GLGENDIR)\gswin.ico
  82. $(ECHOGS_XE) -a $(PSGEN)_exe.rc -R $(PSSRC)dwmain.rc
  83. $(RCOMP) -i$(PSSRCDIR) -i$(PSGENDIR) $(i_INCDIR) -r $(RO_)$(GS_OBJ).res $(PSGEN)_exe.rc
  84. del $(PSGEN)_exe.rc
  85. # resources for main program (includes dialogs)
  86. $(GSDLL_OBJ).res: $(PSSRC)gsdll32.rc $(gp_mswin_h) $(ICONS) $(WININT_MAK)
  87. $(ECHOGS_XE) -w $(PSGEN)_dll.rc -x 23 define -s gstext_ico $(GLGENDIR)\gswin.ico
  88. $(ECHOGS_XE) -a $(PSGEN)_dll.rc -x 23 define -s gsgraph_ico $(GLGENDIR)\gswin.ico
  89. $(ECHOGS_XE) -a $(PSGEN)_dll.rc -R $(PSSRC)gsdll32.rc
  90. $(RCOMP) -i$(PSSRCDIR) -i$(PSGENDIR) -i$(GLSRCDIR) $(i_INCDIR) -r $(RO_)$(GSDLL_OBJ).res $(PSGEN)_dll.rc
  91. del $(PSGEN)_dll.rc
  92. # Modules for big EXE
  93. !if $(DEBUG)
  94. DWTRACE=$(GLOBJ)dwtrace.obj
  95. !else
  96. DWTRACE=
  97. !endif
  98. DWOBJNO = $(PSOBJ)dwnodll.obj $(GLOBJ)dwimg.obj $(DWTRACE) $(PSOBJ)dwmain.obj \
  99. $(GLOBJ)dwtext.obj $(GLOBJ)dwreg.obj
  100. $(PSOBJ)dwnodll.obj: $(PSSRC)dwnodll.c $(AK)\
  101. $(dwdll_h) $(iapi_h)
  102. $(PSCCWIN) $(COMPILE_FOR_EXE) $(PSO_)dwnodll.obj $(C_) $(PSSRC)dwnodll.c
  103. # Compile gsdll.c, the main program of the DLL.
  104. $(PSOBJ)gsdll.obj: $(PSSRC)gsdll.c $(AK) $(iapi_h) $(ghost_h)
  105. $(PSCCWIN) $(COMPILE_FOR_DLL) $(PSO_)gsdll.$(OBJ) $(C_) $(PSSRC)gsdll.c
  106. $(GLOBJ)gp_msdll.obj: $(GLSRC)gp_msdll.c $(AK) $(iapi_h)
  107. $(PSCCWIN) $(COMPILE_FOR_DLL) $(GLO_)gp_msdll.$(OBJ) $(C_) $(GLSRC)gp_msdll.c
  108. # Modules for console mode EXEs
  109. OBJC=$(PSOBJ)dwmainc.obj $(PSOBJ)dwdllc.obj $(GLOBJ)gscdefs.obj $(GLOBJ)gp_wgetv.obj \
  110. $(GLOBJ)dwimg.obj $(DWTRACE) $(GLOBJ)dwreg.obj
  111. OBJCNO=$(PSOBJ)dwmainc.obj $(PSOBJ)dwnodllc.obj $(GLOBJ)dwimg.obj $(DWTRACE) $(GLOBJ)dwreg.obj
  112. $(PSOBJ)dwmainc.obj: $(PSSRC)dwmainc.c $(AK) $(windows__h) $(fcntl__h) $(unistd__h) \
  113. $(iapi_h) $(vdtrace_h) $(gdevdsp_h) $(dwdll_h) $(dwimg_h) $(dwtrace_h)
  114. $(PSCCWIN) $(COMPILE_FOR_CONSOLE_EXE) $(PSO_)dwmainc.obj $(C_) $(PSSRC)dwmainc.c
  115. $(PSOBJ)dwdllc.obj: $(PSSRC)dwdll.c $(AK) $(dwdll_h) $(iapi_h)
  116. $(PSCCWIN) $(COMPILE_FOR_CONSOLE_EXE) $(PSO_)dwdllc.obj $(C_) $(PSSRC)dwdll.c
  117. $(PSOBJ)dwnodllc.obj: $(PSSRC)dwnodll.c $(AK) $(dwdll_h) $(iapi_h)
  118. $(PSCCWIN) $(COMPILE_FOR_CONSOLE_EXE) $(PSO_)dwnodllc.obj $(C_) $(PSSRC)dwnodll.c
  119. # Modules for small EXE loader.
  120. DWOBJ=$(PSOBJ)dwdll.obj $(GLOBJ)dwimg.obj $(DWTRACE) $(PSOBJ)dwmain.obj \
  121. $(GLOBJ)dwtext.obj $(GLOBJ)gscdefs.obj $(GLOBJ)gp_wgetv.obj $(GLOBJ)dwreg.obj
  122. $(PSOBJ)dwdll.obj: $(PSSRC)dwdll.c $(AK)\
  123. $(dwdll_h) $(iapi_h)
  124. $(PSCCWIN) $(COMPILE_FOR_EXE) $(PSO_)dwdll.obj $(C_) $(PSSRC)dwdll.c
  125. $(GLOBJ)dwimg.obj: $(GLSRC)dwimg.c $(AK)\
  126. $(dwmain_h) $(dwdll_h) $(dwtext_h) $(dwimg_h) $(gdevdsp_h) $(stdio__h) \
  127. $(gscdefs_h) $(iapi_h) $(dwreg_h)
  128. $(GLCPP) $(COMPILE_FOR_EXE) $(GLO_)dwimg.obj $(C_) $(GLSRC)dwimg.c
  129. $(GLOBJ)dwtrace.obj: $(GLSRC)dwtrace.c $(AK)\
  130. $(dwimg_h) $(dwtrace_h)\
  131. $(gscdefs_h) $(stdpre_h) $(gsdll_h) $(vdtrace_h)
  132. $(GLCPP) $(COMPILE_FOR_EXE) $(GLO_)dwtrace.obj $(C_) $(GLSRC)dwtrace.c
  133. $(PSOBJ)dwmain.obj: $(PSSRC)dwmain.c $(AK) $(windows__h) \
  134. $(iapi_h) $(vdtrace_h) $(dwmain_h) $(dwdll_h) $(dwtext_h) $(dwimg_h) $(dwtrace_h) \
  135. $(dwreg_h) $(gdevdsp_h)
  136. $(PSCCWIN) $(COMPILE_FOR_EXE) $(PSO_)dwmain.obj $(C_) $(PSSRC)dwmain.c
  137. $(GLOBJ)dwtext.obj: $(GLSRC)dwtext.c $(AK) $(dwtext_h)
  138. $(GLCPP) $(COMPILE_FOR_EXE) $(GLO_)dwtext.obj $(C_) $(GLSRC)dwtext.c
  139. $(GLOBJ)dwreg.obj: $(PSSRC)dwreg.c $(AK) $(dwreg_h)
  140. $(GLCPP) $(COMPILE_FOR_EXE) $(GLO_)dwreg.obj $(C_) $(GLSRC)dwreg.c
  141. # ---------------------- Setup and uninstall program ---------------------- #
  142. # Modules for setup program
  143. # These modules shouldn't be referenced if MAKEDDLL==0,but dependencies here
  144. # don't hurt.
  145. $(PSOBJ)dwsetup.res: $(PSSRC)dwsetup.rc $(PSSRC)dwsetup.h $(GLGEN)gswin.ico
  146. $(RCOMP) -i$(PSSRCDIR) -i$(PSGENDIR) -i$(PSOBJDIR) $(i_INCDIR) -r $(RO_)$(PSOBJ)dwsetup.res $(PSSRC)dwsetup.rc
  147. $(PSOBJ)dwsetup.obj: $(PSSRC)dwsetup.cpp $(PSSRC)dwsetup.h $(PSSRC)dwinst.h
  148. $(PSCCWIN) $(COMPILE_FOR_EXE) $(PSO_)dwsetup.obj $(C_) $(PSSRC)dwsetup.cpp
  149. $(PSOBJ)dwinst.obj: $(PSSRC)dwinst.cpp $(PSSRC)dwinst.h
  150. $(PSCCWIN) $(COMPILE_FOR_EXE) $(PSO_)dwinst.obj $(C_) $(PSSRC)dwinst.cpp
  151. # Modules for uninstall program
  152. $(PSOBJ)dwuninst.res: $(PSSRC)dwuninst.rc $(PSSRC)dwuninst.h $(GLGEN)gswin.ico
  153. $(RCOMP) -i$(PSSRCDIR) -i$(PSGENDIR) -i$(PSOBJDIR) $(i_INCDIR) -r $(RO_)$(PSOBJ)dwuninst.res $(PSSRC)dwuninst.rc
  154. $(PSOBJ)dwuninst.obj: $(PSSRC)dwuninst.cpp $(PSSRC)dwuninst.h
  155. $(PSCCWIN) $(COMPILE_FOR_EXE) $(PSO_)dwuninst.obj $(C_) $(PSSRC)dwuninst.cpp
  156. # ------------------------- Distribution archive -------------------------- #
  157. # The following section of this makefile was developed by, and is maintained
  158. # by, the developer of GSview. If you have any questions about it, please
  159. # contact bug-gswin@ghostscript.com.
  160. # Create a self-extracting archive with setup program.
  161. # This assumes that the current directory is named gs#.## relative to its
  162. # parent, where #.## is the Ghostscript version, and that the files and
  163. # directories listed in ZIPTEMPFILE and ZIPFONTFILES are the complete list
  164. # of needed files and directories relative to the current directory's parent.
  165. ZIPTEMPFILE=gs$(GS_DOT_VERSION)\obj\dwfiles.rsp
  166. ZIPPROGFILE1=gs$(GS_DOT_VERSION)\bin\gsdll32.dll
  167. ZIPPROGFILE2=gs$(GS_DOT_VERSION)\bin\gsdll32.lib
  168. ZIPPROGFILE3=gs$(GS_DOT_VERSION)\bin\gswin32.exe
  169. ZIPPROGFILE4=gs$(GS_DOT_VERSION)\bin\gswin32c.exe
  170. ZIPPROGFILE5=gs$(GS_DOT_VERSION)\bin\gs16spl.exe
  171. ZIPPROGFILE6=gs$(GS_DOT_VERSION)\doc
  172. ZIPPROGFILE7=gs$(GS_DOT_VERSION)\examples
  173. ZIPPROGFILE8=gs$(GS_DOT_VERSION)\lib
  174. ZIPPROGFILE9=gs$(GS_DOT_VERSION)\Resource
  175. ZIPFONTDIR=fonts
  176. ZIPFONTFILES=$(ZIPFONTDIR)\*.*
  177. # Make the zip archive.
  178. FILELIST_TXT=filelist.txt
  179. FONTLIST_TXT=fontlist.txt
  180. !ifdef WIN64
  181. ZIPTARGET=gs$(GS_VERSION)w64
  182. !else
  183. ZIPTARGET=gs$(GS_VERSION)w32
  184. !endif
  185. zip: $(SETUP_XE) $(UNINSTALL_XE)
  186. cd ..
  187. copy gs$(GS_DOT_VERSION)\$(SETUP_XE) .
  188. copy gs$(GS_DOT_VERSION)\$(UNINSTALL_XE) .
  189. echo $(ZIPPROGFILE1) > $(ZIPTEMPFILE)
  190. echo $(ZIPPROGFILE2) >> $(ZIPTEMPFILE)
  191. echo $(ZIPPROGFILE3) >> $(ZIPTEMPFILE)
  192. echo $(ZIPPROGFILE4) >> $(ZIPTEMPFILE)
  193. echo $(ZIPPROGFILE5) >> $(ZIPTEMPFILE)
  194. echo $(ZIPPROGFILE6) >> $(ZIPTEMPFILE)
  195. echo $(ZIPPROGFILE7) >> $(ZIPTEMPFILE)
  196. echo $(ZIPPROGFILE8) >> $(ZIPTEMPFILE)
  197. echo $(ZIPPROGFILE9) >> $(ZIPTEMPFILE)
  198. $(SETUP_XE_NAME) -title "AFPL Ghostscript $(GS_DOT_VERSION)" -dir "gs$(GS_DOT_VERSION)" -list "$(FILELIST_TXT)" @$(ZIPTEMPFILE)
  199. $(SETUP_XE_NAME) -title "AFPL Ghostscript Fonts" -dir "fonts" -list "$(FONTLIST_TXT)" $(ZIPFONTFILES)
  200. -del $(ZIPTARGET).zip
  201. $(ZIP_XE) -9 $(ZIPTARGET).zip $(SETUP_XE_NAME) $(UNINSTALL_XE_NAME) $(FILELIST_TXT) $(FONTLIST_TXT)
  202. $(ZIP_XE) -9 -r $(ZIPTARGET).zip $(ZIPFONTDIR)
  203. $(ZIP_XE) -9 -r $(ZIPTARGET).zip $(ZIPPROGFILE1)
  204. $(ZIP_XE) -9 -r $(ZIPTARGET).zip $(ZIPPROGFILE2)
  205. $(ZIP_XE) -9 -r $(ZIPTARGET).zip $(ZIPPROGFILE3)
  206. $(ZIP_XE) -9 -r $(ZIPTARGET).zip $(ZIPPROGFILE4)
  207. rem
  208. rem Don't flag error if Win32s spooler file is missing.
  209. rem This occurs when using MSVC++.
  210. rem
  211. -$(ZIP_XE) -9 -r $(ZIPTARGET).zip $(ZIPPROGFILE5)
  212. $(ZIP_XE) -9 -r $(ZIPTARGET).zip $(ZIPPROGFILE6)
  213. $(ZIP_XE) -9 -r $(ZIPTARGET).zip $(ZIPPROGFILE7)
  214. $(ZIP_XE) -9 -r $(ZIPTARGET).zip $(ZIPPROGFILE8)
  215. $(ZIP_XE) -9 -r $(ZIPTARGET).zip $(ZIPPROGFILE9)
  216. -del $(ZIPTEMPFILE)
  217. -del $(SETUP_XE_NAME)
  218. -del $(UNINSTALL_XE_NAME)
  219. -del $(FILELIST_TXT)
  220. -del $(FONTLIST_TXT)
  221. cd gs$(GS_DOT_VERSION)
  222. # Now convert to a self extracting archive.
  223. # This involves making a few temporary files.
  224. ZIP_RSP = $(PSOBJ)setupgs.rsp
  225. # Note that we use ECHOGS_XE rather than echo for the .txt files
  226. # to avoid ANSI/OEM character mapping.
  227. # Use a special icon WinZip SE can't handle 48 pixel 32-bit icons
  228. # as used by Windows XP.
  229. archive: zip $(PSOBJ)gswin16.ico $(ECHOGS_XE)
  230. $(ECHOGS_XE) -w $(ZIP_RSP) -q "-win32 -setup"
  231. $(ECHOGS_XE) -a $(ZIP_RSP) -q -st -x 22 AFPL Ghostscript $(GS_DOT_VERSION) for Win32 -x 22
  232. $(ECHOGS_XE) -a $(ZIP_RSP) -q -i -s $(PSOBJ)gswin16.ico
  233. $(ECHOGS_XE) -a $(ZIP_RSP) -q -a -s $(PSOBJ)about.txt
  234. $(ECHOGS_XE) -a $(ZIP_RSP) -q -t -s $(PSOBJ)dialog.txt
  235. $(ECHOGS_XE) -a $(ZIP_RSP) -q -c -s $(SETUP_XE_NAME)
  236. $(ECHOGS_XE) -w $(PSOBJ)about.txt "AFPL Ghostscript is Copyright " -x A9 " 2005 artofcode LLC."
  237. $(ECHOGS_XE) -a $(PSOBJ)about.txt See license in gs$(GS_DOT_VERSION)\doc\Public.htm.
  238. $(ECHOGS_XE) -a $(PSOBJ)about.txt See gs$(GS_DOT_VERSION)\doc\Commprod.htm regarding commercial distribution.
  239. $(ECHOGS_XE) -w $(PSOBJ)dialog.txt This installs AFPL Ghostscript $(GS_DOT_VERSION).
  240. $(ECHOGS_XE) -a $(PSOBJ)dialog.txt AFPL Ghostscript displays, prints and converts PostScript and PDF files.
  241. $(WINZIPSE_XE) ..\$(ZIPTARGET) @$(PSOBJ)setupgs.rsp
  242. # Don't delete temporary files, because make continues
  243. # before these files are used.
  244. # -del $(ZIP_RSP)
  245. # -del $(PSOBJ)about.txt
  246. # -del $(PSOBJ)dialog.txt
  247. # end of winint.mak