home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / sharewar / dos / program / gs300sr2 / gs300sr2.exe / OS2.MAK < prev    next >
Encoding:
Text File  |  1994-07-31  |  10.1 KB  |  389 lines

  1. #    Copyright (C) 1989, 1990, 1991, 1992, 1993 Aladdin Enterprises.  All rights reserved.
  2. # This file is part of Aladdin Ghostscript.
  3. # Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  4. # or distributor accepts any responsibility for the consequences of using it,
  5. # or for whether it serves any particular purpose or works at all, unless he
  6. # or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  7. # License (the "License") for full details.
  8. # Every copy of Aladdin Ghostscript must include a copy of the License,
  9. # normally in a plain ASCII text file named PUBLIC.  The License grants you
  10. # the right to copy, modify and redistribute Aladdin Ghostscript, but only
  11. # under certain conditions described in the License.  Among other things, the
  12. # License requires that the copyright notice and this notice be preserved on
  13. # all copies.
  14.  
  15. # makefile for MS-DOS or OS/2 GCC/EMX platform.
  16. # Uses Borland (MSDOS) MAKER or 
  17. # Uses IBM NMAKE.EXE Version 2.000.000 Mar 27 1992
  18.  
  19. # ------------------------------- Options ------------------------------- #
  20.  
  21. ###### This section is the only part of the file you should need to edit.
  22.  
  23. # ------ Generic options ------ #
  24.  
  25. # Define the directory that will hold documentation at runtime.
  26.  
  27. GS_DOCDIR=c:/gs
  28.  
  29. # Define the default directory/ies for the runtime
  30. # initialization and font files.  Separate multiple directories with ;.
  31. # Use / to indicate directories, not a single \.
  32.  
  33. GS_LIB_DEFAULT=c:/gs;c:/gs/fonts
  34.  
  35. # Define the name of the interpreter initialization file.
  36. # (There is no reason to change this.)
  37.  
  38. GS_INIT=gs_init.ps
  39.  
  40. # Choose generic configuration options.
  41.  
  42. # Setting DEBUG=1 includes debugging features (-Z switch) in the code.
  43. # Code runs substantially slower even if no debugging switches are set,
  44. # and also takes about another 25K of memory.
  45.  
  46. DEBUG=0
  47.  
  48. # Setting GDEBUG=1 includes symbol table information for GDB.
  49. # Produces larger .OBJ and .EXE files.
  50.  
  51. GDEBUG=0
  52.  
  53. # Setting NOPRIVATE=1 makes private (static) procedures and variables public,
  54. # so they are visible to the debugger and profiler.
  55. # No execution time or space penalty, just larger .OBJ and .EXE files.
  56.  
  57. NOPRIVATE=0
  58.  
  59. # Setting GSDLL=1 makes the target a DLL instead of an EXE
  60. GSDLL=0
  61.  
  62. # Define the name of the executable file.
  63.  
  64. !if $(GSDLL)
  65. GS=gsdll2
  66. !else
  67. GS=gsos2
  68. !endif
  69.  
  70. # ------ Platform-specific options ------ #
  71.  
  72. # If you don't have an assembler, set USE_ASM=0.  Otherwise, set USE_ASM=1,
  73. # and set ASM to the name of the assembler you are using.  This can be
  74. # a full path name if you want.  Normally it will be masm or tasm.
  75.  
  76. USE_ASM=0
  77. ASM= 
  78.  
  79. # Define the drive, directory, and compiler name for the EMX files.
  80. # COMP is the compiler name (gcc)
  81. # COMPDIR contains the compiler and linker (normally \emx\bin).
  82. # EMXPATH contains the path to the EMX directory (normally /emx)
  83. # INCDIR contains the include files (normally /emx/include).
  84. # LIBDIR contains the library files (normally /emx/lib).
  85. # Note that these prefixes are always followed by a \,
  86. #   so if you want to use the current directory, use an explicit '.'.
  87.  
  88. COMP=gcc
  89. COMPBASE=\emx
  90. EMXPATH=/emx
  91. COMPDIR=$(COMPBASE)\bin
  92. INCDIR=$(EMXPATH)/include
  93. LIBDIR=$(EMXPATH)/lib
  94.  
  95. # Choose platform-specific options.
  96.  
  97. # Define the processor (CPU) type.  Options are 86 (8086 or 8088),
  98. # 186, 286, 386, 485 (486SX or Cyrix 486SLC), or 486 (486DX).
  99. # Higher numbers produce code that may be significantly smaller and faster,
  100. # but the executable will bail out with an error message on any processor
  101. # less capable than the designated one.
  102.  
  103. # EMX requires 386 or higher
  104. CPU_TYPE=386
  105.  
  106. # Define the math coprocessor (FPU) type.
  107. # Options are -1 (optimize for no FPU), 0 (optimize for FPU present,
  108. # but do not require a FPU), 87, 287, or 387.
  109. # If CPU_TYPE is 486, FPU_TYPE is implicitly set to 387,
  110. # since 486DX processors include the equivalent of an 80387 on-chip.
  111. # An xx87 option means that the executable will run only if a FPU
  112. # of that type (or higher) is available: this is NOT currently checked
  113. # at runtime.
  114.  
  115. FPU_TYPE=0
  116.  
  117. # ---------------------------- End of options ---------------------------- #
  118.  
  119. # Swapping `make' out of memory makes linking much faster.
  120. # only used by Borland MAKER.EXE
  121.  
  122. #.swap
  123.  
  124. # Define the platform name.
  125.  
  126. PLATFORM=os2_
  127.  
  128. # Define the name of the makefile -- used in dependencies.
  129.  
  130. MAKEFILE=os2.mak
  131.  
  132. # Define the ANSI-to-K&R dependency.
  133.  
  134. AK=
  135.  
  136. #Compiler Optimiser option
  137. CO=-O
  138.  
  139. # Make sure we get the right default target for make.
  140.  
  141. dosdefault: default gspmdrv.exe
  142.  
  143. # Define a rule for invoking just the preprocessor.
  144.  
  145. .c.i:
  146.     $(COMPDIR)\cpp $(CCFLAGS) $<
  147.  
  148. # Define the extensions for command, object, and executable files.
  149.  
  150. CMD=.cmd
  151. O=-o ./
  152. OBJ=o
  153. XE=.exe
  154.  
  155. # Define the current directory prefix, shell quote string, and shell name.
  156.  
  157. D=\#
  158.  
  159. EXP=
  160. QQ="
  161. SH=
  162. SHP=
  163.  
  164. # Define the arguments for genconf.
  165.  
  166. #CONFILES=-p %s -o obj.tr -l lib.tr
  167. CONFILES=-o obj.tr -l lib.tr
  168.  
  169. # Define the generic compilation flags.
  170.  
  171. !if $(CPU_TYPE) >= 486
  172. ASMCPU=/DFOR80386 /DFOR80486
  173. PLATOPT=-DFOR80386 -DFOR80486
  174. !else
  175. !if $(CPU_TYPE) >= 386
  176. ASMCPU=/DFOR80386
  177. PLATOPT=-DFOR80386
  178. !endif
  179. !endif
  180.  
  181. !if $(FPU_TYPE) > 0
  182. ASMFPU=/DFORFPU
  183. !else
  184. ASMFPU=
  185. !endif
  186.  
  187. !if $(USE_ASM)
  188. INTASM=iutilasm.$(OBJ)
  189. PCFBASM=gdevegaa.$(OBJ)
  190. !else
  191. INTASM=
  192. PCFBASM=
  193. !endif
  194.  
  195. # Define the generic compilation rules.
  196.  
  197. ASMFLAGS=$(ASMCPU) $(ASMFPU) $(ASMDEBUG)
  198.  
  199. .asm.o:
  200.     $(ASM) $(ASMFLAGS) $<;
  201.  
  202. # -------------------------- Auxiliary programs --------------------------- #
  203.  
  204. CCAUX=$(COMPDIR)\$(COMP) -O
  205.  
  206. echogs$(XE): echogs.c
  207.     $(CCAUX) -o echogs echogs.c
  208.     $(COMPDIR)\emxbind $(EMXPATH)/bin/emxl.exe echogs echogs.exe
  209.     del echogs
  210.  
  211. genarch$(XE): genarch.c
  212.     $(CCAUX) -o genarch genarch.c
  213.     $(COMPDIR)\emxbind $(EMXPATH)/bin/emxl.exe genarch genarch.exe
  214.     del genarch
  215.  
  216. genconf$(XE): genconf.c
  217.     $(CCAUX) -o genconf genconf.c
  218.     $(COMPDIR)\emxbind $(EMXPATH)/bin/emxl.exe genconf genconf.exe
  219.     del genconf
  220.  
  221. # No special gconfig_.h is needed.
  222. gconfig_.h: echogs$(XE)
  223.     echogs -w gconfig_.h /* This file deliberately left blank. */
  224.  
  225. # ---------------------- MS-DOS I/O debugging option ---------------------- #
  226.  
  227. dosio_=zdosio.$(OBJ)
  228. dosio.dev: $(dosio_)
  229.     $(SETMOD) dosio $(dosio_)
  230.     $(ADDMOD) dosio -oper zdosio
  231.  
  232. zdosio.$(OBJ): zdosio.c $(OP) $(store_h)
  233.  
  234. # ----------------------------- Assembly code ----------------------------- #
  235.  
  236. iutilasm.$(OBJ): iutilasm.asm
  237.  
  238. #################  END
  239.  
  240. # Define the compilation flags.
  241.  
  242. !if $(NOPRIVATE)
  243. CP=-DNOPRIVATE
  244. !else
  245. CP=
  246. !endif
  247.  
  248. !if $(DEBUG)
  249. CD=-DDEBUG
  250. !else
  251. CD=
  252. !endif
  253.   
  254. !if $(GDEBUG)
  255. CGDB=-g
  256. !else
  257. CGDB=
  258. !endif
  259.  
  260. !if $(GSDLL)
  261. CDLL=-Zdll -D__DLL__
  262. !else
  263. CDLL=
  264. !endif
  265.  
  266. GENOPT=$(CP) $(CD) $(CGDB) $(CDLL)
  267.  
  268. CCFLAGS0=$(GENOPT) $(PLATOPT)
  269. CCFLAGS=$(CCFLAGS0) 
  270. CC=$(COMPDIR)\$(COMP) $(CCFLAGS0)
  271. CCC=$(CC) -c
  272. CCD=$(CC) -O -c
  273. CCCF=$(COMPDIR)\$(COMP) -O $(CCFLAGS0) -c
  274. CCINT=$(CC) -c
  275.  
  276. .c.o:
  277. #    $(CCC) { $<}
  278.     $(CCC) $<
  279.  
  280. # ------ Devices and features ------ #
  281.  
  282. # Choose the language feature(s) to include.  See gs.mak for details.
  283. # Since we have a large address space, we include some optional features.
  284.  
  285. FEATURE_DEVS=level2.dev dps.dev
  286.  
  287. # Choose the device(s) to include.  See devs.mak for details.
  288.  
  289. !if $(GSDLL)
  290. DEVICE_DEVS=os2dll.dev os2pm.dev
  291. !else
  292. DEVICE_DEVS=os2pm.dev
  293. !endif
  294. DEVICE_DEVS2=deskjet.dev djet500.dev laserjet.dev ljetplus.dev ljet2p.dev ljet3.dev ljet4.dev
  295. DEVICE_DEVS3=cdeskjet.dev cdjcolor.dev cdjmono.dev cdj550.dev paintjet.dev pjetxl.dev
  296. DEVICE_DEVS4=epson.dev eps9high.dev ibmpro.dev st800.dev bj10e.dev bj200.dev
  297. DEVICE_DEVS5=bmpmono.dev bmp16.dev bmp256.dev bmp16m.dev
  298. DEVICE_DEVS6=gifmono.dev gif8.dev pcxmono.dev pcx16.dev pcx256.dev
  299. DEVICE_DEVS7=pbm.dev pbmraw.dev pgm.dev pgmraw.dev ppm.dev ppmraw.dev
  300. DEVICE_DEVS8=tiffg3.dev tiffg4.dev
  301. !include "gs.mak"
  302. !include "jpeg.mak"
  303. !include "devs.mak"
  304.  
  305. # -------------------------------- Library -------------------------------- #
  306.  
  307. # The GCC/EMX platform
  308.  
  309. os2__=gp_nofb.$(OBJ) gp_os2.$(OBJ)
  310. os2_.dev: $(os2__)
  311.     $(SETMOD) os2_ $(os2__)
  312. !if $(GSDLL)
  313. # Using a file device resource to get the console streams re-initialized 
  314. # is bad architecture (an upward reference to ziodev),                   
  315. # but it will have to do for the moment.                                 
  316. #   We need to redirect stdin/out/err to gsdll_callback
  317.         $(ADDMOD) os2_ -iodev wstdio                                   
  318. !endif
  319.   
  320.  
  321. gp_os2.$(OBJ): gp_os2.c gsdll.h $(dos__h) $(string__h) $(time__h) \
  322.   $(gx_h) $(gsexit_h) $(gp_h)
  323.  
  324. # ----------------------------- Main program ------------------------------ #
  325.  
  326. BEGINFILES=gs*.res gs*.ico
  327. CCBEGIN=$(CCC) *.c
  328.  
  329. # Get around the fact that the DOS shell has a rather small limit on
  330. # the length of a command line.  (sigh)
  331.  
  332. LIBDOS=$(LIBGS)
  333.  
  334. # Interpreter main program
  335.  
  336. ICONS=gsos2.ico gspmdrv.ico
  337.  
  338. !if $(GSDLL)
  339. #making a DLL
  340. GS_ALL=gsdll.$(OBJ) $(INT_ALL) $(INTASM)\
  341.   $(LIB_ALL) $(LIBCTR) obj.tr lib.tr $(GS).res $(ICONS)
  342.  
  343. $(GS)$(XE): $(GS).dll
  344.  
  345. gsdll.$(OBJ): gsdll.c gsdll.h $(ghost_h)
  346.  
  347. $(GS).dll: $(GS_ALL) $(ALL_DEVS)
  348.     $(COMPDIR)\gcc $(CGDB) $(CDLL) -o $(GS) gsdll.$(OBJ) @obj.tr $(INTASM) -lm
  349.     $(COMPDIR)\emxbind -r$*.res -d$*.def $(COMPDIR)\emxl.exe $(GS) $(GS).dll -ac
  350.     del $(GS)
  351.     emximp gsdll2.imp
  352. !else
  353. #making an EXE
  354. GS_ALL=gs.$(OBJ) $(INT_ALL) $(INTASM)\
  355.   $(LIB_ALL) $(LIBCTR) obj.tr lib.tr $(GS).res $(ICONS)
  356.  
  357. $(GS)$(XE): $(GS_ALL) $(ALL_DEVS)
  358.     $(COMPDIR)\gcc $(CGDB) -o $(GS) gs.$(OBJ) @obj.tr $(INTASM) -lm
  359.     $(COMPDIR)\emxbind -r$*.res $(COMPDIR)\emxl.exe $(GS) $(GS)$(XE) -ac
  360.     del $(GS)
  361. !endif
  362.  
  363. # Make the icons from their text form.
  364.  
  365. gsos2.ico: gsos2.icx echogs$(XE)
  366.     echogs -wb gsos2.ico -n -X -r gsos2.icx
  367.  
  368. gspmdrv.ico: gspmdrv.icx echogs$(XE)
  369.     echogs -wb gspmdrv.ico -n -X -r gspmdrv.icx
  370.  
  371. $(GS).res: $(GS).rc gsos2.ico
  372.     rc -i $(COMPBASE)\include -r $*.rc
  373.  
  374. # PM driver program
  375.  
  376. gspmdrv.o: gspmdrv.c gspmdrv.h
  377.     $(COMPDIR)\gcc $(CGDB) -c $*.c
  378.  
  379. gspmdrv.res: gspmdrv.rc gspmdrv.h gspmdrv.ico
  380.     rc -i $(COMPBASE)\include -r $*.rc
  381.  
  382. gspmdrv.exe: gspmdrv.o gspmdrv.res gspmdrv.def
  383.     $(COMPDIR)\gcc $(CGDB) -o $* $*.o
  384.     $(COMPDIR)\emxbind -p -r$*.res -d$*.def $(COMPDIR)\emxl.exe $* $*.exe
  385.     del $*
  386.