home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip532.zip / win32 / Makefile.emx < prev    next >
Makefile  |  1997-10-05  |  7KB  |  219 lines

  1. # Makefile for UnZip, fUnZip and UnZipSFX
  2. # for emx 0.9c + rsxnt 1.3 / gcc under WIN32. Derived from makefile.os2
  3. # By E-Yen Tan. Last updated 23 September 1997 (Christian Spieler).
  4. #
  5. # This makefile should work fine with GNU make and hopefully some others.
  6. # Tested with Spieler's special GNU make 3.74 gnuish 16-bit version.
  7. #
  8. # If make does not support long command-line passing to gcc, the link step
  9. # will fail. In this case, you have to edit the link commands to use the
  10. # commented-out alternative that creates a link response file "by hand".
  11.  
  12. #ifdef NOASM
  13. #AS_FLAGS =
  14. #else
  15. AS_FLAGS = -DASM_CRC
  16. #endif
  17.  
  18. CP=copy
  19. RM=del
  20.  
  21. CC=gcc -O2 -I. -m486 -Zwin32
  22. CFLAGS=-Wall -DWIN32 $(AS_FLAGS) $(LOCAL_UNZIP)
  23. NFLAGS=
  24. DLLFLAG=
  25. AS=gcc
  26. ASFLAGS=-Di386
  27. LDFLAGS=-o ./
  28. LDFLAGS2=-Zsmall-conv -s
  29. OUT=-o
  30. OBJ=.o
  31.  
  32. #ifdef NOASM
  33. #CRC32=crc32
  34. #CRC32F=crc32f
  35. #CRC32X=crc32_
  36. #else
  37. CRC32=crc_gcc
  38. CRC32F=crc_gcc
  39. CRC32X=crc_gcc
  40. #endif
  41. OBJUS=win32$(OBJ) nt$(OBJ)
  42. OBJXS=win32_$(OBJ) nt_$(OBJ)
  43. OSDEP_H=win32/w32cfg.h
  44.  
  45.  
  46. # default settings for target dependent macros:
  47. DIRSEP = /
  48. AS_DIRSEP = /
  49.  
  50. OBJU1 = unzip$(OBJ) $(CRC32)$(OBJ) crctab$(OBJ) crypt$(OBJ) envargs$(OBJ)
  51. OBJU2 = explode$(OBJ) extract$(OBJ) fileio$(OBJ) globals$(OBJ)
  52. OBJU3 = inflate$(OBJ) list$(OBJ) match$(OBJ) process$(OBJ) ttyio$(OBJ)
  53. OBJU4 = unreduce$(OBJ) unshrink$(OBJ) zipinfo$(OBJ)
  54. OBJU  = $(OBJU1) $(OBJU2) $(OBJU3) $(OBJU4) $(OBJUS)
  55. OBJX1 = unzipsf_$(OBJ) $(CRC32X)$(OBJ) crctab_$(OBJ) crypt_$(OBJ)
  56. OBJX2 = extract_$(OBJ) fileio_$(OBJ) globals_$(OBJ) inflate_$(OBJ)
  57. OBJX3 = match_$(OBJ) process_$(OBJ) ttyio_$(OBJ)
  58. OBJX  = $(OBJX1) $(OBJX2) $(OBJX3) $(OBJXS)
  59. OBJF  = funzip$(OBJ) $(CRC32F)$(OBJ) cryptf$(OBJ) inflatef$(OBJ) \
  60.     globalsf$(OBJ) ttyiof$(OBJ)
  61.  
  62. UNZIP_H = unzip.h unzpriv.h globals.h $(OSDEP_H)
  63.  
  64. # rules
  65.  
  66. .SUFFIXES:    .c $(OBJ)
  67.  
  68. .c$(OBJ):
  69.     $(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ $<
  70.  
  71. # targets
  72.  
  73. all:    unzip.exe funzip.exe unzipsfx.exe
  74.  
  75. # This next bit is nasty, but is needed to overcome the MS-DOS command
  76. # line limit as response files for emx's gcc seem to only work if each
  77. # file is on a different line. DJGPP doesn't do this (if you are at all
  78. # interested).
  79.  
  80. unzip.exe: $(OBJU)
  81. #    @ echo off
  82. #    -@ $(RM) unzip.rsp
  83. #    @ for %f in ($(OBJU1)) do echo %f >> unzip.rsp
  84. #    @ for %f in ($(OBJU2)) do echo %f >> unzip.rsp
  85. #    @ for %f in ($(OBJU3)) do echo %f >> unzip.rsp
  86. #    @ for %f in ($(OBJU4) $(OBJUS)) do echo %f >> unzip.rsp
  87. #    $(CC) $(LDFLAGS)$@ $(DEF) @unzip.rsp $(LDFLAGS2)
  88.     $(CC) $(LDFLAGS)$@ $(DEF) $(OBJU) $(LDFLAGS2)
  89. #    @ $(RM) unzip.rsp
  90.  
  91. funzip.exe: $(OBJF)
  92.     $(CC) $(LDFLAGS)$@ $(DEF) $(OBJF) $(LDFLAGS2)
  93.  
  94. unzipsfx.exe:    $(OBJX)
  95. #    @ echo off
  96. #    -@ $(RM) unzipsfx.rsp
  97. #    @ for %f in ($(OBJX1)) do echo %f >> unzipsfx.rsp
  98. #    @ for %f in ($(OBJX2)) do echo %f >> unzipsfx.rsp
  99. #    @ for %f in ($(OBJX3)) do echo %f >> unzipsfx.rsp
  100. #    @ for %f in ($(OBJXS)) do echo %f >> unzipsfx.rsp
  101. #    $(CC) $(LDFLAGS)$@ $(DEF) @unzipsfx.rsp $(LDFLAGS2)
  102.     $(CC) $(LDFLAGS)$@ $(DEF) $(OBJX) $(LDFLAGS2)
  103. #    @ $(RM) unzipsfx.rsp
  104.  
  105. # dependencies
  106.  
  107. apihelp$(OBJ):    apihelp.c $(UNZIP_H) version.h
  108. crc32$(OBJ):    crc32.c $(UNZIP_H) zip.h
  109. crctab$(OBJ):    crctab.c $(UNZIP_H) zip.h
  110. envargs$(OBJ):    envargs.c $(UNZIP_H)
  111. explode$(OBJ):    explode.c $(UNZIP_H)
  112. extract$(OBJ):    extract.c $(UNZIP_H) crypt.h
  113. fileio$(OBJ):    fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h
  114. globals$(OBJ):    globals.c $(UNZIP_H)
  115. inflate$(OBJ):    inflate.c $(UNZIP_H)
  116. list$(OBJ):    list.c $(UNZIP_H)
  117. match$(OBJ):    match.c $(UNZIP_H)
  118. process$(OBJ):    process.c $(UNZIP_H)
  119. ttyio$(OBJ):    ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
  120. unreduce$(OBJ):    unreduce.c $(UNZIP_H)
  121. unshrink$(OBJ):    unshrink.c $(UNZIP_H)
  122. unzip$(OBJ):    unzip.c $(UNZIP_H) crypt.h version.h consts.h
  123. api$(OBJ):    api.c $(UNZIP_H) version.h
  124. zipinfo$(OBJ):    zipinfo.c $(UNZIP_H)
  125.  
  126. funzip$(OBJ):    funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h    # funzip only
  127.     $(CC) -c $(CFLAGS) $(OUT)$@ funzip.c
  128.  
  129. unzipstb$(OBJ):    unzipstb.c                    # DLL version
  130.     $(CC) -c $(CFLAGS) $(OUT)$@ unzipstb.c
  131.  
  132. win32$(OBJ):    win32/win32.c $(UNZIP_H) win32/nt.h version.h    # win32 only
  133.     $(CC) -c $(CFLAGS) $(OUT)$@ win32$(DIRSEP)win32.c
  134.  
  135. win32_$(OBJ):    win32/win32.c $(UNZIP_H) win32/nt.h        # win32 unzipsfx
  136.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ win32$(DIRSEP)win32.c
  137.  
  138. nt$(OBJ):    win32/nt.c $(UNZIP_H) win32/nt.h        # win32 only
  139.     $(CC) -c $(CFLAGS) $(OUT)$@ win32$(DIRSEP)nt.c
  140.  
  141. nt_$(OBJ):    win32/nt.c $(UNZIP_H) win32/nt.h        # win32 only
  142.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ win32$(DIRSEP)nt.c
  143.  
  144. os2$(OBJ):    os2/os2.c $(UNZIP_H) version.h            # OS/2 only
  145.     $(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ os2$(DIRSEP)os2.c
  146.  
  147. os2_$(OBJ):    os2/os2.c $(UNZIP_H)                # OS/2 unzipsfx
  148.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ os2$(DIRSEP)os2.c
  149.  
  150. os2acl$(OBJ):    os2/os2acl.c $(UNZIP_H) version.h        # OS/2 only
  151.     $(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ os2$(DIRSEP)os2acl.c
  152.  
  153. rexxhelp$(OBJ):    os2/rexxhelp.c                    # OS/2 DLL only
  154.     $(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ os2$(DIRSEP)rexxhelp.c
  155.  
  156. rexxapi$(OBJ):    os2/rexxapi.c                    # OS/2 DLL only
  157.     $(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ os2$(DIRSEP)rexxapi.c
  158.  
  159. crc_i86$(OBJ):    msdos/crc_i86.asm                # 16bit only
  160.     $(AS) $(ASFLAGS) msdos$(AS_DIRSEP)crc_i86.asm $(ASEOL)
  161.  
  162. crc_i386$(OBJ):    win32/crc_i386.asm                # 32bit, MASM
  163.     $(AS) $(ASFLAGS) win32$(AS_DIRSEP)crc_i386.asm $(ASEOL)
  164.  
  165. crc_gcc$(OBJ):    crc_i386.S                    # 32bit, GNU AS
  166.     $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o $@ crc_i386.S
  167.  
  168. # NFLAGS are solely used as work-around for optimization bug in IBM C++ Set
  169. crypt$(OBJ):    crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h
  170.     $(CC) -c $(CFLAGS) $(DLLFLAG) $(NFLAGS) $(OUT)$@ crypt.c
  171.  
  172. cryptf$(OBJ):    crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h    # funzip only
  173.     $(CC) -c $(CFLAGS) $(NFLAGS) -DFUNZIP $(OUT)$@ crypt.c
  174.  
  175. crc32f$(OBJ):    crc32.c $(UNZIP_H) zip.h            # funzip only
  176.     $(CC) -c $(CFLAGS) -DFUNZIP $(OUT)$@ crc32.c
  177.  
  178. globalsf$(OBJ):    globals.c $(UNZIP_H)                # funzip only
  179.     $(CC) -c $(CFLAGS) -DFUNZIP $(OUT)$@ globals.c
  180.  
  181. inflatef$(OBJ):    inflate.c inflate.h $(UNZIP_H) crypt.h        # funzip only
  182.     $(CC) -c $(CFLAGS) -DFUNZIP $(OUT)$@ inflate.c
  183.  
  184. ttyiof$(OBJ):    ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h    # funzip only
  185.     $(CC) -c $(CFLAGS) $(NFLAGS) -DFUNZIP $(OUT)$@ ttyio.c
  186.  
  187. crc32_$(OBJ):    crc32.c $(UNZIP_H) zip.h            # unzipsfx only
  188.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ crc32.c
  189.  
  190. crctab_$(OBJ):    crctab.c $(UNZIP_H) zip.h            # unzipsfx only
  191.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ crctab.c
  192.  
  193. crypt_$(OBJ):    crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h    # unzipsfx only
  194.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ crypt.c
  195.  
  196. extract_$(OBJ):    extract.c $(UNZIP_H) crypt.h            # unzipsfx only
  197.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ extract.c
  198.  
  199. fileio_$(OBJ):    fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h    # unzipsfx only
  200.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ fileio.c
  201.  
  202. globals_$(OBJ):    globals.c $(UNZIP_H)                # unzipsfx only
  203.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ globals.c
  204.  
  205. inflate_$(OBJ):    inflate.c inflate.h $(UNZIP_H) crypt.h        # unzipsfx only
  206.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ inflate.c
  207.  
  208. match_$(OBJ):    match.c $(UNZIP_H)                # unzipsfx only
  209.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ match.c
  210.  
  211. process_$(OBJ):    process.c $(UNZIP_H)                # unzipsfx only
  212.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ process.c
  213.  
  214. ttyio_$(OBJ):    ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h    # unzipsfx only
  215.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ ttyio.c
  216.  
  217. unzipsf_$(OBJ):    unzip.c $(UNZIP_H) crypt.h version.h consts.h    # unzipsfx only
  218.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ unzip.c
  219.