VirtualBox

source: kBuild/trunk/bootstrap.gmk@ 1070

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

Made autoreconf overridable. (FreeBSD)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.2 KB
Line 
1# $Id: bootstrap.gmk 1068 2007-07-15 15:34:37Z bird $
2## @file
3#
4# GNU Make Compatible bootstrap Makefile.
5#
6# Copyright (c) 2007 knut st. osmundsen <[email protected]>
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#
29# ASSUMES:
30# - BUILD_TARGET, BUILD_PLATFORM_ARCH, BUILD_PLATFORM_CPU and BUILD_TYPE in the env.
31# - PATH_KBUILD points to ./kBuild with an absolute path.
32# - PATH_KBUILD_BIN must *NOT* be defined anywhere.
33# - Current directory == bootstrap.gmk directory.
34# - mkdir -p works.
35# - ln -s works
36# - cp -f works
37# - cd somedir && command works.
38# - echo done > file works.
39# - GNU make implements CURDIR, if not please define SRCDIR.
40#
41# Tip. kBuild/env.sh (g)make -f bootstrap.kmk
42#
43#
44
45#
46# OPTIONAL:
47# Set env.var. NIX_INSTALL_DIR to /usr/local or /usr
48# (see Config.kmk and wiki for details)
49#
50
51SRCDIR = $(CURDIR)
52OUTDIR = $(SRCDIR)/out/$(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)/$(BUILD_TYPE)/bootstrap
53
54# Override this on the make commandline if you need to (FreeBSD).
55AUTORECONF = autoreconf
56
57all: stage1 stage2
58
59
60#
61# Stage 1 - Build bootstrap kmk and sed, refresh config.h caches, link
62# up kmk_ash so $(OUTDIR)/kmk can serve as kBuild bin dir.
63#
64stage1: \
65 $(OUTDIR)/kmk/kmk \
66 $(OUTDIR)/kmk/kmk_ash \
67 $(OUTDIR)/kmk/kmk_sed \
68 $(SRCDIR)/src/kmk/config.h.$(BUILD_TARGET) \
69 $(SRCDIR)/src/sed/config.h.$(BUILD_TARGET)
70
71# kmk
72$(OUTDIR)/kmk/ts-autoreconf:
73 mkdir -p $(@D)
74 cd $(SRCDIR)/src/kmk && $(AUTORECONF) -i -v
75 echo done > $@
76
77$(OUTDIR)/kmk/ts-configured: $(OUTDIR)/kmk/ts-autoreconf
78 cd $(OUTDIR)/kmk && $(SRCDIR)/src/kmk/configure
79 echo done > $@
80
81$(OUTDIR)/kmk/config.h: $(OUTDIR)/kmk/ts-configured
82
83$(SRCDIR)/src/kmk/config.h.$(BUILD_TARGET): $(OUTDIR)/kmk/config.h
84 cp -f $(OUTDIR)/kmk/config.h $(SRCDIR)/src/kmk/config.h.$(BUILD_TARGET)
85
86$(OUTDIR)/kmk/kmk: $(OUTDIR)/kmk/ts-configured
87 $(MAKE) -C $(@D)
88
89# sed
90$(OUTDIR)/sed/ts-autoreconf:
91 mkdir -p $(@D)
92 @# only required on OS/2, so skip it.
93 @# cd $(SRCDIR)/src/sed && $(AUTORECONF) -i -v --force
94 echo done > $@
95
96$(OUTDIR)/sed/ts-configured: $(OUTDIR)/sed/ts-autoreconf
97 cd $(OUTDIR)/sed && $(SRCDIR)/src/sed/configure --without-libintl --disable-nls
98 echo done > $@
99
100$(OUTDIR)/sed/config.h: $(OUTDIR)/sed/ts-configured
101
102$(SRCDIR)/src/sed/config.h.$(BUILD_TARGET): $(OUTDIR)/sed/config.h
103 cp -f $< $@
104
105$(OUTDIR)/sed/sed/sed: $(OUTDIR)/sed/ts-configured
106 $(MAKE) -C $(@D)/..
107
108$(OUTDIR)/kmk/kmk_sed: $(OUTDIR)/sed/sed/sed
109 cp -f $< $@
110
111$(OUTDIR)/kmk/kmk_ash:
112 ln -s /bin/sh $@
113
114#
115# Stage 2 - Build kBuild using the bootstrap tools from the previous step
116# and install it to kBuild/bin/x.y.
117#
118stage2: \
119 $(OUTDIR)/ts-stage2-build \
120 $(OUTDIR)/ts-stage2-install
121
122$(OUTDIR)/ts-stage2-build: \
123 $(SRCDIR)/src/kmk/config.h.$(BUILD_TARGET) \
124 $(SRCDIR)/src/sed/config.h.$(BUILD_TARGET) \
125 $(OUTDIR)/kmk/kmk
126 $(OUTDIR)/kmk/kmk -C $(SRCDIR)
127 echo done > $@
128
129$(OUTDIR)/ts-stage2-install: $(OUTDIR)/ts-stage2-build
130 $(OUTDIR)/kmk/kmk -C $(SRCDIR) PATH_INS=$(SRCDIR) install
131 echo done > $@
132
133
134#
135# Clean the output files...
136#
137clean:
138 rm -Rf $(SRCDIR)/out/ \
139 $(SRCDIR)/src/kmk/autom4te.cache/ \
140 $(SRCDIR)/src/sed/autom4te.cache/
141 rm -f $(SRCDIR)/src/kmk/Makefile.in \
142 $(SRCDIR)/src/kmk/config.h.in \
143 $(SRCDIR)/src/kmk/configure \
144 $(SRCDIR)/src/kmk/aclocal.m4 \
145 $(SRCDIR)/src/kmk/glob/Makefile.in \
146 $(SRCDIR)/src/kmk/config/Makefile.in \
147 $(SRCDIR)/src/kmk/config/depcomp \
148 $(SRCDIR)/src/kmk/config/compile \
149 $(SRCDIR)/src/kmk/config/missing \
150 $(SRCDIR)/src/kmk/config/config.guess \
151 $(SRCDIR)/src/kmk/config/config.sub \
152 $(SRCDIR)/src/kmk/config/install-sh \
153 $(SRCDIR)/src/kmk/w32/Makefile.in
154
155
156# can't hurt...
157.NOTPARALLEL:
158
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette