1 | # $Id: Makefile.kmk 3322 2007-05-06 03:13:26Z bird $
|
---|
2 | ## @file
|
---|
3 | #
|
---|
4 | # kNIX Makefile for bzip2
|
---|
5 | #
|
---|
6 | # Copyright (c) 2007 knut st. osmundsen <bird-src-spam@anduin.net>
|
---|
7 | #
|
---|
8 | #
|
---|
9 | # This file is part of kLIBC.
|
---|
10 | #
|
---|
11 | # kLIBC is free software; you can redistribute it and/or modify
|
---|
12 | # it under the terms of the GNU General Public License as published by
|
---|
13 | # the Free Software Foundation; either version 2 of the License, or
|
---|
14 | # (at your option) any later version.
|
---|
15 | #
|
---|
16 | # kLIBC is distributed in the hope that it will be useful,
|
---|
17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
19 | # GNU General Public License for more details.
|
---|
20 | #
|
---|
21 | # You should have received a copy of the GNU General Public License
|
---|
22 | # along with kLIBC; if not, write to the Free Software
|
---|
23 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
24 | #
|
---|
25 | #
|
---|
26 |
|
---|
27 | DEPTH = ../../..
|
---|
28 | include $(PATH_KBUILD)/header.kmk
|
---|
29 |
|
---|
30 | #
|
---|
31 | # libbz2_s - static.
|
---|
32 | #
|
---|
33 | LIBRARIES += libbz2_s
|
---|
34 | libbz2_s_TEMPLATE = usr.lib
|
---|
35 | libbz2_s_SOURCES = \
|
---|
36 | blocksort.c \
|
---|
37 | huffman.c \
|
---|
38 | crctable.c \
|
---|
39 | randtable.c \
|
---|
40 | compress.c \
|
---|
41 | decompress.c \
|
---|
42 | bzlib.c
|
---|
43 |
|
---|
44 | #
|
---|
45 | # libbz2_dll - dynamic import library.
|
---|
46 | #
|
---|
47 | LIBRARIES += libbz2_dll
|
---|
48 | libbz2_dll_TEMPLATE = usr.lib
|
---|
49 | libbz2_dll_SOURCES = \
|
---|
50 | $(PATH_TARGET)/libbz2.def
|
---|
51 | libbz2_dll_CLEAN = \
|
---|
52 | $(PATH_TARGET)/libbz2.def
|
---|
53 |
|
---|
54 | #
|
---|
55 | # kbz2104 - dynamic.
|
---|
56 | #
|
---|
57 | DLLS += kbz2104
|
---|
58 | kbz2104_TEMPLATE = usr.lib
|
---|
59 | kbz2104_DEFS = BZ_EXPORT
|
---|
60 | kbz2104_SOURCES = \
|
---|
61 | blocksort.c \
|
---|
62 | huffman.c \
|
---|
63 | crctable.c \
|
---|
64 | randtable.c \
|
---|
65 | compress.c \
|
---|
66 | decompress.c \
|
---|
67 | bzlib.c \
|
---|
68 | $(PATH_TARGET)/libbz2.def
|
---|
69 |
|
---|
70 | $(PATH_TARGET)/libbz2.def: Makefile.kmk
|
---|
71 | $(RM) -f $@
|
---|
72 | $(APPEND) $@ "LIBRARY kbz2104 INITINSTANCE TERMINSTANCE"
|
---|
73 | $(APPEND) $@ "DATA MULTIPLE NONSHARED"
|
---|
74 | $(APPEND) $@ "EXPORTS"
|
---|
75 | $(APPEND) $@ " _BZ2_bzerror @1"
|
---|
76 | $(APPEND) $@ " _BZ2_bzclose @2"
|
---|
77 | $(APPEND) $@ " _BZ2_bzflush @3"
|
---|
78 | $(APPEND) $@ " _BZ2_bzwrite @4"
|
---|
79 | $(APPEND) $@ " _BZ2_bzread @5"
|
---|
80 | $(APPEND) $@ " _BZ2_bzdopen @6"
|
---|
81 | $(APPEND) $@ " _BZ2_bzopen @7"
|
---|
82 | $(APPEND) $@ " _BZ2_bzlibVersion @8"
|
---|
83 | $(APPEND) $@ " _BZ2_bzBuffToBuffDecompress @9"
|
---|
84 | $(APPEND) $@ " _BZ2_bzBuffToBuffCompress @10"
|
---|
85 | $(APPEND) $@ " _BZ2_bzReadGetUnused @11"
|
---|
86 | $(APPEND) $@ " _BZ2_bzRead @12"
|
---|
87 | $(APPEND) $@ " _BZ2_bzReadClose @13"
|
---|
88 | $(APPEND) $@ " _BZ2_bzReadOpen @14"
|
---|
89 | $(APPEND) $@ " _BZ2_bzWriteClose64 @15"
|
---|
90 | $(APPEND) $@ " _BZ2_bzWriteClose @16"
|
---|
91 | $(APPEND) $@ " _BZ2_bzWrite @17"
|
---|
92 | $(APPEND) $@ " _BZ2_bzWriteOpen @18"
|
---|
93 | $(APPEND) $@ " _BZ2_bzDecompressEnd @19"
|
---|
94 | $(APPEND) $@ " _BZ2_bzDecompress @20"
|
---|
95 | $(APPEND) $@ " _BZ2_bzDecompressInit @21"
|
---|
96 | $(APPEND) $@ " _BZ2_bzCompressEnd @22"
|
---|
97 | $(APPEND) $@ " _BZ2_bzCompress @23"
|
---|
98 | $(APPEND) $@ " _BZ2_bzCompressInit @24"
|
---|
99 |
|
---|
100 | #
|
---|
101 | # The programs: bzip2, bzip2recover, bzgrep, bzmore, bzdiff and their aliases.
|
---|
102 | #
|
---|
103 | PROGRAMS += bzip2
|
---|
104 | bzip2_TEMPLATE = usr.bin
|
---|
105 | bzip2_INST = usr/bin/bzip2$(SUFF_EXE) usr/bin/bunzip2$(SUFF_EXE) usr/bin/bzcat$(SUFF_EXE)
|
---|
106 | bzip2_SOURCES = bzip2.c
|
---|
107 | bzip2_LIBS = $(TARGET_libbz2_s)
|
---|
108 |
|
---|
109 | PROGRAMS += bzip2recover
|
---|
110 | bzip2recover_TEMPLATE = usr.bin
|
---|
111 | bzip2recover_SOURCES = bzip2recover.c
|
---|
112 | bzip2recover_LIBS = $(TARGET_libbz2_s)
|
---|
113 |
|
---|
114 | INSTALLS += bzip2-scripts
|
---|
115 | bzip2-scripts_TEMPLATE = usr.bin.script
|
---|
116 | bzip2-scripts_SOURCES = \
|
---|
117 | bzgrep \
|
---|
118 | bzmore \
|
---|
119 | bzdiff
|
---|
120 | bzip2-scripts_SYMLINKS = \
|
---|
121 | bzegrep=>bzgrep \
|
---|
122 | bzfgrep=>bzgrep \
|
---|
123 | bzless=>bzmore \
|
---|
124 | bzcmp=>bzdiff
|
---|
125 |
|
---|
126 | #
|
---|
127 | # Install headers.
|
---|
128 | #
|
---|
129 | INSTALLS += libbz2-headers
|
---|
130 | libbz2-headers_TEMPLATE = usr.include
|
---|
131 | libbz2-headers_SOURCES = \
|
---|
132 | bzlib.h
|
---|
133 |
|
---|
134 | #
|
---|
135 | # The man pages.
|
---|
136 | #
|
---|
137 | INSTALLS += bzip2-manpages
|
---|
138 | bzip2-manpages_TEMPLATE = usr.bin.man
|
---|
139 | bzip2-manpages_SOURCES = \
|
---|
140 | bzip2.1 \
|
---|
141 | bzdiff.1 \
|
---|
142 | bzgrep.1 \
|
---|
143 | bzmore.1 \
|
---|
144 | $(PATH_TARGET)/bunzip2.1 \
|
---|
145 | $(PATH_TARGET)/bzcat.1 \
|
---|
146 | $(PATH_TARGET)/bzip2recover.1 \
|
---|
147 | $(PATH_TARGET)/bzegrep.1 \
|
---|
148 | $(PATH_TARGET)/bzfgrep.1 \
|
---|
149 | $(PATH_TARGET)/bzless.1 \
|
---|
150 | $(PATH_TARGET)/bzcmp.1
|
---|
151 |
|
---|
152 | $(PATH_TARGET)/bunzip2.1 \
|
---|
153 | $(PATH_TARGET)/bzcat.1 \
|
---|
154 | $(PATH_TARGET)/bzip2recover.1: | $(call DIRDEP,$(PATH_TARGET))
|
---|
155 | $(RM) -f $@
|
---|
156 | $(APPEND) $@ ".so man1/bzip2.1"
|
---|
157 |
|
---|
158 | $(PATH_TARGET)/bzegrep.1 \
|
---|
159 | $(PATH_TARGET)/bzfgrep.1: | $(call DIRDEP,$(PATH_TARGET))
|
---|
160 | $(RM) -f $@
|
---|
161 | $(APPEND) $@ ".so man1/bzgrep.1"
|
---|
162 |
|
---|
163 | $(PATH_TARGET)/bzless.1: | $(call DIRDEP,$(PATH_TARGET))
|
---|
164 | $(RM) -f $@
|
---|
165 | $(APPEND) $@ ".so man1/bzmore.1"
|
---|
166 |
|
---|
167 | $(PATH_TARGET)/bzcmp.1: | $(call DIRDEP,$(PATH_TARGET))
|
---|
168 | $(RM) -f $@
|
---|
169 | $(APPEND) $@ ".so man1/bzdiff.1"
|
---|
170 |
|
---|
171 | #
|
---|
172 | # Documentation.
|
---|
173 | #
|
---|
174 | INSTALLS += bzip2-docs
|
---|
175 | bzip2-docs_TEMPLATE = usr.bin.doc
|
---|
176 | bzip2-docs_SOURCES = \
|
---|
177 | CHANGES \
|
---|
178 | README \
|
---|
179 | README.COMPILATION.PROBLEMS \
|
---|
180 | README.XML.STUFF \
|
---|
181 | bzip2.txt \
|
---|
182 | manual.html \
|
---|
183 | manual.pdf \
|
---|
184 | manual.ps \
|
---|
185 | manual.xml
|
---|
186 |
|
---|
187 | #
|
---|
188 | # Integrity checks.
|
---|
189 | #
|
---|
190 | OTHERS += $(PATH_TARGET)/bzip2-tests
|
---|
191 | OTHER_CLEAN += \
|
---|
192 | $(PATH_TARGET)/sample1.rb2 \
|
---|
193 | $(PATH_TARGET)/sample2.rb2 \
|
---|
194 | $(PATH_TARGET)/sample3.rb2 \
|
---|
195 | $(PATH_TARGET)/sample1.tst \
|
---|
196 | $(PATH_TARGET)/sample2.tst \
|
---|
197 | $(PATH_TARGET)/sample3.tst
|
---|
198 |
|
---|
199 | $(PATH_TARGET)/bzip2-tests: $$(TARGET_bzip2)
|
---|
200 | $(RM) -f $@
|
---|
201 | $(TARGET_bzip2) -1 < sample1.ref > $(PATH_TARGET)/sample1.rb2
|
---|
202 | $(TARGET_bzip2) -2 < sample2.ref > $(PATH_TARGET)/sample2.rb2
|
---|
203 | $(TARGET_bzip2) -3 < sample3.ref > $(PATH_TARGET)/sample3.rb2
|
---|
204 | $(TARGET_bzip2) -d < sample1.bz2 > $(PATH_TARGET)/sample1.tst
|
---|
205 | $(TARGET_bzip2) -d < sample2.bz2 > $(PATH_TARGET)/sample2.tst
|
---|
206 | $(TARGET_bzip2) -ds < sample3.bz2 > $(PATH_TARGET)/sample3.tst
|
---|
207 | cmp sample1.bz2 $(PATH_TARGET)/sample1.rb2
|
---|
208 | cmp sample2.bz2 $(PATH_TARGET)/sample2.rb2
|
---|
209 | cmp sample3.bz2 $(PATH_TARGET)/sample3.rb2
|
---|
210 | cmp sample1.ref $(PATH_TARGET)/sample1.tst
|
---|
211 | cmp sample2.ref $(PATH_TARGET)/sample2.tst
|
---|
212 | cmp sample3.ref $(PATH_TARGET)/sample3.tst
|
---|
213 | $(APPEND) $@ done
|
---|
214 |
|
---|
215 | include $(PATH_KBUILD)/footer.kmk
|
---|
216 |
|
---|