home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / zip22.zip / win32 / makefile.emx < prev    next >
Makefile  |  1997-07-20  |  6KB  |  231 lines

  1. # Makefile for Zip, ZipCloak, ZipNote and ZipSplit
  2.  
  3. # Supported Make utilities:
  4. # - Microsoft/IBM nmake
  5. # - dmake 3.8 or higher
  6. # - GNU make, at least version 3.68
  7. # - NOT watcom make
  8. # For Microsoft and Watcom C, better use NMAKE,
  9. # otherwise it doesn't matter.
  10.  
  11. # Supported 32-bit C Compilers (created programs run under WinNT/Win95 only):
  12. # - GNU gcc (emx/rsxnt kit 0.9c or newer)
  13.  
  14. # Supported Cross-Compilers for MS-DOS:
  15. # - GNU gcc (emx kit 0.9c or newer, 32-bit)
  16.  
  17. # Supported Assemblers:
  18. # - GNU as with GNU gcc
  19.  
  20.  
  21. # To use, enter "make/nmake/dmake -f win32/makefile.emx"
  22. # (this makefile depends on its name being "win32/makefile.emx").
  23.  
  24. # Add -DNO_ASM to CFLAGS and define OBJA to `nothing' if you do not have
  25. # masm or ml.
  26. # Add -DDYN_ALLOC to ASFLAGS if you have defined it in tailor.h or CFLAGS
  27.  
  28. # Note: assembly language modules are really only supported for
  29. # GNU gcc 32-bit compilation.
  30.  
  31.  
  32. default:
  33.     @echo "Enter $(MAKE) -f win32/makefile.emx target"
  34.     @echo "where target is one of:"
  35.     @echo "   gcc gccdyn gccdebug gccdos"
  36.  
  37. # emx 0.9c, gcc, PE format, statically linked C runtime and rsxnt.dll
  38. gcc:
  39.     $(MAKE) -f win32/makefile.emx zips \
  40.     CC="gcc -Zwin32 -O2 -m486 -Wall" \
  41.     CFLAGS="-DWIN32 -DASM_CRC" \
  42.     AS="gcc -Zwin32" \
  43.     ASFLAGS="-Di386" \
  44.     LDFLAGS="-o ./" \
  45.     LDFLAGS2="-s -Zsmall-conv" \
  46.     OUT="-o" \
  47.     OBJ=".o" \
  48.     CRC32="crc_gcc" \
  49.     OBJA="matchgcc.o" \
  50.     DEF="win32/zip.def"
  51.  
  52. # emx 0.9c, gcc, PE format, dynamically linked C runtime and rsxnt.dll
  53. gccdyn:
  54.     $(MAKE) -f win32/makefile.emx zips \
  55.     CC="gcc -Zwin32 -O2 -m486 -Wall" \
  56.     CFLAGS="-DWIN32 -DASM_CRC" \
  57.     AS="gcc -Zwin32" \
  58.     ASFLAGS="-Di386" \
  59.     LDFLAGS="-o ./" \
  60.     LDFLAGS2="-Zcrtdll -Zstack 320 -s" \
  61.     OUT="-o" \
  62.     OBJ=".o" \
  63.     CRC32="crc_gcc" \
  64.     OBJA="matchgcc.o" \
  65.     DEF="win32/zip.def"
  66.  
  67. # emx 0.9c, gcc, PE format, with debug info for gdb
  68. gccdebug:
  69.     $(MAKE) -f win32/makefile.emx zips \
  70.     CC="gcc Zwin32 -O2 -g -Wall" \
  71.     CFLAGS="-DWIN32 -DASM_CRC" \
  72.     AS="gcc" \
  73.     ASFLAGS="-Di386" \
  74.     LDFLAGS="-o ./" \
  75.     LDFLAGS2="" \
  76.     OUT="-o" \
  77.     OBJ=".o" \
  78.     CRC32="crc_gcc" \
  79.     OBJA="matchgcc.o" \
  80.     DEF="win32/zip.def"
  81.  
  82. # emx 0.9c, gcc, a.out format, for MS-DOS
  83. gccdos:
  84.     $(MAKE) -f win32/makefile.emx zips \
  85.     CC="gcc -O2 -m486 -Wall" \
  86.     CFLAGS="-DDOS -DMSDOS -DASM_CRC -DNO_MKTIME" \
  87.     AS="gcc" \
  88.     ASFLAGS="-Di386" \
  89.     LDFLAGS="-o ./" \
  90.     LDFLAGS2="-s -Zsmall-conv" \
  91.     OUT="-o" \
  92.     OBJ=".o" \
  93.     CRC32="crc_gcc" \
  94.     OBJA="matchgcc.o" \
  95.     OBJZS="msdos.o" \
  96.     OBJUS="msdos_.o" \
  97.     OSDEP_H="msdos/osdep.h" \
  98.     ZIPUP_H="msdos/zipup.h"
  99.  
  100. # VPATH = .;os2
  101.  
  102. # variables
  103.  
  104. #default settings for target dependent macros:
  105. DIRSEP = /
  106. AS_DIRSEP = /
  107. LOCAL_OPTS = $(LOCAL_ZIP)
  108. CCFLAGS = $(CFLAGS) $(LOCAL_OPTS)
  109.  
  110. OSDEP_H = win32/osdep.h
  111. ZIPUP_H = win32/zipup.h
  112. CRC32   = crc32
  113.  
  114.  
  115. OBJZ1 = zip$(OBJ) zipfile$(OBJ) zipup$(OBJ) fileio$(OBJ) util$(OBJ) \
  116.     $(CRC32)$(OBJ) crctab$(OBJ) globals$(OBJ) \
  117.     deflate$(OBJ) trees$(OBJ) bits$(OBJ) crypt$(OBJ) ttyio$(OBJ)
  118. OBJZS =    win32zip$(OBJ) win32$(OBJ) nt$(OBJ)
  119. OBJZ  = $(OBJZ1) $(OBJZS) $(OBJA)
  120.  
  121. OBJU1 = zipfile_$(OBJ) fileio_$(OBJ) util_$(OBJ) globals$(OBJ)
  122. OBJUS = win32_$(OBJ)
  123. OBJU  = $(OBJU1) $(OBJUS)
  124.  
  125. OBJN  =  zipnote$(OBJ) $(OBJU)
  126. OBJS  =  zipsplit$(OBJ) $(OBJU)
  127. OBJC  =  zipcloak$(OBJ) crctab$(OBJ) crypt_$(OBJ) ttyio$(OBJ) $(OBJU)
  128.  
  129. ZIP_H = zip.h ziperr.h tailor.h $(OSDEP_H)
  130.  
  131. # rules
  132.  
  133. .SUFFIXES: .c $(OBJ)
  134.  
  135. .c$(OBJ):
  136.     $(CC) -c -I. $(CCFLAGS) $(OUT)$@ $<
  137.  
  138. # targets
  139.  
  140. zips:    zip.exe zipnote.exe zipsplit.exe zipcloak.exe
  141.  
  142. zip$(OBJ):    zip.c $(ZIP_H) revision.h crypt.h ttyio.h
  143. zipfile$(OBJ):    zipfile.c $(ZIP_H)
  144. zipup$(OBJ):    zipup.c $(ZIP_H) revision.h crypt.h $(ZIPUP_H)
  145. fileio$(OBJ):    fileio.c $(ZIP_H)
  146. util$(OBJ):    util.c $(ZIP_H)
  147. globals$(OBJ):    globals.c $(ZIP_H)
  148. deflate$(OBJ):    deflate.c $(ZIP_H)
  149. trees$(OBJ):    trees.c $(ZIP_H)
  150. bits$(OBJ):    bits.c $(ZIP_H) crypt.h
  151. crc32$(OBJ):    crc32.c $(ZIP_H)
  152. crctab$(OBJ):    crctab.c $(ZIP_H)
  153. crypt$(OBJ):    crypt.c $(ZIP_H) crypt.h ttyio.h
  154. ttyio$(OBJ):    ttyio.c $(ZIP_H) crypt.h ttyio.h
  155.  
  156. os2zip$(OBJ):    os2/os2zip.c $(ZIP_H) os2/os2zip.h os2/os2acl.h
  157.     $(CC) -c -I. $(CCFLAGS) os2$(DIRSEP)os2zip.c
  158.  
  159. os2$(OBJ):    os2/os2.c $(ZIP_H) os2/os2zip.h
  160.     $(CC) -c -I. $(CCFLAGS) os2$(DIRSEP)os2.c
  161.  
  162. os2acl$(OBJ):    os2/os2acl.c os2/os2acl.h
  163.     $(CC) -c -I. $(CCFLAGS) os2$(DIRSEP)os2acl.c
  164.  
  165. msdos$(OBJ):    msdos/msdos.c $(ZIP_H)
  166.     $(CC) -c -I. $(CCFLAGS) msdos$(DIRSEP)msdos.c
  167.  
  168. win32zip$(OBJ):    win32/win32zip.c $(ZIP_H) win32/win32zip.h win32/nt.h
  169.     $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)win32zip.c
  170.  
  171. win32$(OBJ):    win32/win32.c $(ZIP_H) win32/win32zip.h
  172.     $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)win32.c
  173.  
  174. nt$(OBJ):    win32/nt.c $(ZIP_H) win32/nt.h
  175.     $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)nt.c
  176.  
  177. crc_i86$(OBJ):    msdos/crc_i86.asm                # 16bit only
  178.     $(AS) $(ASFLAGS) msdos$(AS_DIRSEP)crc_i86.asm $(ASEOL)
  179.  
  180. crc_i386$(OBJ):    win32/crc_i386.asm                # 32bit, MASM
  181.     $(AS) $(ASFLAGS) win32$(AS_DIRSEP)crc_i386.asm $(ASEOL)
  182.  
  183. crc_gcc$(OBJ):    crc_i386.S                    # 32bit, GNU AS
  184.     $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o $@ crc_i386.S
  185.  
  186. match$(OBJ):    msdos/match.asm
  187.     $(AS) $(ASFLAGS) msdos$(AS_DIRSEP)match.asm $(ASEOL)
  188.  
  189. match32$(OBJ):    win32/match32.asm
  190.     $(AS) $(ASFLAGS) win32$(AS_DIRSEP)match32.asm
  191.  
  192. matchgcc$(OBJ):    match.S
  193.     $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o $@ match.S
  194.  
  195. zipcloak$(OBJ):    zipcloak.c $(ZIP_H) revision.h crypt.h ttyio.h
  196. zipnote$(OBJ):    zipnote.c $(ZIP_H) revision.h
  197. zipsplit$(OBJ): zipsplit.c $(ZIP_H) revision.h
  198.  
  199. zipfile_$(OBJ):    zipfile.c $(ZIP_H)
  200.     $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ zipfile.c
  201.  
  202. fileio_$(OBJ):    fileio.c $(ZIP_H)
  203.     $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ fileio.c
  204.  
  205. util_$(OBJ):    util.c $(ZIP_H) os2/os2zip.h
  206.     $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ util.c
  207.  
  208. crypt_$(OBJ):    crypt.c $(ZIP_H) crypt.h ttyio.h
  209.     $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ crypt.c
  210.  
  211. os2zip_$(OBJ):    os2/os2zip.c $(ZIP_H) os2/os2zip.h
  212.     $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ os2$(DIRSEP)os2zip.c
  213.  
  214. msdos_$(OBJ):    msdos/msdos.c $(ZIP_H)
  215.     $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ msdos$(DIRSEP)msdos.c
  216.  
  217. win32_$(OBJ):    win32/win32.c $(ZIP_H) win32/win32zip.h
  218.     $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ win32$(DIRSEP)win32.c
  219.  
  220. zip.exe: $(OBJZ)
  221.     $(CC) $(LDFLAGS)$@ $(DEF) $(OBJZ) $(LDFLAGS2)
  222.  
  223. zipcloak.exe: $(OBJC)
  224.     $(CC) $(LDFLAGS)$@ $(DEF) $(OBJC) $(LDFLAGS2)
  225.  
  226. zipnote.exe: $(OBJN)
  227.     $(CC) $(LDFLAGS)$@ $(DEF) $(OBJN) $(LDFLAGS2)
  228.  
  229. zipsplit.exe: $(OBJS)
  230.     $(CC) $(LDFLAGS)$@ $(DEF) $(OBJS) $(LDFLAGS2)
  231.