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