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

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