source: trunk/kBuild/subfooter.kmk@ 742

Last change on this file since 742 was 742, checked in by bird, 19 years ago

Fixed the sub-makefile bustage and added two sanitychecks.

  • Property svn:keywords set to Id
File size: 2.6 KB
RevLine 
[665]1# $Id: subfooter.kmk 742 2006-12-17 07:41:22Z bird $
[472]2## @file
3#
4# kBuild - File included at bottom of a makefile or sub-makefile.
5#
6# Copyright (c) 2006 knut st. osmundsen <bird-srcspam@anduin.net>
7#
8#
9# This file is part of kBuild.
10#
11# kBuild is free software; you can redistribute it and/or modify
12# it under the terms of the GNU General Public License as published by
13# the Free Software Foundation; either version 2 of the License, or
14# (at your option) any later version.
15#
16# kBuild 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
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with kBuild; if not, write to the Free Software
23# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24#
25#
26
[742]27#
28# Sanity check.
29#
30ifdef __footer_kmk__
31$(error kBuild: footer.kmk has already been included. Fix your sub-makefiles!)
32endif
[725]33
34#
35# Set the default path for all new targets.
36#
37define def_subheader
38ifndef $(target)_PATH
39$(target)_PATH := $(PATH_SUB_CURRENT)
[472]40endif
[725]41ifndef $(target)_MAKEFILE
42$(target)_MAKEFILE := $(MAKEFILE_CURRENT)
43endif
44endef
[472]45
[725]46$(foreach target,\
47 $(ALL_TARGETS) \
48 $(FETCHES) $(FETCHES.$(BUILD_TARGET)) $(FETCHES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
49 $(PATCHES) $(PATCHES.$(BUILD_TARGET)) $(PATCHES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
50 $(BLDPROGS) $(BLDPROGS.$(BUILD_PLATFORM)) $(BLDPROGS.$(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)) \
51 $(LIBRARIES) $(LIBRARIES.$(BUILD_TARGET)) $(LIBRARIES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
52 $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)) $(IMPORT_LIBS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
53 $(DLLS) $(DLLS.$(BUILD_TARGET)) $(DLLS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
54 $(PROGRAMS) $(PROGRAMS.$(BUILD_TARGET)) $(PROGRAMS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
55 $(SYSMODS) $(SYSMODS.$(BUILD_TARGET)) $(SYSMODS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
56 $(INSTALLS) $(INSTALLS.$(BUILD_TARGET)) $(INSTALLS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
57 $(OTHERS) $(OTHERS.$(BUILD_TARGET)) $(OTHERS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
58,$(eval $(def_subheader)))
59
60
61
[742]62ifneq ($(_SUB_MAKEFILE_STACK),)
63 #
64 # Switch back to the context of previous makefile on the stack.
65 #
66 MAKEFILE_CURRENT := $(call stack-pop,_SUB_MAKEFILE_STACK)
67 PATH_SUB_CURRENT := $(abspath $(dir $(MAKEFILE_CURRENT)))
68
69else
70 #
71 # We've reached the end of the line, include the real footer.
72 #
[725]73 include $(PATH_KBUILD)/footer.kmk
[742]74
[725]75endif
76
Note: See TracBrowser for help on using the repository browser.