Home | History | Annotate | Line # | Download | only in win32
Makefile.msc revision 1.1.1.1
      1  1.1  christos # Makefile for zlib -- Microsoft (Visual) C
      2  1.1  christos #
      3  1.1  christos # Authors:
      4  1.1  christos #   Cosmin Truta, 11-Mar-2003
      5  1.1  christos #   Christian Spieler, 19-Mar-2003
      6  1.1  christos #
      7  1.1  christos # Last updated:
      8  1.1  christos #   Cosmin Truta, 27-Aug-2003
      9  1.1  christos #
     10  1.1  christos # Usage:
     11  1.1  christos #   nmake -f win32/Makefile.msc            (standard build)
     12  1.1  christos #   nmake -f win32/Makefile.msc LOC=-DFOO  (nonstandard build)
     13  1.1  christos #   nmake -f win32/Makefile.msc LOC=-DASMV OBJA=match.obj  (use ASM code)
     14  1.1  christos 
     15  1.1  christos 
     16  1.1  christos # optional build flags
     17  1.1  christos LOC =
     18  1.1  christos 
     19  1.1  christos 
     20  1.1  christos # variables
     21  1.1  christos STATICLIB = zlib.lib
     22  1.1  christos SHAREDLIB = zlib1.dll
     23  1.1  christos IMPLIB    = zdll.lib
     24  1.1  christos 
     25  1.1  christos CC = cl
     26  1.1  christos AS = ml
     27  1.1  christos LD = link
     28  1.1  christos AR = lib
     29  1.1  christos RC = rc
     30  1.1  christos CFLAGS  = -nologo -MD -O2 $(LOC)
     31  1.1  christos ASFLAGS = -coff
     32  1.1  christos LDFLAGS = -nologo -release
     33  1.1  christos ARFLAGS = -nologo
     34  1.1  christos RCFLAGS = /dWIN32 /r
     35  1.1  christos 
     36  1.1  christos OBJS = adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infback.obj \
     37  1.1  christos        inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
     38  1.1  christos OBJA =
     39  1.1  christos 
     40  1.1  christos 
     41  1.1  christos # targets
     42  1.1  christos all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) \
     43  1.1  christos      example.exe minigzip.exe example_d.exe minigzip_d.exe
     44  1.1  christos 
     45  1.1  christos $(STATICLIB): $(OBJS) $(OBJA)
     46  1.1  christos 	$(AR) $(ARFLAGS) -out:$@ $(OBJS) $(OBJA)
     47  1.1  christos 
     48  1.1  christos $(IMPLIB): $(SHAREDLIB)
     49  1.1  christos 
     50  1.1  christos $(SHAREDLIB): win32/zlib.def $(OBJS) $(OBJA) zlib1.res
     51  1.1  christos 	$(LD) $(LDFLAGS) -def:win32/zlib.def -dll -implib:$(IMPLIB) \
     52  1.1  christos 	  -out:$@ $(OBJS) $(OBJA) zlib1.res
     53  1.1  christos 
     54  1.1  christos example.exe: example.obj $(STATICLIB)
     55  1.1  christos 	$(LD) $(LDFLAGS) example.obj $(STATICLIB)
     56  1.1  christos 
     57  1.1  christos minigzip.exe: minigzip.obj $(STATICLIB)
     58  1.1  christos 	$(LD) $(LDFLAGS) minigzip.obj $(STATICLIB)
     59  1.1  christos 
     60  1.1  christos example_d.exe: example.obj $(IMPLIB)
     61  1.1  christos 	$(LD) $(LDFLAGS) -out:$@ example.obj $(IMPLIB)
     62  1.1  christos 
     63  1.1  christos minigzip_d.exe: minigzip.obj $(IMPLIB)
     64  1.1  christos 	$(LD) $(LDFLAGS) -out:$@ minigzip.obj $(IMPLIB)
     65  1.1  christos 
     66  1.1  christos .c.obj:
     67  1.1  christos 	$(CC) -c $(CFLAGS) $<
     68  1.1  christos 
     69  1.1  christos .asm.obj:
     70  1.1  christos 	$(AS) -c $(ASFLAGS) $<
     71  1.1  christos 
     72  1.1  christos adler32.obj: adler32.c zlib.h zconf.h
     73  1.1  christos 
     74  1.1  christos compress.obj: compress.c zlib.h zconf.h
     75  1.1  christos 
     76  1.1  christos crc32.obj: crc32.c zlib.h zconf.h crc32.h
     77  1.1  christos 
     78  1.1  christos deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
     79  1.1  christos 
     80  1.1  christos gzio.obj: gzio.c zutil.h zlib.h zconf.h
     81  1.1  christos 
     82  1.1  christos infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
     83  1.1  christos              inffast.h inffixed.h
     84  1.1  christos 
     85  1.1  christos inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
     86  1.1  christos              inffast.h
     87  1.1  christos 
     88  1.1  christos inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
     89  1.1  christos              inffast.h inffixed.h
     90  1.1  christos 
     91  1.1  christos inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
     92  1.1  christos 
     93  1.1  christos trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h
     94  1.1  christos 
     95  1.1  christos uncompr.obj: uncompr.c zlib.h zconf.h
     96  1.1  christos 
     97  1.1  christos zutil.obj: zutil.c zutil.h zlib.h zconf.h
     98  1.1  christos 
     99  1.1  christos example.obj: example.c zlib.h zconf.h
    100  1.1  christos 
    101  1.1  christos minigzip.obj: minigzip.c zlib.h zconf.h
    102  1.1  christos 
    103  1.1  christos zlib1.res: win32/zlib1.rc
    104  1.1  christos 	$(RC) $(RCFLAGS) /fo$@ win32/zlib1.rc
    105  1.1  christos 
    106  1.1  christos 
    107  1.1  christos # testing
    108  1.1  christos test: example.exe minigzip.exe
    109  1.1  christos 	example
    110  1.1  christos 	echo hello world | minigzip | minigzip -d
    111  1.1  christos 
    112  1.1  christos testdll: example_d.exe minigzip_d.exe
    113  1.1  christos 	example_d
    114  1.1  christos 	echo hello world | minigzip_d | minigzip_d -d
    115  1.1  christos 
    116  1.1  christos 
    117  1.1  christos # cleanup
    118  1.1  christos clean:
    119  1.1  christos 	-del $(STATICLIB)
    120  1.1  christos 	-del $(SHAREDLIB)
    121  1.1  christos 	-del $(IMPLIB)
    122  1.1  christos 	-del *.obj
    123  1.1  christos 	-del *.res
    124  1.1  christos 	-del *.exp
    125  1.1  christos 	-del *.exe
    126  1.1  christos 	-del foo.gz
    127