1 | # $Id: Makefile.kmk 3389 2007-06-10 16:15:55Z bird $
|
---|
2 | ## @file
|
---|
3 | #
|
---|
4 | # kNIX Makefile for gzip
|
---|
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 | #
|
---|
32 | # Internal library.
|
---|
33 | #
|
---|
34 | LIBRARIES += libgzip
|
---|
35 | libgzip_TEMPLATE = usr.bin
|
---|
36 | libgzip_NOINST = yes
|
---|
37 | libgzip_DEFS = HAVE_CONFIG_H
|
---|
38 | libgzip_INCS = $(PATH_TARGET) lib
|
---|
39 | libgzip_SOURCES = \
|
---|
40 | lib/xalloc-die.c \
|
---|
41 | lib/creat-safer.c \
|
---|
42 | lib/dup-safer.c \
|
---|
43 | lib/exitfail.c \
|
---|
44 | lib/fd-safer.c \
|
---|
45 | lib/open-safer.c \
|
---|
46 | lib/pipe-safer.c \
|
---|
47 | lib/utimens.c \
|
---|
48 | lib/xmalloc.c \
|
---|
49 | lib/yesno.c
|
---|
50 | libgzip_ORDERDEPS = $(PATH_TARGET)/config.h
|
---|
51 |
|
---|
52 | #
|
---|
53 | # The gzip program and associated scripts.
|
---|
54 | #
|
---|
55 | PROGRAMS += gzip
|
---|
56 | gzip_TEMPLATE = usr.bin
|
---|
57 | gzip_DEFS = HAVE_CONFIG_H
|
---|
58 | gzip_INCS = $(PATH_TARGET) lib
|
---|
59 | gzip_SOURCES = \
|
---|
60 | bits.c \
|
---|
61 | crypt.c \
|
---|
62 | deflate.c \
|
---|
63 | gzip.c \
|
---|
64 | inflate.c \
|
---|
65 | lzw.c \
|
---|
66 | trees.c \
|
---|
67 | unlzh.c \
|
---|
68 | unlzw.c \
|
---|
69 | unpack.c \
|
---|
70 | unzip.c \
|
---|
71 | util.c \
|
---|
72 | zip.c
|
---|
73 | gzip_LIBS = $(TARGET_libgzip)
|
---|
74 | gzip_ORDERDEPS = $(PATH_TARGET)/config.h
|
---|
75 |
|
---|
76 | INSTALLS += gzip-scripts
|
---|
77 | gzip-scripts_TEMPLATE = usr.bin.script
|
---|
78 | gzip-scripts_SOURCES = \
|
---|
79 | $(PATH_TARGET)/gunzip \
|
---|
80 | $(PATH_TARGET)/gzexe \
|
---|
81 | $(PATH_TARGET)/zcat \
|
---|
82 | $(PATH_TARGET)/zcmp \
|
---|
83 | $(PATH_TARGET)/zdiff \
|
---|
84 | $(PATH_TARGET)/zegrep \
|
---|
85 | $(PATH_TARGET)/zfgrep \
|
---|
86 | $(PATH_TARGET)/zforce \
|
---|
87 | $(PATH_TARGET)/zgrep \
|
---|
88 | $(PATH_TARGET)/zless \
|
---|
89 | $(PATH_TARGET)/zmore \
|
---|
90 | $(PATH_TARGET)/znew
|
---|
91 | gzip-scripts_SYMLINKS = \
|
---|
92 | uncompress=>gunzip
|
---|
93 |
|
---|
94 | $(gzip-scripts_SOURCES): $$(notdir $$(@)).in
|
---|
95 | $(SED) \
|
---|
96 | -e 's|/bin/sh|sh.exe|g' \
|
---|
97 | -e 's|/bin/bash|bash.exe|g' \
|
---|
98 | -e 's|BINDIR|${GZIP_BINDIR-'\''/@unixroot/usr/bin'\''}|g' \
|
---|
99 | -e 's|[@]VERSION@|1.3.11|g' \
|
---|
100 | $< > $@
|
---|
101 |
|
---|
102 | $(PATH_TARGET)/config.h: kNIX-bootstrap-os2.x86-config.h | $(call DIRDEP,$(PATH_TARGET))
|
---|
103 | $(CP) -f $< $@
|
---|
104 |
|
---|
105 | #
|
---|
106 | # The man pages.
|
---|
107 | #
|
---|
108 | INSTALLS += gzip-manpages
|
---|
109 | gzip-manpages_TEMPLATE = usr.bin.man
|
---|
110 | gzip-manpages_SOURCES = \
|
---|
111 | gunzip.1 \
|
---|
112 | gzexe.1 \
|
---|
113 | gzip.1 \
|
---|
114 | zcat.1 \
|
---|
115 | zcmp.1 \
|
---|
116 | zdiff.1 \
|
---|
117 | zforce.1 \
|
---|
118 | zgrep.1 \
|
---|
119 | zless.1 \
|
---|
120 | zmore.1 \
|
---|
121 | znew.1
|
---|
122 |
|
---|
123 |
|
---|
124 | #
|
---|
125 | # Documentation.
|
---|
126 | #
|
---|
127 | INSTALLS += gzip-docs
|
---|
128 | gzip-docs_TEMPLATE = usr.bin.doc
|
---|
129 | gzip-docs_SOURCES = \
|
---|
130 | ChangeLog \
|
---|
131 | NEWS \
|
---|
132 | README \
|
---|
133 | THANKS \
|
---|
134 | TODO \
|
---|
135 | algorithm.doc \
|
---|
136 | gzip.doc
|
---|
137 |
|
---|
138 | #
|
---|
139 | # Integrity checks.
|
---|
140 | #
|
---|
141 | OTHERS += $(PATH_TARGET)/gzip-tests
|
---|
142 | OTHER_CLEAN += \
|
---|
143 | $(PATH_TARGET)/gzip.doc.gz \
|
---|
144 |
|
---|
145 | $(PATH_TARGET)/gzip-tests: $$(TARGET_gzip) $(gzip-scripts_SOURCES)
|
---|
146 | $(RM) -f $@
|
---|
147 | $(TARGET_gzip) -c gzip.doc > $(PATH_TARGET)/gzip.doc.gz
|
---|
148 | GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zdiff -c $(PATH_TARGET)/gzip.doc.gz gzip.doc
|
---|
149 | GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zdiff -c gzip.doc $(PATH_TARGET)/gzip.doc.gz
|
---|
150 | GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zdiff -c - gzip.doc < $(PATH_TARGET)/gzip.doc.gz
|
---|
151 | GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zdiff -c - $(PATH_TARGET)/gzip.doc.gz < gzip.doc
|
---|
152 | GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zgrep -iV > /dev/null
|
---|
153 | $(foreach file,$(TARGET_gzip) $(gzip-scripts_SOURCES),\
|
---|
154 | $(NL)$(TAB)$(TARGET_gzip) -cv -- "$(file)" | $(TARGET_gzip) -d | cmp - "$(file)")
|
---|
155 | $(APPEND) $@ done
|
---|
156 |
|
---|
157 | include $(PATH_KBUILD)/footer.kmk
|
---|
158 |
|
---|