diff options
Diffstat (limited to 'Makefile.dj2')
-rw-r--r-- | Makefile.dj2 | 61 |
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 | ||
25 | INCLUDE_PATH=c:\usr\include | ||
12 | 26 | ||
13 | CC=gcc | 27 | CC=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 |
18 | CFLAGS=-MMD -O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ | 32 | CFLAGS=-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 . | ||
36 | CP=cp -f | ||
37 | # If install.exe is not found, replace with $(CP). | ||
20 | INSTALL=install | 38 | INSTALL=install |
39 | # The default value of RM is "rm -f." If "rm.exe" is not found, uncomment: | ||
40 | # RM=del | ||
21 | LDLIBS=-L. -lz | 41 | LDLIBS=-L. -lz |
22 | LD=$(CC) -s -o | 42 | LD=$(CC) -s -o |
23 | LDSHARED=$(CC) | 43 | LDSHARED=$(CC) |
24 | 44 | ||
25 | VER=1.0 | 45 | VER=1.0.2 |
46 | INCL=zlib.h zconf.h | ||
26 | LIBS=libz.a | 47 | LIBS=libz.a |
27 | 48 | ||
28 | AR=ar rcs | 49 | AR=ar rcs |
29 | # The default value of RM is "rm -f." If "rm.exe" is not found, uncomment: | ||
30 | # RM=del | ||
31 | 50 | ||
32 | prefix=/usr/local | 51 | prefix=/usr/local |
33 | exec_prefix = $(prefix) | 52 | exec_prefix = $(prefix) |
@@ -37,10 +56,6 @@ OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ | |||
37 | 56 | ||
38 | TEST_OBJS = example.o minigzip.o | 57 | TEST_OBJS = example.o minigzip.o |
39 | 58 | ||
40 | DISTFILES = 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 | |||
44 | all: example.exe minigzip.exe | 59 | all: example.exe minigzip.exe |
45 | 60 | ||
46 | test: all | 61 | test: all |
@@ -55,23 +70,27 @@ libz.a: $(OBJS) | |||
55 | 70 | ||
56 | libz.so.$(VER): $(OBJS) | 71 | libz.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 | ||
65 | install: $(LIBS) | 82 | install: $(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 | ||
69 | uninstall: | 88 | uninstall: |
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 | ||
73 | clean: | 92 | clean: |
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 | ||
76 | DEPS := $(wildcard *.d) | 95 | DEPS := $(wildcard *.d) |
77 | ifneq ($(DEPS),) | 96 | ifneq ($(DEPS),) |