Makefile.os2 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. # Makefile for zlib under OS/2 using GCC (PGCC)
  2. # For conditions of distribution and use, see copyright notice in zlib.h
  3. # To compile and test, type:
  4. # cp Makefile.os2 ..
  5. # cd ..
  6. # make -f Makefile.os2 test
  7. # This makefile will build a static library z.lib, a shared library
  8. # z.dll and a import library zdll.lib. You can use either z.lib or
  9. # zdll.lib by specifying either -lz or -lzdll on gcc's command line
  10. CC=gcc -Zomf -s
  11. CFLAGS=-O6 -Wall
  12. #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
  13. #CFLAGS=-g -DDEBUG
  14. #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
  15. # -Wstrict-prototypes -Wmissing-prototypes
  16. #################### BUG WARNING: #####################
  17. ## infcodes.c hits a bug in pgcc-1.0, so you have to use either
  18. ## -O# where # <= 4 or one of (-fno-ommit-frame-pointer or -fno-force-mem)
  19. ## This bug is reportedly fixed in pgcc >1.0, but this was not tested
  20. CFLAGS+=-fno-force-mem
  21. LDFLAGS=-s -L. -lzdll -Zcrtdll
  22. LDSHARED=$(CC) -s -Zomf -Zdll -Zcrtdll
  23. VER=1.1.0
  24. ZLIB=z.lib
  25. SHAREDLIB=z.dll
  26. SHAREDLIBIMP=zdll.lib
  27. LIBS=$(ZLIB) $(SHAREDLIB) $(SHAREDLIBIMP)
  28. AR=emxomfar cr
  29. IMPLIB=emximp
  30. RANLIB=echo
  31. TAR=tar
  32. SHELL=bash
  33. prefix=/usr/local
  34. exec_prefix = $(prefix)
  35. OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
  36. zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
  37. TEST_OBJS = example.o minigzip.o
  38. DISTFILES = README INDEX ChangeLog configure Make*[a-z0-9] *.[ch] descrip.mms \
  39. algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
  40. nt/Makefile.nt nt/zlib.dnt contrib/README.contrib contrib/*.txt \
  41. contrib/asm386/*.asm contrib/asm386/*.c \
  42. contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/iostream/*.cpp \
  43. contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \
  44. contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32
  45. all: example.exe minigzip.exe
  46. test: all
  47. @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
  48. echo hello world | ./minigzip | ./minigzip -d || \
  49. echo ' *** minigzip test FAILED ***' ; \
  50. if ./example; then \
  51. echo ' *** zlib test OK ***'; \
  52. else \
  53. echo ' *** zlib test FAILED ***'; \
  54. fi
  55. $(ZLIB): $(OBJS)
  56. $(AR) $@ $(OBJS)
  57. -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
  58. $(SHAREDLIB): $(OBJS) os2/z.def
  59. $(LDSHARED) -o $@ $^
  60. $(SHAREDLIBIMP): os2/z.def
  61. $(IMPLIB) -o $@ $^
  62. example.exe: example.o $(LIBS)
  63. $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
  64. minigzip.exe: minigzip.o $(LIBS)
  65. $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
  66. clean:
  67. rm -f *.o *~ example minigzip libz.a libz.so* foo.gz
  68. distclean: clean
  69. zip:
  70. mv Makefile Makefile~; cp -p Makefile.in Makefile
  71. rm -f test.c ztest*.c
  72. v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
  73. zip -ul9 zlib$$v $(DISTFILES)
  74. mv Makefile~ Makefile
  75. dist:
  76. mv Makefile Makefile~; cp -p Makefile.in Makefile
  77. rm -f test.c ztest*.c
  78. d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
  79. rm -f $$d.tar.gz; \
  80. if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
  81. files=""; \
  82. for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
  83. cd ..; \
  84. GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
  85. if test ! -d $$d; then rm -f $$d; fi
  86. mv Makefile~ Makefile
  87. tags:
  88. etags *.[ch]
  89. depend:
  90. makedepend -- $(CFLAGS) -- *.[ch]
  91. # DO NOT DELETE THIS LINE -- make depend depends on it.
  92. adler32.o: zlib.h zconf.h
  93. compress.o: zlib.h zconf.h
  94. crc32.o: zlib.h zconf.h
  95. deflate.o: deflate.h zutil.h zlib.h zconf.h
  96. example.o: zlib.h zconf.h
  97. gzio.o: zutil.h zlib.h zconf.h
  98. infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
  99. infcodes.o: zutil.h zlib.h zconf.h
  100. infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
  101. inffast.o: zutil.h zlib.h zconf.h inftrees.h
  102. inffast.o: infblock.h infcodes.h infutil.h inffast.h
  103. inflate.o: zutil.h zlib.h zconf.h infblock.h
  104. inftrees.o: zutil.h zlib.h zconf.h inftrees.h
  105. infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
  106. minigzip.o: zlib.h zconf.h
  107. trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
  108. uncompr.o: zlib.h zconf.h
  109. zutil.o: zutil.h zlib.h zconf.h