# $Id: $ ## @file # # kNIX Boostrap Makefile for coreutils. # # 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 # Create a template TEMPLATE_coreutils_bin_EXTENDS = bin TEMPLATE_coreutils_bin_DEFS = $(TEMPLATE_bin_DEFS) \ HAVE_CONFIG_H \ LIBDIR=\"/@unixroot/usr/lib\" TEMPLATE_coreutils_bin_INCS = $(TEMPLATE_bin_INCS) \ $(PATH_TARGET) \ $(PATH_SUB_CURRENT) \ $(PATH_SUB_ROOT)/lib TEMPLATE_coreutils_bin_LIBS = \ $(TARGET_libcoreutils) TEMPLATE_coreutils_bin_ORDERDEPS = \ $(PATH_TARGET)/config.h \ $(PATH_TARGET)/localedir.h \ $(PATH_TARGET)/fnmatch.h # Globals TEMPLATE = coreutils_bin # The library. LIBRARIES += libcoreutils libcoreutils_TEMPLATE = coreutils_bin libcoreutils_NOINST = true libcoreutils_SOURCES = \ lib/fprintftime.c \ lib/full-read.c \ lib/full-write.c \ lib/localcharset.c \ lib/mbswidth.c \ lib/readtokens0.c \ lib/strnlen1.c \ lib/time_r.c \ lib/unicodeio.c \ lib/xalloc-die.c \ lib/xgethostname.c \ lib/xmemcoll.c \ lib/xstrndup.c \ lib/xstrtoimax.c \ lib/xstrtoumax.c \ \ lib/acl.c \ lib/argmatch.c \ lib/asnprintf.c \ lib/backupfile.c \ lib/basename.c \ lib/c-strtod.c \ lib/c-strtold.c \ lib/canon-host.c \ lib/canonicalize.c \ lib/chdir-long.c \ lib/cloexec.c \ lib/closeout.c \ lib/creat-safer.c \ lib/cycle-check.c \ lib/diacrit.c \ lib/dirname.c \ lib/dup-safer.c \ lib/euidaccess.c \ lib/exclude.c \ lib/exitfail.c \ lib/fd-reopen.c \ lib/fd-safer.c \ lib/file-type.c \ lib/filemode.c \ lib/filenamecat.c \ lib/fnmatch.c \ lib/fopen-safer.c \ lib/fsusage.c \ lib/fts.c \ lib/gai_strerror.c \ lib/getaddrinfo.c \ lib/getcwd.c \ lib/getdate.c \ lib/gethrxtime.c \ lib/getndelim2.c \ lib/getpass.c \ lib/gettime.c \ lib/getugroups.c \ lib/group-member.c \ lib/hard-locale.c \ lib/hash-pjw.c \ lib/hash.c \ lib/human.c \ lib/idcache.c \ lib/imaxtostr.c \ lib/linebuffer.c \ lib/long-options.c \ lib/lstat.c \ lib/mbchar.c \ lib/md5.c \ lib/memcasecmp.c \ lib/memcoll.c \ lib/mkdir-p.c \ lib/mkstemp-safer.c \ lib/modechange.c \ lib/mountlist.c \ lib/offtostr.c \ lib/open-safer.c \ lib/openat-die.c \ lib/openat.c \ lib/physmem.c \ lib/pipe-safer.c \ lib/posixtm.c \ lib/posixver.c \ lib/printf-args.c \ lib/printf-parse.c \ lib/quote.c \ lib/quotearg.c \ lib/readtokens.c \ lib/readutmp.c \ lib/regex.c \ lib/root-dev-ino.c \ lib/rpmatch.c \ lib/safe-read.c \ lib/safe-write.c \ lib/same.c \ lib/save-cwd.c \ lib/savedir.c \ lib/settime.c \ lib/sha1.c \ lib/sig2str.c \ lib/strcasecmp.c \ lib/strftime.c \ lib/strintcmp.c \ lib/stripslash.c \ lib/strnumcmp.c \ lib/strstr.c \ lib/umaxtostr.c \ lib/unlinkdir.c \ lib/userspec.c \ lib/utimecmp.c \ lib/utimens.c \ lib/vasnprintf.c \ lib/version-etc-fsf.c \ lib/version-etc.c \ lib/xfts.c \ lib/xgetcwd.c \ lib/xmalloc.c \ lib/xnanosleep.c \ lib/xreadlink.c \ lib/xstrtod.c \ lib/xstrtol.c \ lib/xstrtoul.c \ lib/yesno.c \ # # The /bin programs. # They all have a corresponding source file in src, so to avoid a lot of typing, # the basic attributes will be defined using a simple foreach loop below.s # bin_PROGRAMS = \ basename \ cat \ chgrp \ chmod \ chown \ cksum \ comm \ cp \ csplit \ cut \ date \ dd \ dircolors \ dirname \ du \ echo \ env \ expand \ expr \ factor \ false \ fmt \ fold \ head \ hostname \ id \ install \ join \ kill \ link \ ln \ logname \ ls \ md5sum \ mkdir \ mkfifo \ mknod \ mv \ nl \ nohup \ od \ paste \ pathchk \ pr \ printenv \ printf \ ptx \ pwd \ readlink \ rm \ rmdir \ seq \ sha1sum \ shred \ sleep \ sort \ split \ stat \ sum \ sync \ tac \ tail \ tee \ test \ touch \ tr \ true \ tsort \ tty \ unexpand \ uniq \ unlink \ wc \ whoami \ yes \ \ chroot \ df \ hostid \ nice \ pinky \ stty \ su \ uname \ uptime \ users \ who \ \ setuidgid $(foreach prog,$(bin_PROGRAMS), $(eval $(prog)_SOURCES = src/$(prog).c)) PROGRAMS += $(bin_PROGRAMS) chown_SOURCES += src/chown-core.c chgrp_SOURCES += src/chown-core.c cp_SOURCES += src/copy.c src/cp-hash.c install_SOURCES += src/copy.c src/cp-hash.c install_INST = bin/install$(SUFF_EXE) bin/ginstall$(SUFF_EXE) mv_SOURCES += src/copy.c src/cp-hash.c src/remove.c rm_SOURCES += src/remove.c ls_SOURCES += src/ls-ls.c ls_INST = bin/ls$(SUFF_EXE) bin/dir$(SUFF_EXE) bin/vdir$(SUFF_EXE) md5sum_SOURCES += src/md5.c sha1sum_SOURCES += src/md5sum.c # # Scripts. # INSTALLS += scripts scripts_TEMPLATE = bin scripts_SOURCES = $(PATH_TARGET)/groups.sh=>groups $(PATH_TARGET)/groups.sh: src/groups.sh $(SED) -e 's,@bindir@,/bin/,g' $< > $@ # # config.h, localedir.h, and fnmatch.h. # $(PATH_TARGET)/config.h: kNIX-bootstrap-$(BUILD_TARGET).$(BUILD_TARGET_ARCH)-config.h $(INSTALL) $< $@ $(PATH_TARGET)/fnmatch.h: lib/fnmatch_.h $(INSTALL) $< $@ $(PATH_TARGET)/localedir.h: $(RM) -f $@ $(APPEND) $@ '#define LOCALEDIR "/@unixroot/usr/share/locale"' $(CAT) $@ include $(PATH_KBUILD)/footer.kmk