makefile.emx 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. # Makefile for Zip, ZipCloak, ZipNote and ZipSplit
  2. # using emx 0.9c for DOS.
  3. # By Kai-Uwe Rommel, Chr. Spieler, E-Yen Tan (and others).
  4. # Last updated 7th January 2007.
  5. #
  6. # This Makefile is a stripped down version of win32/Makefile.emx that
  7. # builds executables applying the default MSDOS emx setup. For variant
  8. # targets (using zlib), and cross-compilation for WIN32 or OS/2, take a
  9. # look into "win32/makefile.emx" resp. "os2/makefile.os2".
  10. #
  11. # Supported Make utilities:
  12. # - Microsoft/IBM nmake (e.g. from MSC 6.0 or newer)
  13. # - dmake 3.8 or higher
  14. # - GNU make, at least version 3.68 (GNUish 16-bit port, RSXNT Make 3.75 in a
  15. # Win95/WinNT DOS box, DJGPP v1.12 Make 3.71, some versions of DJGPP v2.x
  16. # 32-bit Make; current DJGPP v2.01 Make 3.76.1 does NOT work)
  17. # - NOT watcom make
  18. # The "smart" Make utilities mentioned below are Christian Spieler's
  19. # enhanced version of GNUish 16-bit Make (3.74) and his adaption of these
  20. # GNU Make sources to EMX (32-bit).
  21. # Supported 32-bit C Compilers for MSDOS:
  22. # - GNU gcc (emx kit 0.9c or newer, 32-bit)
  23. # Supported Assemblers:
  24. # - GNU as with GNU gcc
  25. # To use, enter "make/nmake/dmake -f msdos/makefile.emx"
  26. # (this makefile depends on its name being "msdos/makefile.emx").
  27. # emx 0.9c, gcc, a.out format, for MS-DOS
  28. CC=gcc -O2 -m486 -Wall
  29. CFLAGS=-DDOS -DMSDOS -DASM_CRC
  30. AS=gcc
  31. ASFLAGS=-Di386
  32. LDFLAGS=-o ./
  33. LDFLAGS2=-s -Zsmall-conv
  34. OUT=-o
  35. OBJ=.o
  36. CRCA_O=crc_gcc.o
  37. OBJA=matchgcc.o
  38. OBJZS=msdos.o
  39. OBJUS=msdos_.o
  40. OSDEP_H=msdos/osdep.h
  41. ZIPUP_H=msdos/zipup.h
  42. #default settings for target dependent macros:
  43. DIRSEP = /
  44. AS_DIRSEP = /
  45. RM = del
  46. LOCAL_OPTS = $(LOCAL_ZIP)
  47. CCFLAGS = $(CFLAGS) $(LOCAL_OPTS)
  48. OBJZ1 = zip$(OBJ) zipfile$(OBJ) zipup$(OBJ) fileio$(OBJ) util$(OBJ) \
  49. crc32$(OBJ) $(CRCA_O)
  50. OBJZ2 = globals$(OBJ) deflate$(OBJ) trees$(OBJ) crypt$(OBJ) \
  51. ttyio$(OBJ)
  52. OBJZ = $(OBJZ1) $(OBJZ2) $(OBJZS) $(OBJA)
  53. OBJU1 = zipfile_$(OBJ) fileio_$(OBJ) util_$(OBJ) globals$(OBJ)
  54. OBJU = $(OBJU1) $(OBJUS)
  55. OBJN = zipnote$(OBJ) $(OBJU)
  56. OBJS = zipsplit$(OBJ) $(OBJU)
  57. OBJC1 = zipcloak$(OBJ) crc32_$(OBJ) crypt_$(OBJ) ttyio$(OBJ)
  58. OBJC = $(OBJC1) $(OBJU)
  59. ZIP_H = zip.h ziperr.h tailor.h $(OSDEP_H)
  60. # rules
  61. .SUFFIXES: .c $(OBJ)
  62. .c$(OBJ):
  63. $(CC) -c -I. $(CCFLAGS) $(OUT)$@ $<
  64. # targets
  65. all: zip.exe zipnote.exe zipsplit.exe zipcloak.exe
  66. zip$(OBJ): zip.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h
  67. zipfile$(OBJ): zipfile.c $(ZIP_H) crc32.h
  68. zipup$(OBJ): zipup.c $(ZIP_H) revision.h crc32.h crypt.h $(ZIPUP_H)
  69. fileio$(OBJ): fileio.c $(ZIP_H) crc32.h
  70. util$(OBJ): util.c $(ZIP_H)
  71. globals$(OBJ): globals.c $(ZIP_H)
  72. deflate$(OBJ): deflate.c $(ZIP_H)
  73. trees$(OBJ): trees.c $(ZIP_H)
  74. crc32$(OBJ): crc32.c $(ZIP_H) crc32.h
  75. crypt$(OBJ): crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h
  76. ttyio$(OBJ): ttyio.c $(ZIP_H) crypt.h ttyio.h
  77. msdos$(OBJ): msdos/msdos.c $(ZIP_H)
  78. $(CC) -c -I. $(CCFLAGS) msdos$(DIRSEP)msdos.c
  79. win32zip$(OBJ): win32/win32zip.c $(ZIP_H) win32/win32zip.h win32/nt.h
  80. $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)win32zip.c
  81. win32$(OBJ): win32/win32.c $(ZIP_H) win32/win32zip.h
  82. $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)win32.c
  83. nt$(OBJ): win32/nt.c $(ZIP_H) win32/nt.h
  84. $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)nt.c
  85. crc_gcc$(OBJ): crc_i386.S # 32bit, GNU AS
  86. $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o $@ crc_i386.S
  87. matchgcc$(OBJ): match.S
  88. $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o $@ match.S
  89. zipcloak$(OBJ): zipcloak.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h
  90. zipnote$(OBJ): zipnote.c $(ZIP_H) revision.h
  91. zipsplit$(OBJ): zipsplit.c $(ZIP_H) revision.h
  92. zipfile_$(OBJ): zipfile.c $(ZIP_H) crc32.h
  93. $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ zipfile.c
  94. fileio_$(OBJ): fileio.c $(ZIP_H) crc32.h
  95. $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ fileio.c
  96. util_$(OBJ): util.c $(ZIP_H)
  97. $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ util.c
  98. crc32_$(OBJ): crc32.c $(ZIP_H) crc32.h
  99. $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ crc32.c
  100. crypt_$(OBJ): crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h
  101. $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ crypt.c
  102. msdos_$(OBJ): msdos/msdos.c $(ZIP_H)
  103. $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ msdos$(DIRSEP)msdos.c
  104. win32_$(OBJ): win32/win32.c $(ZIP_H) win32/win32zip.h
  105. $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ win32$(DIRSEP)win32.c
  106. # This next bit is nasty, but is needed to overcome the MS-DOS command
  107. # line limit as response files for emx's gcc seem to only work if each
  108. # file is on a different line. DJGPP doesn't do this (if you are at all
  109. # interested).
  110. zip.exe: $(OBJZ)
  111. # for DUMB make utilities, uncomment the following commands:
  112. -@$(RM) zip.rsp
  113. @for %%f in ($(OBJZ1)) do echo %%f >> zip.rsp
  114. @for %%f in ($(OBJZ2)) do echo %%f >> zip.rsp
  115. @for %%f in ($(OBJZS) $(OBJA)) do echo %%f >> zip.rsp
  116. $(CC) $(LDFLAGS)$@ @zip.rsp $(LDFLAGS2)
  117. @$(RM) zip.rsp
  118. # smart make utilities (like well done ports of GNU Make) can use this:
  119. # $(CC) $(LDFLAGS)$@ $(OBJZ) $(LDFLAGS2)
  120. zipcloak.exe: $(OBJC)
  121. # for DUMB make utilities, uncomment the following commands:
  122. -@$(RM) zipcloak.rsp
  123. @for %%f in ($(OBJC1)) do echo %%f >> zipcloak.rsp
  124. @for %%f in ($(OBJU1)) do echo %%f >> zipcloak.rsp
  125. @for %%f in ($(OBJUS)) do echo %%f >> zipcloak.rsp
  126. $(CC) $(LDFLAGS)$@ @zipcloak.rsp $(LDFLAGS2)
  127. @$(RM) zipcloak.rsp
  128. # smart make utilities (like well done ports of GNU Make) can use this:
  129. # $(CC) $(LDFLAGS)$@ $(OBJC) $(LDFLAGS2)
  130. zipnote.exe: $(OBJN)
  131. $(CC) $(LDFLAGS)$@ $(OBJN) $(LDFLAGS2)
  132. zipsplit.exe: $(OBJS)
  133. $(CC) $(LDFLAGS)$@ $(OBJS) $(LDFLAGS2)