home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip51.zip / os2 / makefile.os2 < prev    next >
Makefile  |  1994-02-06  |  6KB  |  234 lines

  1. # Makefile for UnZip and fUnZip                           6 February 1994
  2. #
  3. # - for Microsoft C, version 6.00 or higher, for use under OS/2 1.x (16-bit)
  4. # - for Watcom C/386, version 9.0 or higher, for use under OS/2 2.x (32-bit)
  5. # - for IBM C/C++ Set/2, for use under OS/2 2.x (32-bit)
  6. # - for Borland C++, for use under OS/2 2.x (32-bit)
  7. # - for GNU gcc (emx kit), version 0.8e or higher, for use under OS/2 2.x
  8. #
  9. # cross-compilation:
  10. # - for Microsoft C, version 6.00 or higher, for use under MS-DOS (16-bit)
  11. # - for GNU gcc (emx), version 0.8h or higher, for use under MS-DOS (32-bit)
  12.  
  13. # To use, enter "{d,n}make -f makefile.os2" (this makefile depends on its
  14. # name being "makefile.os2", and it must be in the main unzip directory).
  15.  
  16. # Notes on Microsoft C 6.00 compilation for OS/2:
  17. #
  18. #   The resulting programs can be used under OS/2 1.x or 2.x protected
  19. #   mode only, not under DOS.  A larger stack has to be used for OS/2
  20. #   because system calls use more stack than under DOS; 8k is recommended
  21. #   by Microsoft.
  22.  
  23. # Notes on IBM C Set/2, Watcom C/386, Borland C++ or emx+gcc compilation:
  24. #
  25. #   The resulting programs can be used under protected mode of OS/2 2.x
  26. #   only, not under OS/2 1.x and not under DOS.
  27. #
  28. #   The NFLAGS macro is used to work around an optimization bug in the IBM
  29. #   C++ Set compiler; this is fixed by CSD #4, so NFLAGS="" can be used for
  30. #   all targets below.  We'll leave it as is for this release...
  31. #
  32. #   For Watcom C/386, edit the os2$(OBJ) target so that os2/os2.c reads
  33. #   os2\os2.c instead.  Watcom can't handle forward slashes; gcc can't
  34. #   handle backslashes.  We'll see about making this a macro next time...
  35.  
  36. default:
  37.     @echo "Enter `$(MAKE) -f makefile.os2 target' with makefile.os2 copied"
  38.     @echo "to the main UnZip directory and where target is one of:"
  39.     @echo "   msc mscdos ibm ibmdyn ibmdebug ibmprof"
  40.     @echo "   watcom borland gcc gccdyn gccdebug gccdos"
  41.  
  42. # MS C 6.00 for OS/2, 16-bit (should figure out way to split unzip/funzip 
  43. # compiles so former is always large model and latter always small model...)
  44. msc:
  45.     $(MAKE) -f makefile.os2 all \
  46.     CC="cl -nologo -AL -Ocegit -Gs -I. $(FP)" \
  47.     CFLAGS="-G2 -Zp1 -DOS2 -DMSC" \
  48.     NFLAGS="" \
  49.     LDFLAGS="-Lp -Fe" \
  50.     LDFLAGS2="-link /noe" \
  51.     OUT="-Fo" \
  52.     OBJ=".obj" \
  53.     DEF="os2\unzip16.def"
  54.  
  55. # cross-compilation for MS-DOS with MS C 6.00 (same comment as above)
  56. mscdos:
  57.     $(MAKE) -f makefile.os2 all \
  58.     CC="cl -nologo -AL -Oaict -Gs -I. $(FP)" \
  59.     CFLAGS="-Zp1" \
  60.     NFLAGS="" \
  61.     LDFLAGS="-F 0c00 -Lr -Fe" \
  62.     LDFLAGS2="-link /noe /exe" \
  63.     OUT="-Fo" \
  64.     OBJ=".obj" \
  65.     OBJU2="msdos.obj"
  66.  
  67. # IBM C Set/2, statically linked runtime
  68. ibm:
  69.     $(MAKE) -f makefile.os2 all \
  70.     CC="icc -Q -O -Gs -I." \
  71.     CFLAGS="-Sm -Sp1 -DOS2" \
  72.     NFLAGS="-O-" \
  73.     LDFLAGS="-Fe" \
  74.     LDFLAGS2="" \
  75.     OUT="-Fo" \
  76.     OBJ=".obj" \
  77.     DEF="os2\unzip.def"
  78.  
  79. # IBM C Set/2, dynamically linked runtime
  80. ibmdyn:
  81.     $(MAKE) -f makefile.os2 all \
  82.     CC="icc -Q -O -Gs -Gd -I." \
  83.     CFLAGS="-Sm -Sp1 -DOS2" \
  84.     NFLAGS="-O-" \
  85.     LDFLAGS="-Fe" \
  86.     LDFLAGS2="" \
  87.     OUT="-Fo" \
  88.     OBJ=".obj" \
  89.     DEF="os2\unzip.def"
  90.  
  91. # IBM C Set/2, debug version
  92. ibmdebug:
  93.     $(MAKE) -f makefile.os2 all \
  94.     CC="icc -Q -Ti -I." \
  95.     CFLAGS="-Sm -Sp1 -D__DEBUG_ALLOC__ -DOS2" \
  96.     NFLAGS="-O-" \
  97.     LDFLAGS="-Fe" \
  98.     LDFLAGS2="" \
  99.     OUT="-Fo" \
  100.     OBJ=".obj" \
  101.     DEF="os2\unzip.def"
  102.  
  103. # IBM C Set/2, profiling version for PROFIT
  104. ibmprof:
  105.     $(MAKE) -f makefile.os2 all \
  106.     CC="icc -Q -O -Gs -Gh -Ti -I." \
  107.     CFLAGS="-Sm -Sp1 -DOS2" \
  108.     NFLAGS="-O-" \
  109.     LDFLAGS="-Fe" \
  110.     LDFLAGS2="profit.obj" \
  111.     OUT="-Fo" \
  112.     OBJ=".obj" \
  113.     DEF="os2\unzip.def"
  114.  
  115. # Watcom C/386 9.0
  116. watcom:
  117.     $(MAKE) -f makefile.os2 all \
  118.     CC="wcl386 -zq -Ox -s -I." \
  119.     CFLAGS="-Zp1 -DOS2" \
  120.     NFLAGS="" \
  121.     LDFLAGS="-k0x40000 -x -Fe=" \
  122.     LDFLAGS2="" \
  123.     OUT="-Fo" \
  124.     OBJ=".obj" \
  125.     DEF=""
  126.  
  127. # Borland C++
  128. borland:
  129.     $(MAKE) -f makefile.os2 all \
  130.     CC="bcc -O -I." \
  131.     CFLAGS="-w- -D__cdecl -DOS2" \
  132.     NFLAGS="" \
  133.     LDFLAGS="-e" \
  134.     LDFLAGS2="" \
  135.     OUT="-o" \
  136.     OBJ=".obj" \
  137.     DEF="-sDos2\unzip.def"
  138.  
  139. # emx 0.8f, gcc, OMF format, statically linked C runtime and emx
  140. gcc:
  141.     $(MAKE) -f makefile.os2 all \
  142.     CC="gcc -Zomf -Zsys -O -I." \
  143.     CFLAGS="-DOS2" \
  144.     NFLAGS="" \
  145.     LDFLAGS="-o ./" \
  146.     LDFLAGS2="-s -los2" \
  147.     OUT="-o" \
  148.     OBJ=".obj" \
  149.     DEF="os2/unzip.def"
  150.  
  151. # emx 0.8g and later, gcc, OMF format, dynamically linked C runtime and emx
  152. # (for 0.8f or earlier, change -Zmtd to -Zmt)
  153. gccdyn:
  154.     $(MAKE) -f makefile.os2 all \
  155.     CC="gcc -Zomf -Zmtd -O -I." \
  156.     CFLAGS="-DOS2" \
  157.     NFLAGS="" \
  158.     LDFLAGS="-o ./" \
  159.     LDFLAGS2="-s -los2" \
  160.     OUT="-o" \
  161.     OBJ=".obj" \
  162.     DEF="os2/unzip.def"
  163.  
  164. # emx, gcc, a.out format, with debug info for gdb
  165. gccdebug:
  166.     $(MAKE) -f makefile.os2 all \
  167.     CC="gcc -g -I." \
  168.     CFLAGS="-DOS2" \
  169.     NFLAGS="" \
  170.     LDFLAGS="-o ./" \
  171.     LDFLAGS2="-los2" \
  172.     OUT="-o" \
  173.     OBJ=".o"
  174.  
  175. # emx, gcc, a.out format, for MS-DOS
  176. gccdos:
  177.     $(MAKE) -f makefile.os2 all \
  178.     CC="gcc -O -I." \
  179.     CFLAGS="-DMSDOS" \
  180.     NFLAGS="" \
  181.     LDFLAGS="-o ./" \
  182.     LDFLAGS2="-s" \
  183.     OUT="-o" \
  184.     OBJ=".o" \
  185.     OBJU2="msdos.o"
  186.  
  187. # variables
  188. OBJU  = unzip$(OBJ) crypt$(OBJ) envargs$(OBJ) explode$(OBJ) \
  189.     extract$(OBJ) file_io$(OBJ) inflate$(OBJ) match$(OBJ) \
  190.     unreduce$(OBJ) unshrink$(OBJ) zipinfo$(OBJ)
  191. OBJU2 = os2$(OBJ)
  192. OBJF  = funzip$(OBJ) inflate_$(OBJ) crypt_$(OBJ)
  193.  
  194. .SUFFIXES:    .c $(OBJ)
  195.  
  196. .c$(OBJ):
  197.     $(CC) -c $(CFLAGS) $<
  198.  
  199. all:    unzip.exe funzip.exe
  200.  
  201. unzip.exe: $(OBJU) $(OBJU2)
  202.     $(CC) $(LDFLAGS)$@ $(DEF) $(OBJU) $(OBJU2) $(LDFLAGS2)
  203.  
  204. funzip.exe: $(OBJF)
  205.     $(CC) $(LDFLAGS)$@ $(DEF) $(OBJF) $(LDFLAGS2)
  206.  
  207. envargs$(OBJ):    envargs.c unzip.h
  208. explode$(OBJ):    explode.c unzip.h
  209. extract$(OBJ):    extract.c unzip.h crypt.h
  210. file_io$(OBJ):    file_io.c unzip.h crypt.h tables.h
  211. funzip$(OBJ):    funzip.c unzip.h crypt.h tables.h
  212. inflate$(OBJ):    inflate.c unzip.h
  213. match$(OBJ):    match.c unzip.h
  214. unreduce$(OBJ):    unreduce.c unzip.h
  215. unshrink$(OBJ):    unshrink.c unzip.h
  216. unzip$(OBJ):    unzip.c unzip.h
  217. zipinfo$(OBJ):    zipinfo.c unzip.h
  218.  
  219. msdos$(OBJ):    msdos/msdos.c unzip.h
  220.     $(CC) -c $(CFLAGS) msdos/msdos.c
  221.  
  222. os2$(OBJ):    os2/os2.c unzip.h
  223.     $(CC) -c $(CFLAGS) os2/os2.c
  224.  
  225. # NFLAGS are solely used as work-around for optimization bug in IBM C++ Set
  226. crypt$(OBJ):    crypt.c unzip.h crypt.h zip.h
  227.     $(CC) -c $(CFLAGS) $(NFLAGS) crypt.c
  228.  
  229. crypt_$(OBJ):    crypt.c unzip.h zip.h crypt.h
  230.     $(CC) -c $(CFLAGS) $(NFLAGS) -DFUNZIP $(OUT)$@ crypt.c
  231.  
  232. inflate_$(OBJ):    inflate.c inflate.h unzip.h crypt.h
  233.     $(CC) -c $(CFLAGS) -DFUNZIP $(OUT)$@ inflate.c
  234.