# $Id$ ## @file # # kBuild Makefile for kLIBC aliases # The aliases are a bit special since they depend on libc-std.h # being present for generating makefile rules. So, this makefile # builds libc_alias.a, but leaves all the rest to Makefile.kmk. # # Copyright (c) 2006 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 LIBRARIES = libc_alias PACKING := # # The generated source and object files. # The installation is done manually by Makefile.kmk. Yea, it's a hack of sorts... # if defined(CFG_LIBC_USE_WATCOM) libc_alias_TOOL = OPENWATCOM else libc_alias_TOOL = GCC3 endif libc_alias_NOINST = 1 libc_alias_SOURCES := # List of alias pairs: alias=realname ALIASPAIRS = \ $(shell gawk -f aliasfuncs.awk $(PATH_TARGET)/libc-std.h) \ $(shell gawk -f aliasfuncs.awk $(PATH_TARGET)/libc-std.h _) \ $(shell gawk -f aliasbsdfuncs.awk $(PATH_TARGET)/libc-std.h) \ $(shell gawk -f aliasgnufuncs.awk $(PATH_TARGET)/libc-std.h) \ strcasecmp=_std_stricmp \ strncasecmp=_std_strnicmp \ itoa=_std_ltoa \ _itoa=_std_ltoa \ _Exit=_exit \ mempcpy=__mempcpy \ memrchr=_memrchr \ __memrchr=_memrchr \ strnlen=__strnlen \ __xpg_basename=_std_basename $(foreach pair,$(ALIASPAIRS),$(eval libc_alias_SOURCES += $$(PATH_TARGET)/libc_alias/$(word 1, $(subst =, ,$(pair))).o)) $(addsuffix $(SP)+$(SP),$(libc_alias_SOURCES)): $(LIBC_GENALIAS) alias.kmk | $(call DIRDEP,$(PATH_TARGET)/libc_alias) @$(RM) -f $(PATH_TARGET)/aliases.rsp $(libc_alias_SOURCES) @$(APPEND) -tn $(PATH_TARGET)/libc_alias/aliases.rsp $(foreach pair,$(ALIASPAIRS),"$(pair)") $(LIBC_GENALIAS) -f $(LIBC_GENALIAS_FORMAT) -D $(PATH_TARGET)/libc_alias -r $(PATH_TARGET)/libc_alias/aliases.rsp # # Extra cleanups. # OTHER_CLEAN = $(libc_alias_SOURCES) $(libc_alias_SOURCES:.o=.s) # Generate kBuild rules. include $(PATH_KBUILD)/footer.kmk