home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip540.zip / win32 / Makefile.emx < prev    next >
Makefile  |  1998-11-24  |  7KB  |  221 lines

  1. # Makefile for UnZip, fUnZip and UnZipSFX
  2. # for emx 0.9c + rsxnt 1.4 / gcc under WIN32. Derived from makefile.os2
  3. # By E-Yen Tan and Christian Spieler. Last updated 24 November 1998.
  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. DLLFLAG=
  24. AS=gcc
  25. ASFLAGS=-Di386
  26. LDFLAGS=-Zsys -o ./
  27. LDFLAGS2=-ladvapi32 -Zsmall-conv -s
  28. OUT=-o
  29. OBJ=.o
  30.  
  31. #ifdef NOASM
  32. #CRC32=crc32
  33. #CRC32F=crc32f
  34. #CRC32X=crc32_
  35. #else
  36. CRC32=crc_gcc
  37. CRC32F=crc_gcc
  38. CRC32X=crc_gcc
  39. #endif
  40. OBJUS=win32$(OBJ) nt$(OBJ)
  41. OBJXS=win32_$(OBJ) nt_$(OBJ)
  42. OBJFS=win32f$(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) $(OBJFS)
  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. win32f$(OBJ):    win32/win32.c $(UNZIP_H) win32/nt.h        # win32 funzip
  136.     $(CC) -c $(CFLAGS) -DFUNZIP $(OUT)$@ win32$(DIRSEP)win32.c
  137.  
  138. win32_$(OBJ):    win32/win32.c $(UNZIP_H) win32/nt.h        # win32 unzipsfx
  139.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ win32$(DIRSEP)win32.c
  140.  
  141. nt$(OBJ):    win32/nt.c $(UNZIP_H) win32/nt.h        # win32 only
  142.     $(CC) -c $(CFLAGS) $(OUT)$@ win32$(DIRSEP)nt.c
  143.  
  144. nt_$(OBJ):    win32/nt.c $(UNZIP_H) win32/nt.h        # win32 only
  145.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ win32$(DIRSEP)nt.c
  146.  
  147. os2$(OBJ):    os2/os2.c $(UNZIP_H) version.h            # OS/2 only
  148.     $(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ os2$(DIRSEP)os2.c
  149.  
  150. os2_$(OBJ):    os2/os2.c $(UNZIP_H)                # OS/2 unzipsfx
  151.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ os2$(DIRSEP)os2.c
  152.  
  153. os2acl$(OBJ):    os2/os2acl.c $(UNZIP_H) version.h        # OS/2 only
  154.     $(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ os2$(DIRSEP)os2acl.c
  155.  
  156. rexxhelp$(OBJ):    os2/rexxhelp.c                    # OS/2 DLL only
  157.     $(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ os2$(DIRSEP)rexxhelp.c
  158.  
  159. rexxapi$(OBJ):    os2/rexxapi.c                    # OS/2 DLL only
  160.     $(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ os2$(DIRSEP)rexxapi.c
  161.  
  162. crc_i86$(OBJ):    msdos/crc_i86.asm                # 16bit only
  163.     $(AS) $(ASFLAGS) msdos$(AS_DIRSEP)crc_i86.asm $(ASEOL)
  164.  
  165. crc_i386$(OBJ):    win32/crc_i386.asm                # 32bit, MASM
  166.     $(AS) $(ASFLAGS) win32$(AS_DIRSEP)crc_i386.asm $(ASEOL)
  167.  
  168. crc_gcc$(OBJ):    crc_i386.S                    # 32bit, GNU AS
  169.     $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o $@ crc_i386.S
  170.  
  171. crypt$(OBJ):    crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h
  172.     $(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ crypt.c
  173.  
  174. cryptf$(OBJ):    crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h    # funzip only
  175.     $(CC) -c $(CFLAGS) -DFUNZIP $(OUT)$@ crypt.c
  176.  
  177. crc32f$(OBJ):    crc32.c $(UNZIP_H) zip.h            # funzip only
  178.     $(CC) -c $(CFLAGS) -DFUNZIP $(OUT)$@ crc32.c
  179.  
  180. globalsf$(OBJ):    globals.c $(UNZIP_H)                # funzip only
  181.     $(CC) -c $(CFLAGS) -DFUNZIP $(OUT)$@ globals.c
  182.  
  183. inflatef$(OBJ):    inflate.c inflate.h $(UNZIP_H) crypt.h        # funzip only
  184.     $(CC) -c $(CFLAGS) -DFUNZIP $(OUT)$@ inflate.c
  185.  
  186. ttyiof$(OBJ):    ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h    # funzip only
  187.     $(CC) -c $(CFLAGS) -DFUNZIP $(OUT)$@ ttyio.c
  188.  
  189. crc32_$(OBJ):    crc32.c $(UNZIP_H) zip.h            # unzipsfx only
  190.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ crc32.c
  191.  
  192. crctab_$(OBJ):    crctab.c $(UNZIP_H) zip.h            # unzipsfx only
  193.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ crctab.c
  194.  
  195. crypt_$(OBJ):    crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h    # unzipsfx only
  196.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ crypt.c
  197.  
  198. extract_$(OBJ):    extract.c $(UNZIP_H) crypt.h            # unzipsfx only
  199.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ extract.c
  200.  
  201. fileio_$(OBJ):    fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h    # unzipsfx only
  202.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ fileio.c
  203.  
  204. globals_$(OBJ):    globals.c $(UNZIP_H)                # unzipsfx only
  205.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ globals.c
  206.  
  207. inflate_$(OBJ):    inflate.c inflate.h $(UNZIP_H) crypt.h        # unzipsfx only
  208.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ inflate.c
  209.  
  210. match_$(OBJ):    match.c $(UNZIP_H)                # unzipsfx only
  211.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ match.c
  212.  
  213. process_$(OBJ):    process.c $(UNZIP_H)                # unzipsfx only
  214.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ process.c
  215.  
  216. ttyio_$(OBJ):    ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h    # unzipsfx only
  217.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ ttyio.c
  218.  
  219. unzipsf_$(OBJ):    unzip.c $(UNZIP_H) crypt.h version.h consts.h    # unzipsfx only
  220.     $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ unzip.c
  221.