Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. #==============================================================================
  2. # Makefile for UnZip, UnZipSFX and fUnZip:  Unix and MS-DOS ("real" makes only)
  3. # Version:  5.53                                               25 December 2006
  4. #==============================================================================
  5.  
  6.  
  7. # INSTRUCTIONS (such as they are):
  8. #
  9. # "make vax"    -- makes UnZip on a generic Unix VAX in the current directory
  10. # "make list"   -- lists all supported systems (targets)
  11. # "make help"   -- provides pointers on what targets to try if problems occur
  12. # "make wombat" -- chokes and dies if you haven't added the specifics for your
  13. #                   Wombat 68000 (or whatever) to the systems list
  14. #
  15. # CF are flags for the C compiler.  LF are flags for the loader.  LF2 are more
  16. # flags for the loader, if they need to be at the end of the line instead of at
  17. # the beginning (for example, some libraries).  FL and FL2 are the corre-
  18. # sponding flags for fUnZip.  LOCAL_UNZIP is an environment variable that can
  19. # be used to add default C flags to your compile without editing the Makefile
  20. # (e.g., -DDEBUG_STRUC, or -FPi87 on PCs using Microsoft C).
  21. #
  22. # Some versions of make do not define the macro "$(MAKE)"; this is rare, but
  23. # if things don't work, try using "make" instead of "$(MAKE)" in your system's
  24. # makerule.  Or try adding the following line to your .login file:
  25. #       setenv MAKE "make"
  26. # (That never works--makes which are too stupid to define MAKE are also too
  27. # stupid to look in the environment--but try it anyway for kicks. :-) )
  28. #
  29. # Memcpy and memset are provided for those systems that don't have them; they
  30. # are in file_io.c and will be used if -DZMEM is included in CF.  These days
  31. # almost all systems have them.
  32. #
  33. # Be sure to test your new UnZip (and UnZipSFX and fUnZip); successful compila-
  34. # tion does not always imply a working program.
  35.  
  36.  
  37. #####################
  38. # MACRO DEFINITIONS #
  39. #####################
  40.  
  41. # Defaults most systems use (use LOCAL_UNZIP in environment to add flags,
  42. # such as -DDOSWILD).
  43.  
  44. # UnZip flags
  45. CC = cl
  46. LD = cl
  47. LOC = $(LOCAL_UNZIP)
  48. CF = -c -Zi -W2 -DCRYPT -DOLD_THEOS_EXTRA $(LOCAL_UNZIP)
  49. LF = -Zi -o
  50. LF2 = -m
  51.  
  52. # defaults for crc32 stuff and system dependent headers
  53. CRCA_O =
  54. OSDEP_H =
  55.  
  56. # general-purpose stuff
  57. CP = copyfile
  58. LN = copyfile
  59. RM = erase
  60.  
  61. .c.o:
  62.         $(CC) $(CF) $*.c
  63.  
  64. # object files
  65. OBJS1 = unzip.o crc32.o $(CRCA_O) crypt.o envargs.o explode.o
  66. OBJS2 = extract.o fileio.o globals.o inflate.o list.o match.o
  67. OBJS3 = process.o ttyio.o ubz2err.o unreduce.o unshrink.o zipinfo.o
  68. OBJS4 = _sprintf.o _fprintf.o _isatty.o _stat.o _setargv.o
  69. OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) theos.o
  70. #LOBJS = $(OBJS)
  71. LOBJS = $(OBJS1) $(OBJS2) $(OBJS3) theos.o
  72. OBJX = unzipsfx.o crc32_.o $(CRCA_O) crypt_.o extract_.o fileio_.o \
  73.         globals_.o inflate_.o match_.o process_.o ttyio_.o obz2err_.o theos_.o
  74. LOBJX = $(OBJX)
  75. OBJF = funzip.o crc32f.o $(CRCA_O) cryptf.o globalsf.o inflatef.o ttyiof.o \
  76.         _sprintf.o _fprintf.o _isatty.o
  77. UNZIP_H = unzip.h unzpriv.h globals.h $(OSDEP_H)
  78. EBCDIC_H = ebcdic.h theos/charconv.h
  79.  
  80. UNZIPS = unzip.command funzip.command unzipsfx.command zipinfo.command
  81.  
  82. unzips: $(UNZIPS)
  83.  
  84.  
  85. crc32.o:        crc32.c $(UNZIP_H) zip.h crc32.h
  86. crypt.o:        crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
  87. envargs.o:      envargs.c $(UNZIP_H)
  88. explode.o:      explode.c $(UNZIP_H)
  89. extract.o:      extract.c $(UNZIP_H) crc32.h crypt.h
  90. fileio.o:       fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h EBCDIC_H
  91. funzip.o:       funzip.c $(UNZIP_H) crc32.h crypt.h ttyio.h
  92. globals.o:      globals.c $(UNZIP_H)
  93. inflate.o:      inflate.c inflate.h $(UNZIP_H)
  94. list.o:         list.c $(UNZIP_H)
  95. match.o:        match.c $(UNZIP_H)
  96. process.o:      process.c $(UNZIP_H) crc32.h
  97. ttyio.o:        ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
  98. ubz2err.o:      ubz2err.c $(UNZIP_H)
  99. unreduce.o:     unreduce.c $(UNZIP_H)
  100. unshrink.o:     unshrink.c $(UNZIP_H)
  101. unzip.o:        unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
  102. zipinfo.o:      zipinfo.c $(UNZIP_H)
  103.  
  104. # unzipsfx only
  105. crc32_.o:       crc32.c $(UNZIP_H) zip.h crc32.h
  106.         $(CC) $(CF) -DSFX -Fo$@ crc32.c
  107.  
  108. crypt_.o:       crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
  109.         $(CC) $(CF) -DSFX -Fo$@ crypt.c
  110.  
  111. extract_.o:     extract.c $(UNZIP_H) crc32.h crypt.h
  112.         $(CC) $(CF) -DSFX -Fo$@ extract.c
  113.  
  114. fileio_.o:      fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h EBCDIC_H
  115.         $(CC) $(CF) -DSFX -Fo$@ fileio.c
  116.  
  117. globals_.o:     globals.c $(UNZIP_H)
  118.         $(CC) $(CF) -DSFX -Fo$@ globals.c
  119.  
  120. inflate_.o:     inflate.c inflate.h $(UNZIP_H) crypt.h
  121.         $(CC) $(CF) -DSFX -Fo$@ inflate.c
  122.  
  123. match_.o:       match.c $(UNZIP_H)
  124.         $(CC) $(CF) -DSFX -Fo$@ match.c
  125.  
  126. process_.o:     process.c $(UNZIP_H) crc32.h
  127.         $(CC) $(CF) -DSFX -Fo$@ process.c
  128.  
  129. ttyio_.o:       ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
  130.         $(CC) $(CF) -DSFX -Fo$@ ttyio.c
  131.  
  132. ubz2err_.o:     ubz2err.c $(UNZIP_H)
  133.         $(CC) $(CF) -DSFX -Fo$@ ubz2err.c
  134.  
  135. unzipsfx.o:     unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
  136.         $(CC) $(CF) -DSFX -Fo$@ unzip.c
  137.  
  138. # funzip only
  139. crc32f.o:       crc32.c $(UNZIP_H) zip.h crc32.h
  140.         $(CC) $(CF) -DFUNZIP -Fo$@ crc32.c
  141.  
  142. cryptf.o:       crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
  143.         $(CC) $(CF) -DFUNZIP -Fo$@ crypt.c
  144.  
  145. globalsf.o:     globals.c $(UNZIP_H)
  146.         $(CC) $(CF) -DFUNZIP -Fo$@ globals.c
  147.  
  148. inflatef.o:     inflate.c inflate.h $(UNZIP_H) crypt.h
  149.         $(CC) $(CF) -DFUNZIP -Fo$@ inflate.c
  150.  
  151. ttyiof.o:       ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
  152.         $(CC) $(CF) -DFUNZIP -Fo$@ ttyio.c
  153.  
  154. theos.o:        theos/theos.c $(UNZIP_H) unzvers.h              # THEOS only
  155.         $(CC) $(CF) theos/theos.c
  156.  
  157. theos_.o:       theos/theos.c $(UNZIP_H)                        # THEOS unzipsfx
  158.         $(CC) $(CF) -DSFX -Fo$@ theos/theos.c
  159.  
  160. _sprintf.o:     theos/_sprintf.c $(UNZIP_H)                     # THEOS only
  161.         $(CC) $(CF) theos/_sprintf.c
  162.  
  163. _fprintf.o:     theos/_fprintf.c $(UNZIP_H)                     # THEOS only
  164.         $(CC) $(CF) theos/_fprintf.c
  165.  
  166. _isatty.o:      theos/_isatty.c $(UNZIP_H)                      # THEOS only
  167.         $(CC) $(CF) theos/_isatty.c
  168.  
  169. _stat.o:        theos/_stat.c $(UNZIP_H)                        # THEOS only
  170.         $(CC) $(CF) theos/_stat.c
  171.  
  172. _setargv.o:     theos/_setargv.c $(UNZIP_H)                     # THEOS only
  173.         $(CC) $(CF) theos/_setargv.c
  174.  
  175. unzip.command:  $(OBJS)
  176.         $(LD) $(LF) $@ $(LOBJS) $(LF2)
  177.  
  178. unzipsfx.command:       $(OBJX)
  179.         $(LD) $(LF) $@ $(LOBJX) $(LF2)
  180.  
  181. funzip.command: $(OBJF)
  182.         $(LD) $(LF) $@ $(OBJF) $(LF2)
  183.  
  184. zipinfo.command:        unzip.command
  185.         $(LN) $? $@ ( rep not
  186.  
  187. install:
  188.         copy *.command /system.cmd32.=(rep noq
  189.  
  190. clean:
  191.         erase *.o(noq not
  192.         erase *.command(noq not
  193.