home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip51.zip / msdos / makefile.gcc < prev    next >
Makefile  |  1994-02-08  |  3KB  |  144 lines

  1. #==============================================================================
  2. # Makefile for UnZip, ZipInfo & fUnZip:  for DJGPP 1.11 and GNU make
  3. # Version:  5.1                                                 8 February 1994
  4. #==============================================================================
  5.  
  6. # If you use an old version of djgpp (1.10 or earlier), you must set
  7. # OBJFORMAT=aout.  If anyone can get the .SUFFIXES rule in unix/Makefile
  8. # to work, please send mail to zip-bugs!  (If it's later than February,
  9. # 1994, however, assume that someone else has already done so.)  This
  10. # makefile has explicit rules for every file because the implicit one
  11. # is ignored by GNU make.
  12.  
  13. # Defaults most systems use (use LOCAL_UNZIP in environment to add flags, 
  14. # such as -DDOSWILD).
  15.  
  16. MAKE=make
  17.  
  18. # UnZip flags
  19. CC = gcc
  20. LD = $(CC)
  21. LOC = $(LOCAL_UNZIP)
  22. CF = -O2 -Wall -I. $(LOC)
  23. LF = -o unzip
  24. LF2 = 
  25.  
  26. # fUnZip flags
  27. FC = -DFUNZIP
  28. FL = -o funzip
  29. FL2 = $(LF2)
  30.  
  31. # general-purpose stuff
  32. CP = copy
  33. RM = del
  34. E =
  35. O = .o
  36. M = msdos
  37.  
  38. # object files
  39. OBJS1 = unzip$O crypt$O envargs$O explode$O extract$O file_io$O
  40. OBJS2 = inflate$O match$O unreduce$O unshrink$O zipinfo$O
  41. OBJS = $(OBJS1) $(OBJS2) $M$O
  42. LOBJS = $(OBJS)
  43. OBJF = funzip$O crypt_$O inflate_$O
  44.  
  45.  
  46. # this is for GNU make; comment out and notify zip-bugs if it causes errors
  47. # (doesn't seem to work with djgpp's version anyway...)
  48. .SUFFIXES:
  49. .SUFFIXES:    .o .c
  50.  
  51. .c.o:
  52.     $(CC) -c $(CF) $*.c
  53.  
  54. all:        gcc_dos
  55. unzips:        $(UNZIPS)
  56.  
  57. clean:
  58.     $(RM) $(OBJS) $(OBJF) unzip$E funzip$E zipinfo$E
  59.  
  60. unzip$E:    $(OBJS)            # add `&' for parallel makes
  61.     $(LD) $(LF) $(LOBJS) $(LF2)
  62.  
  63. funzip$E:    $(OBJF)            # add `&' for parallel makes
  64.     $(LD) $(FL) $(OBJF) $(FL2)
  65.  
  66. zipinfo$E:    unzip$E
  67.     @echo\
  68.  '  This is a Unix-specific target.  ZipInfo is not enabled in some MS-DOS'
  69.     @echo\
  70.  '  versions of UnZip; if it is in yours, copy unzip.exe to zipinfo.exe'
  71.     @echo\
  72.  '  or else invoke as "unzip -Z" (in a batch file, for example).'
  73.     $(LN) unzip$E zipinfo$E
  74.  
  75.  
  76. crypt$O:    crypt.c unzip.h zip.h crypt.h
  77.     $(CC) -c $(CF) $*.c
  78.  
  79. envargs$O:    envargs.c unzip.h
  80.     $(CC) -c $(CF) $*.c
  81.  
  82. explode$O:    explode.c unzip.h
  83.     $(CC) -c $(CF) $*.c
  84.  
  85. extract$O:    extract.c unzip.h crypt.h
  86.     $(CC) -c $(CF) $*.c
  87.  
  88. file_io$O:    file_io.c unzip.h crypt.h tables.h
  89.     $(CC) -c $(CF) $*.c
  90.  
  91. funzip$O:    funzip.c unzip.h crypt.h tables.h
  92.     $(CC) -c $(CF) $*.c
  93.  
  94. inflate$O:    inflate.c inflate.h unzip.h
  95.     $(CC) -c $(CF) $*.c
  96.  
  97. match$O:    match.c unzip.h
  98.     $(CC) -c $(CF) $*.c
  99.  
  100. unreduce$O:    unreduce.c unzip.h
  101.     $(CC) -c $(CF) $*.c
  102.  
  103. unshrink$O:    unshrink.c unzip.h
  104.     $(CC) -c $(CF) $*.c
  105.  
  106. unzip$O:    unzip.c unzip.h
  107.     $(CC) -c $(CF) $*.c
  108.  
  109. zipinfo$O:    zipinfo.c unzip.h
  110.     $(CC) -c $(CF) $*.c
  111.  
  112. crypt_$O:    crypt.c unzip.h zip.h crypt.h        # funzip only
  113.     $(CP) crypt.c crypt_.c
  114.     $(CC) -c $(CF) $(FC) crypt_.c
  115.     $(RM) crypt_.c
  116.  
  117. inflate_$O:    inflate.c inflate.h unzip.h crypt.h    # funzip only
  118.     $(CP) inflate.c inflate_.c
  119.     $(CC) -c $(CF) $(FC) inflate_.c
  120.     $(RM) inflate_.c
  121.  
  122. msdos$O:    msdos/msdos.c unzip.h            # MS-DOS only
  123.     $(CC) -c $(CF) msdos/msdos.c
  124.  
  125.  
  126.  
  127. # MS-DOS with D.J. Delorie's djgcc 1.11.  Note that go32 doesn't support
  128. # DOS function 0x38, so the default date format is used with the -v option.
  129. #
  130. gcc_dos: _gcc_dos fu_gcc
  131.  
  132. _gcc_dos: gcc_rsp unzip
  133.     coff2exe unzip
  134.     del gcc_rsp
  135.     del unzip
  136.  
  137. gcc_rsp:
  138.     echo $(OBJS1) > gcc_rsp
  139.     echo msdos.o $(OBJS2) >> gcc_rsp
  140.  
  141. fu_gcc: funzip
  142.     coff2exe funzip
  143.     del funzip
  144.