| 1 | # $Id: Makefile.kmk 5 2008-02-03 20:56:09Z bird $
 | 
|---|
| 2 | ## @file
 | 
|---|
| 3 | # kErr - The Status Code API, sub-makefile.
 | 
|---|
| 4 | #
 | 
|---|
| 5 | 
 | 
|---|
| 6 | #
 | 
|---|
| 7 | # Copyright (c) 2007 knut st. osmundsen <bird-kStuff-spam@anduin.net>
 | 
|---|
| 8 | #
 | 
|---|
| 9 | # This file is part of kStuff.
 | 
|---|
| 10 | #
 | 
|---|
| 11 | # kStuff is free software; you can redistribute it and/or
 | 
|---|
| 12 | # modify it under the terms of the GNU Lesser General Public
 | 
|---|
| 13 | # License as published by the Free Software Foundation; either
 | 
|---|
| 14 | # version 2.1 of the License, or (at your option) any later version.
 | 
|---|
| 15 | #
 | 
|---|
| 16 | # kStuff 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 GNU
 | 
|---|
| 19 | # Lesser General Public License for more details.
 | 
|---|
| 20 | #
 | 
|---|
| 21 | # You should have received a copy of the GNU Lesser General Public
 | 
|---|
| 22 | # License along with kStuff; if not, write to the Free Software
 | 
|---|
| 23 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 | 
|---|
| 24 | #
 | 
|---|
| 25 | #
 | 
|---|
| 26 | 
 | 
|---|
| 27 | DEPTH ?= ..
 | 
|---|
| 28 | SUB_DEPTH = ..
 | 
|---|
| 29 | include $(PATH_KBUILD)/subheader.kmk
 | 
|---|
| 30 | 
 | 
|---|
| 31 | #
 | 
|---|
| 32 | # kHlpBaseStatic
 | 
|---|
| 33 | #
 | 
|---|
| 34 | LIBRARIES += kErrStatic
 | 
|---|
| 35 | kErrStatic_TEMPLATE = kStuffLIB
 | 
|---|
| 36 | kErrStatic_SOURCES = \
 | 
|---|
| 37 |         kErrName.c
 | 
|---|
| 38 | 
 | 
|---|
| 39 | kErrName.c_DEPS = $(PATH_TARGET)/kErrNameConsts.h
 | 
|---|
| 40 | kErrName.c_INCS = $(PATH_TARGET)
 | 
|---|
| 41 | 
 | 
|---|
| 42 | #
 | 
|---|
| 43 | # Generate case statements for kErrName().
 | 
|---|
| 44 | #
 | 
|---|
| 45 | $(PATH_TARGET)/kErrNameConsts.h: $(PATH_SUB_ROOT)/include/k/kErrors.h $(MAKEFILE_CURRENT) | $(call DIRDEP,$(PATH_TARGET))
 | 
|---|
| 46 |         $(RM) -f $@
 | 
|---|
| 47 |         $(SED) \
 | 
|---|
| 48 |                 -e '/^#define  *\(K[A-Z_]*ERR_[^ ()]*\) .*$$/!d' \
 | 
|---|
| 49 |                 -e 's/^#define  *\(K[A-Z_]*ERR_[^ ()]*\) .*$$/ERR_CONST(\1)/' \
 | 
|---|
| 50 |                 -e '/K[A-Z_]*ERR_[A-Z0-9_]*BASE/d' \
 | 
|---|
| 51 |                 -e '/K[A-Z_]*ERR_[A-Z0-9_]*END/d' \
 | 
|---|
| 52 |                 $< > $@
 | 
|---|
| 53 | 
 | 
|---|
| 54 | 
 | 
|---|
| 55 | # Generate the rules
 | 
|---|
| 56 | include $(PATH_KBUILD)/subfooter.kmk
 | 
|---|
| 57 | 
 | 
|---|