# $Id$ ## @file # # kNIX Makefile for gzip # # Copyright (c) 2007 knut st. osmundsen # # # This file is part of kLIBC. # # kLIBC is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # kLIBC is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with kLIBC; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # DEPTH = ../../.. include $(PATH_KBUILD)/header.kmk # # Internal library. # LIBRARIES += libgzip libgzip_TEMPLATE = usr.bin libgzip_NOINST = yes libgzip_DEFS = HAVE_CONFIG_H libgzip_INCS = $(PATH_TARGET) lib libgzip_SOURCES = \ lib/xalloc-die.c \ lib/creat-safer.c \ lib/dup-safer.c \ lib/exitfail.c \ lib/fd-safer.c \ lib/open-safer.c \ lib/pipe-safer.c \ lib/utimens.c \ lib/xmalloc.c \ lib/yesno.c libgzip_ORDERDEPS = $(PATH_TARGET)/config.h # # The gzip program and associated scripts. # PROGRAMS += gzip gzip_TEMPLATE = usr.bin gzip_DEFS = HAVE_CONFIG_H gzip_INCS = $(PATH_TARGET) lib gzip_SOURCES = \ bits.c \ crypt.c \ deflate.c \ gzip.c \ inflate.c \ lzw.c \ trees.c \ unlzh.c \ unlzw.c \ unpack.c \ unzip.c \ util.c \ zip.c gzip_LIBS = $(TARGET_libgzip) gzip_ORDERDEPS = $(PATH_TARGET)/config.h INSTALLS += gzip-scripts gzip-scripts_TEMPLATE = usr.bin.script gzip-scripts_SOURCES = \ $(PATH_TARGET)/gunzip \ $(PATH_TARGET)/gzexe \ $(PATH_TARGET)/zcat \ $(PATH_TARGET)/zcmp \ $(PATH_TARGET)/zdiff \ $(PATH_TARGET)/zegrep \ $(PATH_TARGET)/zfgrep \ $(PATH_TARGET)/zforce \ $(PATH_TARGET)/zgrep \ $(PATH_TARGET)/zless \ $(PATH_TARGET)/zmore \ $(PATH_TARGET)/znew gzip-scripts_SYMLINKS = \ uncompress=>gunzip $(gzip-scripts_SOURCES): $$(notdir $$(@)).in $(SED) \ -e 's|/bin/sh|sh.exe|g' \ -e 's|/bin/bash|bash.exe|g' \ -e 's|BINDIR|${GZIP_BINDIR-'\''/@unixroot/usr/bin'\''}|g' \ -e 's|[@]VERSION@|1.3.11|g' \ $< > $@ $(PATH_TARGET)/config.h: kNIX-bootstrap-os2.x86-config.h | $(call DIRDEP,$(PATH_TARGET)) $(CP) -f $< $@ ifdef NOT_BOOTSTRAPPING_KNIX # depends on sh, diffutils and itself. # # The man pages. # INSTALLS += gzip-manpages gzip-manpages_TEMPLATE = usr.bin.man gzip-manpages_ORDERDEPS = $(INSTARGET_gzip) #<-- this doesn't work on INSTALLS. gzip-manpages_SOURCES = \ gunzip.1 \ gzexe.1 \ gzip.1 \ zcat.1 \ zcmp.1 \ zdiff.1 \ zforce.1 \ zgrep.1 \ zless.1 \ zmore.1 \ znew.1 # # Documentation. # INSTALLS += gzip-docs gzip-docs_TEMPLATE = usr.bin.doc gzip-docs_SOURCES = \ ChangeLog \ NEWS \ README \ THANKS \ TODO \ algorithm.doc \ gzip.doc # # Integrity checks. # OTHERS += $(PATH_TARGET)/gzip-tests OTHER_CLEAN += \ $(PATH_TARGET)/gzip.doc.gz \ $(PATH_TARGET)/gzip-tests: $$(TARGET_gzip) $(gzip-scripts_SOURCES) $(RM) -f $@ $(TARGET_gzip) -c gzip.doc > $(PATH_TARGET)/gzip.doc.gz GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zdiff -c $(PATH_TARGET)/gzip.doc.gz gzip.doc GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zdiff -c gzip.doc $(PATH_TARGET)/gzip.doc.gz GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zdiff -c - gzip.doc < $(PATH_TARGET)/gzip.doc.gz GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zdiff -c - $(PATH_TARGET)/gzip.doc.gz < gzip.doc GZIP_BINDIR="$(PATH_gzip)" $(PATH_TARGET)/zgrep -iV > /dev/null $(foreach file,$(TARGET_gzip) $(gzip-scripts_SOURCES),\ $(NL)$(TAB)$(TARGET_gzip) -cv -- "$(file)" | $(TARGET_gzip) -d | cmp - "$(file)") $(APPEND) $@ done endif # NOT_BOOTSTRAPPING_KNIX include $(PATH_KBUILD)/footer.kmk