source: trunk/kBuild/gnumake-header.kmk@ 782

Last change on this file since 782 was 782, checked in by bird, 18 years ago

copyright 2007

  • Property svn:keywords set to Id
File size: 3.8 KB
RevLine 
[723]1# $Id: gnumake-header.kmk 782 2007-01-24 20:19:57Z bird $
2## @file
3#
4# kBuild - Additional header for use when bootstrapping kBuild using Vanilla GNU Make.
5#
[782]6# Copyright (c) 2004-2007 knut st. osmundsen <bird-kBuild-spam@anduin.net>
[723]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
27#
28# Disable some features to make it work.
29#
30NO_COMPILE_CMDS_DEPS := 1
31NO_LINK_CMDS_DEPS := 1
32sinclude $(PATH_KBUILD)/StampOutPredefines.kmk
33$(warning kBuild: Using vanilla GNU make isn't safe for anything but kBuild bootstrapping!)
34
[743]35##
[782]36# Pushes an item onto a 'stack' variable.
[743]37# @param $1 The stack variable name
38# @param $2 What to push.
39stack-push = $(eval $1 +=$2)
[723]40
[743]41##
42# Removes the top element from a 'stack' variable.
43# @returns The popped element
44# @param $1 The stack variable name
45stack-pop = $(call stack-top,$1)$(call stack-popv,$1)
46
47##
48# Removes the top element from a 'stack' variable.
[782]49# This does *NOT* return the top element, use
[743]50# @param $1 The stack variable name
51# @remark This ain't very fast (that's why it's implemented in functions.c in kmk).
52stack-popv = $(eval $1:=$(wordlist 1,$(words $(wordlist 2,9999,$($1))),$($1)))
53
54##
55# Retrieves the top element from the 'stack' variable.
56# @param $1 The stack variable name
57stack-top = $(lastword $($1))
58
59
[723]60#
[743]61# Fix some default variables.
[723]62#
63ifeq ($(MAKEFLAGS),$(MAKEFLAGS:R=x))
64# add the -R makeflag to avoid doing this for submakes
65MAKEFLAGS := R$(MAKEFLAGS)
66
67define def_undefine_default
68ifeq ($(origin $1), default)
69$1:=
70endif
71endef
[782]72
[723]73_DEFAULT_VARIABLES := .LIBPATTERNS .VARIABLES AR ARFLAGS AS CC CHECKOUT,v CO COFLAGS COMPILE.C COMPILE.F COMPILE.S COMPILE.c COMPILE.cc COMPILE.cpp COMPILE.def COMPILE.f COMPILE.mod COMPILE.p COMPILE.r COMPILE.s CPP CTANGLE CWEAVE CXX F77 F77FLAGS FC GET LD LEX LEX.l LINK.C LINK.F LINK.S LINK.c LINK.cc LINK.cpp LINK.f LINK.o LINK.p LINK.r LINK.s LINT LINT.c M2C MAKEINFO OUTPUT_OPTION PC PREPROCESS.F PREPROCESS.S PREPROCESS.r RM TANGLE TEX TEXI2DVI WEAVE YACC YACC.y
74$(foreach i, $(_DEFAULT_VARIABLES), $(eval $(call def_undefine_default,$(i))))
75_DEFAULT_VARIABLES :=
76def_undefine_default :=
77endif
78
79#
[743]80# Zap suffixes.
[723]81#
82.SUFFIXES:
83SUFFIXES :=
84
85#
[743]86# Zap implicit rules
[723]87#
88ifeq ($(MAKEFLAGS),$(MAKEFLAGS:r=x))
89MAKEFLAGS := r$(MAKEFLAGS)
90# add the -r makeflag to avoid doing this for submakes
91
92%.C:
93%.F:
94%.S:
95%.a:
96%.c:
97%.c: %.l
98%.c: %.w
99%.c: %.w %.ch
100%.c: %.y
101%.cc:
102%.ch:
103%.cpp:
104%.def:
105%.dll:
106%.dvi:
107%.dvi: %.tex
108%.dvi: %.texi
109%.dvi: %.texinfo
110%.dvi: %.txinfo
111%.el:
112%.elc:
113%.exe:
114%.f:
115%.f: %.F
116%.f: %.r
117%.h:
118%.info:
119%.info: %.texi
120%.info: %.texinfo
121%.info: %.txinfo
122%.l:
123%.lib:
124%.ln:
125%.ln: %.c
126%.ln: %.l
127%.ln: %.y
128%.mod:
129%.o:
130%.o: %.C
131%.o: %.F
132%.o: %.S
133%.o: %.c
134%.o: %.cc
135%.o: %.cpp
136%.o: %.f
137%.o: %.mod
138%.o: %.p
139%.o: %.r
140%.o: %.s
141%.obj:
142%.out:
143%.out: %
144%.p:
145%.p: %.web
146%.r:
147%.r: %.l
148%.s:
149%.s: %.S
150%.sh:
151%.sym:
152%.sym: %.def
153%.tex:
154%.tex: %.w
155%.tex: %.w %.ch
156%.tex: %.web
157%.texi:
158%.texinfo:
159%.txinfo:
160%.w:
161%.web:
162%.y:
163%: %.C
164%: %.F
165%: %.S
166%: %.c
167%: %.cc
168%: %.cpp
169%: %.f
170%: %.mod
171%: %.o
172%: %.p
173%: %.r
174%: %.s
175%: %.sh
176%:: %,v
177%:: RCS/%
178%:: RCS/%,v
179%:: SCCS/s.%
180%:: s.%
181(%): %
182endif
183
184
Note: See TracBrowser for help on using the repository browser.