| 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 |  | 
|---|
| 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 | ifdef NOT_BOOTSTRAPPING_KNIX # depends on sh, diffutils and itself. | 
|---|
| 107 |  | 
|---|
| 108 | # | 
|---|
| 109 | # The man pages. | 
|---|
| 110 | # | 
|---|
| 111 | INSTALLS += gzip-manpages | 
|---|
| 112 | gzip-manpages_TEMPLATE = usr.bin.man | 
|---|
| 113 | gzip-manpages_ORDERDEPS = $(INSTARGET_gzip) #<-- this doesn't work on INSTALLS. | 
|---|
| 114 | gzip-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 | # | 
|---|
| 131 | INSTALLS += gzip-docs | 
|---|
| 132 | gzip-docs_TEMPLATE = usr.bin.doc | 
|---|
| 133 | gzip-docs_SOURCES = \ | 
|---|
| 134 | ChangeLog \ | 
|---|
| 135 | NEWS \ | 
|---|
| 136 | README \ | 
|---|
| 137 | THANKS \ | 
|---|
| 138 | TODO \ | 
|---|
| 139 | algorithm.doc \ | 
|---|
| 140 | gzip.doc | 
|---|
| 141 |  | 
|---|
| 142 | # | 
|---|
| 143 | # Integrity checks. | 
|---|
| 144 | # | 
|---|
| 145 | OTHERS += $(PATH_TARGET)/gzip-tests | 
|---|
| 146 | OTHER_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 |  | 
|---|
| 161 | endif # NOT_BOOTSTRAPPING_KNIX | 
|---|
| 162 |  | 
|---|
| 163 | include $(PATH_KBUILD)/footer.kmk | 
|---|
| 164 |  | 
|---|