# $Id: Makefile.kmk 5 2008-02-03 20:56:09Z bird $ ## @file # kErr - The Status Code API, sub-makefile. # # # Copyright (c) 2007 knut st. osmundsen # # This file is part of kStuff. # # kStuff is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # kStuff 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with kStuff; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # # DEPTH ?= .. SUB_DEPTH = .. include $(PATH_KBUILD)/subheader.kmk # # kHlpBaseStatic # LIBRARIES += kErrStatic kErrStatic_TEMPLATE = kStuffLIB kErrStatic_SOURCES = \ kErrName.c kErrName.c_DEPS = $(PATH_TARGET)/kErrNameConsts.h kErrName.c_INCS = $(PATH_TARGET) # # Generate case statements for kErrName(). # $(PATH_TARGET)/kErrNameConsts.h: $(PATH_SUB_ROOT)/include/k/kErrors.h $(MAKEFILE_CURRENT) | $(call DIRDEP,$(PATH_TARGET)) $(RM) -f $@ $(SED) \ -e '/^#define *\(K[A-Z_]*ERR_[^ ()]*\) .*$$/!d' \ -e 's/^#define *\(K[A-Z_]*ERR_[^ ()]*\) .*$$/ERR_CONST(\1)/' \ -e '/K[A-Z_]*ERR_[A-Z0-9_]*BASE/d' \ -e '/K[A-Z_]*ERR_[A-Z0-9_]*END/d' \ $< > $@ # Generate the rules include $(PATH_KBUILD)/subfooter.kmk