VirtualBox

source: vbox/trunk/src/libs/zlib-1.2.6/win32/Makefile.gcc@ 44585

Last change on this file since 44585 was 40354, checked in by vboxsync, 13 years ago

libs/zlib-1.2.6: fix OSE

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.7 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 = libz.dll.a
29
30#
31# Set to 1 if shared object needs to be installed
32#
33SHARED_MODE=0
34
35#LOC = -DASMV
36#LOC = -DDEBUG -g
37
38PREFIX =
39CC = $(PREFIX)gcc
40CFLAGS = $(LOC) -O3 -Wall
41EXTRA_CFLAGS = -DNO_VIZ
42
43AS = $(CC)
44ASFLAGS = $(LOC) -Wall
45
46LD = $(CC)
47LDFLAGS = $(LOC)
48
49AR = $(PREFIX)ar
50ARFLAGS = rcs
51
52RC = $(PREFIX)windres
53RCFLAGS = --define GCC_WINDRES
54
55STRIP = $(PREFIX)strip
56
57CP = cp -fp
58# If GNU install is available, replace $(CP) with install.
59INSTALL = $(CP)
60RM = rm -f
61
62prefix ?= /usr/local
63exec_prefix = $(prefix)
64
65OBJS = adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o \
66 gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
67OBJA =
68
69all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) example.exe minigzip.exe example_d.exe minigzip_d.exe
70
71test: example.exe minigzip.exe
72 ./example
73 echo hello world | ./minigzip | ./minigzip -d
74
75testdll: example_d.exe minigzip_d.exe
76 ./example_d
77 echo hello world | ./minigzip_d | ./minigzip_d -d
78
79.c.o:
80 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
81
82.S.o:
83 $(AS) $(ASFLAGS) -c -o $@ $<
84
85$(STATICLIB): $(OBJS) $(OBJA)
86 $(AR) $(ARFLAGS) $@ $(OBJS) $(OBJA)
87
88$(IMPLIB): $(SHAREDLIB)
89
90$(SHAREDLIB): win32/zlib.def $(OBJS) $(OBJA) zlibrc.o
91 $(CC) -shared -Wl,--out-implib,$(IMPLIB) $(LDFLAGS) \
92 -o $@ win32/zlib.def $(OBJS) $(OBJA) zlibrc.o
93 $(STRIP) $@
94
95example.exe: example.o $(STATICLIB)
96 $(LD) $(LDFLAGS) -o $@ example.o $(STATICLIB)
97 $(STRIP) $@
98
99minigzip.exe: minigzip.o $(STATICLIB)
100 $(LD) $(LDFLAGS) -o $@ minigzip.o $(STATICLIB)
101 $(STRIP) $@
102
103example_d.exe: example.o $(IMPLIB)
104 $(LD) $(LDFLAGS) -o $@ example.o $(IMPLIB)
105 $(STRIP) $@
106
107minigzip_d.exe: minigzip.o $(IMPLIB)
108 $(LD) $(LDFLAGS) -o $@ minigzip.o $(IMPLIB)
109 $(STRIP) $@
110
111example.o: test/example.c zlib.h zconf.h
112 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -I. -c -o $@ test/example.c
113
114minigzip.o: test/minigzip.c zlib.h zconf.h
115 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -I. -c -o $@ test/minigzip.c
116
117zlibrc.o: win32/zlib1.rc
118 $(RC) $(RCFLAGS) -o $@ win32/zlib1.rc
119
120
121# BINARY_PATH, INCLUDE_PATH and LIBRARY_PATH must be set.
122
123.PHONY: install uninstall clean
124
125install: zlib.h zconf.h $(STATICLIB) $(IMPLIB)
126 @if test -z "$(INCLUDE_PATH)" -o -z "$(LIBRARY_PATH)" -o -z "$(BINARY_PATH)"; then \
127 echo INCLUDE_PATH, LIBRARY_PATH, and BINARY_PATH must be specified; \
128 exit 1; \
129 fi
130 -@mkdir -p $(INCLUDE_PATH)
131 -@mkdir -p $(LIBRARY_PATH) $(LIBRARY_PATH)/pkgconfig
132 -if [ "$(SHARED_MODE)" = "1" ]; then \
133 mkdir -p $(BINARY_PATH); \
134 $(INSTALL) $(SHAREDLIB) $(BINARY_PATH); \
135 $(INSTALL) $(IMPLIB) $(LIBRARY_PATH); \
136 fi
137 -$(INSTALL) zlib.h $(INCLUDE_PATH)
138 -$(INSTALL) zconf.h $(INCLUDE_PATH)
139 -$(INSTALL) $(STATICLIB) $(LIBRARY_PATH)
140 sed \
141 -e 's|@prefix@|${prefix}|g' \
142 -e 's|@exec_prefix@|${exec_prefix}|g' \
143 -e 's|@libdir@|$(LIBRARY_PATH)|g' \
144 -e 's|@sharedlibdir@|$(LIBRARY_PATH)|g' \
145 -e 's|@includedir@|$(INCLUDE_PATH)|g' \
146 -e 's|@VERSION@|'`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' zlib.h`'|g' \
147 zlib.pc.in > $(LIBRARY_PATH)/pkgconfig/zlib.pc
148
149uninstall:
150 -if [ "$(SHARED_MODE)" = "1" ]; then \
151 $(RM) $(BINARY_PATH)/$(SHAREDLIB); \
152 $(RM) $(LIBRARY_PATH)/$(IMPLIB); \
153 fi
154 -$(RM) $(INCLUDE_PATH)/zlib.h
155 -$(RM) $(INCLUDE_PATH)/zconf.h
156 -$(RM) $(LIBRARY_PATH)/$(STATICLIB)
157
158clean:
159 -$(RM) $(STATICLIB)
160 -$(RM) $(SHAREDLIB)
161 -$(RM) $(IMPLIB)
162 -$(RM) *.o
163 -$(RM) *.exe
164 -$(RM) foo.gz
165
166adler32.o: zlib.h zconf.h
167compress.o: zlib.h zconf.h
168crc32.o: crc32.h zlib.h zconf.h
169deflate.o: deflate.h zutil.h zlib.h zconf.h
170gzclose.o: zlib.h zconf.h gzguts.h
171gzlib.o: zlib.h zconf.h gzguts.h
172gzread.o: zlib.h zconf.h gzguts.h
173gzwrite.o: zlib.h zconf.h gzguts.h
174inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
175inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
176infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
177inftrees.o: zutil.h zlib.h zconf.h inftrees.h
178trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
179uncompr.o: zlib.h zconf.h
180zutil.o: zutil.h zlib.h zconf.h
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette