# Makefile for zlib, derived from Makefile.gcc. # Modified for DMC by B. Machiels, 20-Jan-2007. # Last updated: 20-Jan-2007. # Copyright (C) 1995-2003 Jean-loup Gailly. # For conditions of distribution and use, see copyright notice in zlib.h # To compile, or to compile and test, type: # # make -fmakefile.gcc; make test testdll -fmakefile.gcc # # To use the asm code, type: # cp contrib/asm?86/match.S ./match.S # make LOC=-DASMV OBJA=match.obj -fmakefile.gcc # # To install libz.a, zconf.h and zlib.h in the system directories, type: # # make install -fmakefile.gcc # Note: # If the platform is *not* MinGW (e.g. it is Cygwin or UWIN), # the DLL name should be changed from "zlib1.dll". STATICLIB = z.lib SHAREDLIB = zlib1.dll IMPLIB = zdll.lib #LOC = -DASMV #LOC = -DDEBUG -g CC = dmc CFLAGS = $(LOC) AS = $(CC) ASFLAGS = $(LOC) LD = $(CC) LDFLAGS = $(LOC) LT = lib LTFLAGS = -c RCC = rcc RCCFLAGS = -32 prefix = C:\ exec_prefix = $(prefix) OBJS = adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infback.obj \ inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) example.exe minigzip.exe example_d.exe minigzip_d.exe test: example.exe minigzip.exe example echo hello world | minigzip | minigzip -d testdll: example_d.exe minigzip_d.exe example_d echo hello world | minigzip_d | minigzip_d -d .c.obj: $(CC) $(CFLAGS) -c -o $@ $< .S.obj: $(AS) $(ASFLAGS) -c -o $@ $< $(STATICLIB): $(OBJS) -del $(STATICLIB) $(LT) $(LTFLAGS) $@ $(OBJS) $(IMPLIB): $(SHAREDLIB) $(SHAREDLIB): $(STATICLIB) win32\zlib_dmc.def $(OBJS) zlibrc.res # link $(OBJS),$@,,kernel32+user32,win32\zlib_dmc.def,zlibrc.res; # implib /noi $(IMPLIB) $@ dmc -WD $(OBJS) win32\zlib_dmc.def zlibrc.res -o $@ kernel32.lib user32.lib -L/implib:$(IMPLIB) example.exe: example.obj $(STATICLIB) $(LD) $(LDFLAGS) -o$@ example.obj $(STATICLIB) minigzip.exe: minigzip.obj $(STATICLIB) $(LD) $(LDFLAGS) -o$@ minigzip.obj $(STATICLIB) example_d.exe: example.obj $(IMPLIB) $(LD) $(LDFLAGS) -o$@ example.obj $(IMPLIB) minigzip_d.exe: minigzip.obj $(IMPLIB) $(LD) $(LDFLAGS) -o$@ minigzip.obj $(IMPLIB) #zlibrc.obj: win32\zlib1.rc # $(RCC) win32\zlib1.rc -o$@ $(RCCFLAGS) zlibrc.res: win32\zlib1.rc $(RCC) win32\zlib1.rc -o$@ $(RCCFLAGS) # INCLUDE_PATH and LIBRARY_PATH must be set. .PHONY: install uninstall clean #install: zlib.h zconf.h $(LIB) # -@if not exist $(INCLUDE_PATH)/nul mkdir $(INCLUDE_PATH) # -@if not exist $(LIBRARY_PATH)/nul mkdir $(LIBRARY_PATH) # -$(INSTALL) zlib.h $(INCLUDE_PATH) # -$(INSTALL) zconf.h $(INCLUDE_PATH) # -$(INSTALL) $(STATICLIB) $(LIBRARY_PATH) # -$(INSTALL) $(IMPLIB) $(LIBRARY_PATH) # #uninstall: # -$(RM) $(INCLUDE_PATH)/zlib.h # -$(RM) $(INCLUDE_PATH)/zconf.h # -$(RM) $(LIBRARY_PATH)/$(STATICLIB) # -$(RM) $(LIBRARY_PATH)/$(IMPLIB) clean: -del $(STATICLIB) -del $(SHAREDLIB) -del $(IMPLIB) -del *.obj -del *.exe -del *.map -del foo.gz adler32.obj: zlib.h zconf.h compress.obj: zlib.h zconf.h crc32.obj: crc32.h zlib.h zconf.h deflate.obj: deflate.h zutil.h zlib.h zconf.h example.obj: zlib.h zconf.h gzio.obj: zutil.h zlib.h zconf.h inffast.obj: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inflate.obj: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h infback.obj: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inftrees.obj: zutil.h zlib.h zconf.h inftrees.h minigzip.obj: zlib.h zconf.h trees.obj: deflate.h zutil.h zlib.h zconf.h trees.h uncompr.obj: zlib.h zconf.h zutil.obj: zutil.h zlib.h zconf.h