home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / ZIP19P1.ZIP / os2 / makefile.os2 next >
Makefile  |  1993-01-23  |  6KB  |  199 lines

  1. # Makefile for Zip, ZipCloak, ZipNote and ZipSplit
  2.  
  3. # Supported Make utilities:
  4. # - Microsoft/IBM nmake
  5. # - dmake 3.8 (parallel make, use -P4 if you have the memory),
  6. #   in the exe file targets, you will have to add spaces before $@ for gcc
  7. # - NOT watcom make (brain dead, apparently doesn't know lines cont'd with \)
  8. # - NOT GNU make (buggy, incompatible)
  9.  
  10. # Supported C Compilers:
  11. # - Microsoft C 6.00 under OS/2 1.x (16-bit)
  12. # - GNU gcc (emx kit) under OS/2 2.0
  13. # - IBM C Set/2 under OS/2 2.0        - does not yet work with ASM code
  14. # - Watcom C/386 9.0 under OS/2 2.0   - does not yet work with ASM code
  15.  
  16. # Supported Assemblers:
  17. # - Microsoft MASM 6.00 with MS C, IBM C, Watcom C
  18. # - Microsoft MASM 5.xx with MS C, if uncomment "masm" line near line 150
  19. # - GNU as with GNU gcc
  20.  
  21. # To use, enter "nmake/dmake -f makefile.os2" (this makefile depends on its
  22. # name being "makefile.os2").
  23.  
  24. # Add -DNO_ASM to CFLAGS and remove match.obj from OBJO if you do
  25. # not have masm or ml.
  26. # Add -DDYN_ALLOC to ASFLAGS if you have defined it in tailor.h or CFLAGS
  27.  
  28. # Notes on 16-bit (Microsoft C 6.00) compilation:
  29.  
  30. #   The resulting programs can be used under OS/2 protected mode only.
  31. #   A larger stack has to be used for OS/2 because system calls
  32. #   use more stack than under DOS, 8k is recommended by Microsoft.
  33. #   Note that __STDC__ has to be defined explicitly with C 6.00 when -Ze
  34. #   is given, because Microsoft disables __STDC__ when their extensions
  35. #   are enabled. This is different from the C 5.10 behaviour.
  36.  
  37. # Notes on 32-bit (IBM C Set/2, Watcom C or GNU gcc) compilation:
  38.  
  39. #   The resulting programs can be used under OS/2 protected
  40. #   mode of OS/2 2.0 only, not under 1.x and not under DOS.
  41. #   It makes no difference if __STDC__ is defined or not.
  42. #   Watcom C and IBM C Set/2 work with DYN_ALLOC only, because of
  43. #   Compiler bugs.
  44.  
  45. CRYPTO=
  46. CLOAK=
  47. CRFLAG=
  48. #  *** For encryption version, remove the # at the front of next 3 lines ***
  49. #CRYPTO=crypt$(OBJ)
  50. #CLOAK=zipcloak.exe
  51. #CRFLAG=-DCRYPT
  52.  
  53. default:
  54.     @echo Enter "$(MAKE) -f makefile.os2 msc"
  55.     @echo    or "$(MAKE) -f makefile.os2 ibm"
  56.     @echo    or "$(MAKE) -f makefile.os2 watcom"
  57.     @echo    or "$(MAKE) -f makefile.os2 gcc"
  58.  
  59. mscdos:
  60.     $(MAKE) -f makefile.os2 zips \
  61.     CC="cl -nologo -AC -Oaict -Gs" \
  62.     CFLAGS="-W3 -Zep $(CRFLAG) $(FP)" \
  63.     AS="ml -nologo" \
  64.     ASFLAGS="-Zm -Cp" \
  65.     LDFLAGS="$(FP) -Lr -F 1000 -Fe" \
  66.         LDFLAGS2="-link /noe" \
  67.         OUT="-Fo" \
  68.         OBJ=".obj" \
  69.     OBJA=match.obj \
  70.         OBJO=""
  71.  
  72. msc:
  73.     $(MAKE) -f makefile.os2 zips \
  74.     CC="cl -nologo -AC -Ocegit -Gs" \
  75.     CFLAGS="-W1 -Zep -J -G2 $(CRFLAG) -D__STDC__ -DOS2 $(FP)" \
  76.     AS="ml -nologo" \
  77.     ASFLAGS="-Zm -Cp" \
  78.     LDFLAGS="$(FP) -Lp -F 2000 -Fe" \
  79.         LDFLAGS2="-link /noe" \
  80.         OUT="-Fo" \
  81.         OBJ=".obj" \
  82.     OBJA=match.obj \
  83.         DEF="zip.def"
  84.  
  85. ibm:
  86.     $(MAKE) -f makefile.os2 zips \
  87.     CC="icc -Q -O -Gs" \
  88.     CFLAGS="-Sm -Sp1 $(CRFLAG) -DOS2 -DDYN_ALLOC -DNO_ASM" \
  89.     NFLAGS="-O-" \
  90.     AS="ml -nologo" \
  91.     ASFLAGS="-Zm -Cp" \
  92.     LDFLAGS="-B/ST:131072 -Fe" \
  93.         LDFLAGS2="" \
  94.         OUT="-Fo" \
  95.         OBJ=".obj" \
  96.     OBJA="" \
  97.         DEF="zip.def"
  98.  
  99. watcom:
  100.     $(MAKE) -f makefile.os2 zips \
  101.     CC="wcl386 -zq -Ox -s" \
  102.     CFLAGS="-Zp1 $(CRFLAG) -DOS2 -DDYN_ALLOC -DNO_ASM" \
  103.     AS="ml -nologo" \
  104.     ASFLAGS="-Zm -Cp" \
  105.     LDFLAGS="-k131072 -x -Fe=" \
  106.         LDFLAGS2="" \
  107.         OUT="-Fo" \
  108.         OBJ=".obj" \
  109.     OBJA=""
  110.  
  111. gcc:
  112.     $(MAKE) -f makefile.os2 zips \
  113.     CC="gcc -O -s" \
  114.     CFLAGS="$(CRFLAG) -DOS2" \
  115.     AS="gcc" \
  116.     ASFLAGS="-Uunix" \
  117.     LDFLAGS="-o " \
  118.         LDFLAGS2="-los2" \
  119.         OUT="-o" \
  120.         OBJ=".o" \
  121.     OBJA="match.o"
  122.  
  123. OBJO =  os2zip
  124.  
  125. OBJZ =  zip$(OBJ) zipfile$(OBJ) zipup$(OBJ) fileio$(OBJ) util$(OBJ) \
  126.         globals$(OBJ) deflate$(OBJ) trees$(OBJ) bits$(OBJ) $(CRYPTO) \
  127.     $(OBJO)$(OBJ)
  128.  
  129. OBJU =  zipfile_$(OBJ) zipup_$(OBJ) fileio_$(OBJ) util_$(OBJ) \
  130.     globals$(OBJ) $(OBJO)_$(OBJ)
  131.  
  132. OBJN =  zipnote$(OBJ) $(OBJU)
  133. OBJC =  zipcloak$(OBJ) crypt_$(OBJ) $(OBJU)
  134. OBJS =  zipsplit$(OBJ) $(OBJU)
  135.  
  136. .c$(OBJ):
  137.     $(CC) -c $(CFLAGS) $<
  138.  
  139. zips:    zip.exe zipnote.exe zipsplit.exe $(CLOAK)
  140.  
  141. zip$(OBJ):    zip.c zip.h ziperr.h tailor.h revision.h
  142. zipfile$(OBJ):    zipfile.c zip.h ziperr.h tailor.h
  143. zipup$(OBJ):    zipup.c zip.h ziperr.h tailor.h revision.h os2zip.h
  144. fileio$(OBJ):    fileio.c zip.h ziperr.h tailor.h os2zip.h
  145. util$(OBJ):    util.c zip.h ziperr.h tailor.h os2zip.h
  146. globals$(OBJ):    globals.c zip.h ziperr.h tailor.h
  147. deflate$(OBJ):    deflate.c zip.h ziperr.h tailor.h
  148. trees$(OBJ):    trees.c zip.h ziperr.h tailor.h
  149.     $(CC) -c $(CFLAGS) $(NFLAGS) $*.c
  150. bits$(OBJ):    bits.c zip.h ziperr.h tailor.h
  151. crypt$(OBJ):    crypt.c zip.h ziperr.h tailor.h
  152. os2zip$(OBJ):    os2zip.c os2zip.h
  153.  
  154. match.obj:    match.asm
  155.     $(AS) -c $(ASFLAGS) $*.asm
  156. # use the following for MASM 5.00 instead of 6.00
  157. #    masm -ml -t $*.asm;
  158.  
  159. match32.obj:    match32.asm
  160.     $(AS) -c $(ASFLAGS) $*.asm
  161.  
  162. match.o:    match.s
  163. # note the uppercase S for gcc to run match.s through cpp!
  164.     $(AS) -c $(ASFLAGS) $*.S
  165.  
  166. zipcloak$(OBJ):    zipcloak.c zip.h ziperr.h tailor.h revision.h
  167. zipnote$(OBJ):    zipnote.c zip.h ziperr.h tailor.h revision.h
  168. zipsplit$(OBJ): zipsplit.c zip.h ziperr.h tailor.h revision.h
  169.  
  170. zipfile_$(OBJ):    zipfile.c zip.h ziperr.h tailor.h
  171.     $(CC) -c $(CFLAGS) -DUTIL $(OUT)$@ zipfile.c
  172.  
  173. zipup_$(OBJ):    zipup.c zip.h ziperr.h tailor.h
  174.     $(CC) -c $(CFLAGS) -DUTIL $(OUT)$@ zipup.c
  175.  
  176. fileio_$(OBJ):    fileio.c zip.h ziperr.h tailor.h
  177.     $(CC) -c $(CFLAGS) -DUTIL $(OUT)$@ fileio.c
  178.  
  179. util_$(OBJ):    util.c zip.h ziperr.h tailor.h os2zip.h
  180.     $(CC) -c $(CFLAGS) -DUTIL $(OUT)$@ util.c
  181.  
  182. crypt_$(OBJ):    crypt.c zip.h ziperr.h tailor.h
  183.     $(CC) -c $(CFLAGS) -DUTIL $(OUT)$@ crypt.c
  184.  
  185. os2zip_$(OBJ): os2zip.c os2zip.h
  186.     $(CC) -c $(CFLAGS) -DUTIL $(OUT)$@ os2zip.c
  187.  
  188. zip.exe: $(OBJZ) $(OBJI) $(OBJA) $(DEF)
  189.     $(CC) $(LDFLAGS)$@ $(DEF) $(OBJZ) $(OBJI) $(OBJA) $(LDFLAGS2)
  190.  
  191. zipcloak.exe: $(OBJC) $(DEF)
  192.     $(CC) $(LDFLAGS)$@ $(DEF) $(OBJC) $(LDFLAGS2)
  193.  
  194. zipnote.exe: $(OBJN) $(DEF)
  195.     $(CC) $(LDFLAGS)$@ $(DEF) $(OBJN) $(LDFLAGS2)
  196.  
  197. zipsplit.exe: $(OBJS) $(DEF)
  198.     $(CC) $(LDFLAGS)$@ $(DEF) $(OBJS) $(LDFLAGS2)
  199.