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

Last change on this file since 3362 was 3330, checked in by bird, 18 years ago

gzip make config.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.6 KB
Line 
1# $Id: Makefile.kmk 3330 2007-05-06 04:37:56Z 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|BINDIR|${GZIP_BINDIR-'\''/@unixroot/usr/bin'\''}|g' \
98 -e 's|[@]VERSION@|1.3.11|g' \
99 $< > $@
100
101$(PATH_TARGET)/config.h: kNIX-bootstrap-os2.x86-config.h | $(call DIRDEP,$(PATH_TARGET))
102 $(CP) -f $< $@
103
104#
105# The man pages.
106#
107INSTALLS += gzip-manpages
108gzip-manpages_TEMPLATE = usr.bin.man
109gzip-manpages_SOURCES = \
110 gunzip.1 \
111 gzexe.1 \
112 gzip.1 \
113 zcat.1 \
114 zcmp.1 \
115 zdiff.1 \
116 zforce.1 \
117 zgrep.1 \
118 zless.1 \
119 zmore.1 \
120 znew.1
121
122
123#
124# Documentation.
125#
126INSTALLS += gzip-docs
127gzip-docs_TEMPLATE = usr.bin.doc
128gzip-docs_SOURCES = \
129 ChangeLog \
130 NEWS \
131 README \
132 THANKS \
133 TODO \
134 algorithm.doc \
135 gzip.doc
136
137#
138# Integrity checks.
139#
140OTHERS += $(PATH_TARGET)/gzip-tests
141OTHER_CLEAN += \
142 $(PATH_TARGET)/gzip.doc.gz \
143
144$(PATH_TARGET)/gzip-tests: $$(TARGET_gzip) $(gzip-scripts_SOURCES)
145 $(RM) -f $@
146 $(TARGET_gzip) -c gzip.doc > $(PATH_TARGET)/gzip.doc.gz
147 GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zdiff -c $(PATH_TARGET)/gzip.doc.gz gzip.doc
148 GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zdiff -c gzip.doc $(PATH_TARGET)/gzip.doc.gz
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 - $(PATH_TARGET)/gzip.doc.gz < gzip.doc
151 GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zgrep -iV > /dev/null
152 $(foreach file,$(TARGET_gzip) $(gzip-scripts_SOURCES),\
153 $(NL)$(TAB)$(TARGET_gzip) -cv -- "$(file)" | $(TARGET_gzip) -d | cmp - "$(file)")
154 $(APPEND) $@ done
155
156include $(PATH_KBUILD)/footer.kmk
157
Note: See TracBrowser for help on using the repository browser.