summaryrefslogtreecommitdiff
path: root/Makefile.dj2
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.dj2')
-rw-r--r--Makefile.dj261
1 files changed, 40 insertions, 21 deletions
diff --git a/Makefile.dj2 b/Makefile.dj2
index 82f55ea..07a9bb1 100644
--- a/Makefile.dj2
+++ b/Makefile.dj2
@@ -2,32 +2,51 @@
2# Copyright (C) 1995-1996 Jean-loup Gailly. 2# Copyright (C) 1995-1996 Jean-loup Gailly.
3# For conditions of distribution and use, see copyright notice in zlib.h 3# For conditions of distribution and use, see copyright notice in zlib.h
4 4
5# To compile and test, type: 5# To compile, or to compile and test, type:
6#
6# make -fmakefile.dj2; make test -fmakefile.dj2 7# make -fmakefile.dj2; make test -fmakefile.dj2
7 8#
8# To install libz.a, zconf.h and zlib.h in the djgpp directories, type: 9# To install libz.a, zconf.h and zlib.h in the djgpp directories, type:
10#
9# make install -fmakefile.dj2 11# make install -fmakefile.dj2
10# after first defining LIBRARY_PATH and INCLUDE_PATH in djgpp.env for [make]. 12#
11# Alternately these variables may be defined below. 13# after first defining LIBRARY_PATH and INCLUDE_PATH in djgpp.env as
14# in the sample below if the pattern of the DJGPP distribution is to
15# be followed. Remember that, while <sp>'es around <=> are ignored in
16# makefiles, they are *not* in batch files or in djgpp.env.
17# - - - - -
18# [make]
19# INCLUDE_PATH=%\>;INCLUDE_PATH%%\DJDIR%\include
20# LIBRARY_PATH=%\>;LIBRARY_PATH%%\DJDIR%\lib
21# BUTT=-m486
22# - - - - -
23# Alternately, these variables may be defined below, overriding the values
24# in djgpp.env, as
25INCLUDE_PATH=c:\usr\include
12 26
13CC=gcc 27CC=gcc
14 28
15#CFLAGS=-MMD -O 29#CFLAGS=-MMD -O
16#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 30#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
17#CFLAGS=-MMD -g -DDEBUG 31#CFLAGS=-MMD -g -DDEBUG
18CFLAGS=-MMD -O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ 32CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
19 -Wstrict-prototypes -Wmissing-prototypes 33 -Wstrict-prototypes -Wmissing-prototypes
34
35# If cp.exe is not found, replace with copy /Y .
36CP=cp -f
37# If install.exe is not found, replace with $(CP).
20INSTALL=install 38INSTALL=install
39# The default value of RM is "rm -f." If "rm.exe" is not found, uncomment:
40# RM=del
21LDLIBS=-L. -lz 41LDLIBS=-L. -lz
22LD=$(CC) -s -o 42LD=$(CC) -s -o
23LDSHARED=$(CC) 43LDSHARED=$(CC)
24 44
25VER=1.0 45VER=1.0.2
46INCL=zlib.h zconf.h
26LIBS=libz.a 47LIBS=libz.a
27 48
28AR=ar rcs 49AR=ar rcs
29# The default value of RM is "rm -f." If "rm.exe" is not found, uncomment:
30# RM=del
31 50
32prefix=/usr/local 51prefix=/usr/local
33exec_prefix = $(prefix) 52exec_prefix = $(prefix)
@@ -37,10 +56,6 @@ OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
37 56
38TEST_OBJS = example.o minigzip.o 57TEST_OBJS = example.o minigzip.o
39 58
40DISTFILES = README Change.Log configur Makefile.in Makefile Makefile.msc \
41 Makefile.bor Makefile.tc Make_vms.com descrip.mms zlib099.pat \
42 *.bak *.old *.[ch]
43
44all: example.exe minigzip.exe 59all: example.exe minigzip.exe
45 60
46test: all 61test: all
@@ -55,23 +70,27 @@ libz.a: $(OBJS)
55 70
56libz.so.$(VER): $(OBJS) 71libz.so.$(VER): $(OBJS)
57 $(LDSHARED) -o $@ $(OBJS) 72 $(LDSHARED) -o $@ $(OBJS)
58 rm -f libz.so; ln -s $@ libz.so 73 $(RM) libz.so; ln -s $@ libz.so
59 74
60%.exe : %.o $(LIBS) 75%.exe : %.o $(LIBS)
61 $(LD) $@ $< $(LDLIBS) 76 $(LD) $@ $< $(LDLIBS)
62 77
63# INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env 78# INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env .
79
80.PHONY : uninstall clean
64 81
65install: $(LIBS) 82install: $(INCL) $(LIBS)
66 $(INSTALL) zlib.h zconf.h $(INCLUDE_PATH) 83 -@if not exist $(INCLUDE_PATH)\nul mkdir $(INCLUDE_PATH)
67 $(INSTALL) $(LIBS) $(LIBRARY_PATH) 84 -@if not exist $(LIBRARY_PATH)\nul mkdir $(LIBRARY_PATH)
85 for %%f in ($(INCL)) do $(INSTALL) %%f $(INCLUDE_PATH)
86 for %%p in ($(LIBS)) do $(INSTALL) %%p $(LIBRARY_PATH)
68 87
69uninstall: 88uninstall:
70 $(RM) $(LIBRARY_PATH)/$(LIBS) 89 for %%f in ($(INCL)) do $(RM) $(INCLUDE_PATH)\%%f
71 $(RM) $(INCLUDE_PATH)/zlib.h $(INCLUDE_PATH)/zconf.h 90 for %%p in ($(LIBS)) do $(RM) $(LIBRARY_PATH)\%%p
72 91
73clean: 92clean:
74 $(RM) *.d *.o *.~ *.exe libz.a libz.so* foo.gz 93 for %%p in (*.d *.o *.exe libz.a libz.so*) do $(RM) %%p
75 94
76DEPS := $(wildcard *.d) 95DEPS := $(wildcard *.d)
77ifneq ($(DEPS),) 96ifneq ($(DEPS),)