source: trunk/essentials/app-arch/gzip/Makefile.kmk@ 3492

Last change on this file since 3492 was 3479, checked in by bird, 18 years ago

gzip is needed for manpages and must be built before anything else. skip the unimportant stuff which has external dependencies.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.8 KB
Line 
1# $Id: Makefile.kmk 3479 2007-06-17 20:22:47Z 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
27DEPTH = ../../..
28include $(PATH_KBUILD)/header.kmk
29
30
31#
32# Internal library.
33#
34LIBRARIES += libgzip
35libgzip_TEMPLATE = usr.bin
36libgzip_NOINST = yes
37libgzip_DEFS = HAVE_CONFIG_H
38libgzip_INCS = $(PATH_TARGET) lib
39libgzip_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
50libgzip_ORDERDEPS = $(PATH_TARGET)/config.h
51
52#
53# The gzip program and associated scripts.
54#
55PROGRAMS += gzip
56gzip_TEMPLATE = usr.bin
57gzip_DEFS = HAVE_CONFIG_H
58gzip_INCS = $(PATH_TARGET) lib
59gzip_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
73gzip_LIBS = $(TARGET_libgzip)
74gzip_ORDERDEPS = $(PATH_TARGET)/config.h
75
76INSTALLS += gzip-scripts
77gzip-scripts_TEMPLATE = usr.bin.script
78gzip-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
91gzip-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
106ifdef NOT_BOOTSTRAPPING_KNIX # depends on sh, diffutils and itself.
107
108#
109# The man pages.
110#
111INSTALLS += gzip-manpages
112gzip-manpages_TEMPLATE = usr.bin.man
113gzip-manpages_ORDERDEPS = $(INSTARGET_gzip) #<-- this doesn't work on INSTALLS.
114gzip-manpages_SOURCES = \
115 gunzip.1 \
116 gzexe.1 \
117 gzip.1 \
118 zcat.1 \
119 zcmp.1 \
120 zdiff.1 \
121 zforce.1 \
122 zgrep.1 \
123 zless.1 \
124 zmore.1 \
125 znew.1
126
127
128#
129# Documentation.
130#
131INSTALLS += gzip-docs
132gzip-docs_TEMPLATE = usr.bin.doc
133gzip-docs_SOURCES = \
134 ChangeLog \
135 NEWS \
136 README \
137 THANKS \
138 TODO \
139 algorithm.doc \
140 gzip.doc
141
142#
143# Integrity checks.
144#
145OTHERS += $(PATH_TARGET)/gzip-tests
146OTHER_CLEAN += \
147 $(PATH_TARGET)/gzip.doc.gz \
148
149$(PATH_TARGET)/gzip-tests: $$(TARGET_gzip) $(gzip-scripts_SOURCES)
150 $(RM) -f $@
151 $(TARGET_gzip) -c gzip.doc > $(PATH_TARGET)/gzip.doc.gz
152 GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zdiff -c $(PATH_TARGET)/gzip.doc.gz gzip.doc
153 GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zdiff -c gzip.doc $(PATH_TARGET)/gzip.doc.gz
154 GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zdiff -c - gzip.doc < $(PATH_TARGET)/gzip.doc.gz
155 GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zdiff -c - $(PATH_TARGET)/gzip.doc.gz < gzip.doc
156 GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zgrep -iV > /dev/null
157 $(foreach file,$(TARGET_gzip) $(gzip-scripts_SOURCES),\
158 $(NL)$(TAB)$(TARGET_gzip) -cv -- "$(file)" | $(TARGET_gzip) -d | cmp - "$(file)")
159 $(APPEND) $@ done
160
161endif # NOT_BOOTSTRAPPING_KNIX
162
163include $(PATH_KBUILD)/footer.kmk
164
Note: See TracBrowser for help on using the repository browser.