source: rtems/cpukit/zlib/win32/Makefile.gcc @ 44b3802a

4.104.115
Last change on this file since 44b3802a was 44b3802a, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/23/10 at 16:00:23

Import from zlib-1.2.4

  • Property mode set to 100644
File size: 3.6 KB
Line 
1# Makefile for zlib, derived from Makefile.dj2.
2# Modified for mingw32 by C. Spieler, 6/16/98.
3# Updated for zlib 1.2.x by Christian Spieler and Cosmin Truta, Mar-2003.
4# Last updated: 1-Aug-2003.
5# Tested under Cygwin and MinGW.
6
7# Copyright (C) 1995-2003 Jean-loup Gailly.
8# For conditions of distribution and use, see copyright notice in zlib.h
9
10# To compile, or to compile and test, type:
11#
12#   make -fmakefile.gcc;  make test testdll -fmakefile.gcc
13#
14# To use the asm code, type:
15#   cp contrib/asm?86/match.S ./match.S
16#   make LOC=-DASMV OBJA=match.o -fmakefile.gcc
17#
18# To install libz.a, zconf.h and zlib.h in the system directories, type:
19#
20#   make install -fmakefile.gcc
21
22# Note:
23# If the platform is *not* MinGW (e.g. it is Cygwin or UWIN),
24# the DLL name should be changed from "zlib1.dll".
25
26STATICLIB = libz.a
27SHAREDLIB = zlib1.dll
28IMPLIB    = libzdll.a
29
30#LOC = -DASMV
31#LOC = -DDEBUG -g
32
33CC = gcc
34CFLAGS = $(LOC) -O3 -Wall
35
36AS = $(CC)
37ASFLAGS = $(LOC) -Wall
38
39LD = $(CC)
40LDFLAGS = $(LOC) -s
41
42AR = ar
43ARFLAGS = rcs
44
45RC = windres
46RCFLAGS = --define GCC_WINDRES
47
48STRIP = strip
49
50CP = cp -fp
51# If GNU install is available, replace $(CP) with install.
52INSTALL = $(CP)
53RM = rm -f
54
55prefix = /usr/local
56exec_prefix = $(prefix)
57
58OBJS = adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o \
59       gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
60OBJA =
61
62all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) example.exe minigzip.exe example_d.exe minigzip_d.exe
63
64test: example.exe minigzip.exe
65        ./example
66        echo hello world | ./minigzip | ./minigzip -d
67
68testdll: example_d.exe minigzip_d.exe
69        ./example_d
70        echo hello world | ./minigzip_d | ./minigzip_d -d
71
72.c.o:
73        $(CC) $(CFLAGS) -c -o $@ $<
74
75.S.o:
76        $(AS) $(ASFLAGS) -c -o $@ $<
77
78$(STATICLIB): $(OBJS) $(OBJA)
79        $(AR) $(ARFLAGS) $@ $(OBJS) $(OBJA)
80
81$(IMPLIB): $(SHAREDLIB)
82
83$(SHAREDLIB): win32/zlib.def $(OBJS) $(OBJA) zlibrc.o
84        $(CC) -shared -Wl,--out-implib,$(IMPLIB) \
85        -o $@ win32/zlib.def $(OBJS) $(OBJA) zlibrc.o
86        $(STRIP) $@
87
88example.exe: example.o $(STATICLIB)
89        $(LD) $(LDFLAGS) -o $@ example.o $(STATICLIB)
90
91minigzip.exe: minigzip.o $(STATICLIB)
92        $(LD) $(LDFLAGS) -o $@ minigzip.o $(STATICLIB)
93
94example_d.exe: example.o $(IMPLIB)
95        $(LD) $(LDFLAGS) -o $@ example.o $(IMPLIB)
96
97minigzip_d.exe: minigzip.o $(IMPLIB)
98        $(LD) $(LDFLAGS) -o $@ minigzip.o $(IMPLIB)
99
100zlibrc.o: win32/zlib1.rc
101        $(RC) $(RCFLAGS) -o $@ win32/zlib1.rc
102
103
104# INCLUDE_PATH and LIBRARY_PATH must be set.
105
106.PHONY: install uninstall clean
107
108install: zlib.h zconf.h $(LIB)
109        -@if not exist $(INCLUDE_PATH)/nul mkdir $(INCLUDE_PATH)
110        -@if not exist $(LIBRARY_PATH)/nul mkdir $(LIBRARY_PATH)
111        -$(INSTALL) zlib.h $(INCLUDE_PATH)
112        -$(INSTALL) zconf.h $(INCLUDE_PATH)
113        -$(INSTALL) $(STATICLIB) $(LIBRARY_PATH)
114        -$(INSTALL) $(IMPLIB) $(LIBRARY_PATH)
115
116uninstall:
117        -$(RM) $(INCLUDE_PATH)/zlib.h
118        -$(RM) $(INCLUDE_PATH)/zconf.h
119        -$(RM) $(LIBRARY_PATH)/$(STATICLIB)
120        -$(RM) $(LIBRARY_PATH)/$(IMPLIB)
121
122clean:
123        -$(RM) $(STATICLIB)
124        -$(RM) $(SHAREDLIB)
125        -$(RM) $(IMPLIB)
126        -$(RM) *.o
127        -$(RM) *.exe
128        -$(RM) foo.gz
129
130adler32.o: zlib.h zconf.h
131compress.o: zlib.h zconf.h
132crc32.o: crc32.h zlib.h zconf.h
133deflate.o: deflate.h zutil.h zlib.h zconf.h
134example.o: zlib.h zconf.h
135gzclose.o: zlib.h zconf.h gzguts.h
136gzlib.o: zlib.h zconf.h gzguts.h
137gzread.o: zlib.h zconf.h gzguts.h
138gzwrite.o: zlib.h zconf.h gzguts.h
139inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
140inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
141infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
142inftrees.o: zutil.h zlib.h zconf.h inftrees.h
143minigzip.o: zlib.h zconf.h
144trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
145uncompr.o: zlib.h zconf.h
146zutil.o: zutil.h zlib.h zconf.h
Note: See TracBrowser for help on using the repository browser.