1 | # $Id: Makefile.kmk 3521 2007-07-05 18:12:02Z bird $
|
---|
2 | ## @file
|
---|
3 | #
|
---|
4 | # The kNIX Essentials.
|
---|
5 | # This is not a standard kBuild makefile, the footer is not included.
|
---|
6 | #
|
---|
7 | # Copyright (c) 2007 knut st. osmundsen <bird-src-spam@anduin.net>
|
---|
8 | #
|
---|
9 | #
|
---|
10 | # This file is part of kNIX.
|
---|
11 | #
|
---|
12 | # kNIX is free software; you can redistribute it and/or modify
|
---|
13 | # it under the terms of the GNU General Public License as published by
|
---|
14 | # the Free Software Foundation; either version 2 of the License, or
|
---|
15 | # (at your option) any later version.
|
---|
16 | #
|
---|
17 | # kNIX is distributed in the hope that it will be useful,
|
---|
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
20 | # GNU General Public License for more details.
|
---|
21 | #
|
---|
22 | # You should have received a copy of the GNU General Public License
|
---|
23 | # along with kNIX; if not, write to the Free Software
|
---|
24 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
25 | #
|
---|
26 | #
|
---|
27 |
|
---|
28 |
|
---|
29 |
|
---|
30 | DEPTH = ..
|
---|
31 | include $(PATH_KBUILD)/header.kmk
|
---|
32 |
|
---|
33 | ## BOOTSTRAPPING_SUBDIRS
|
---|
34 | # The bootstrapping subdirectories to traverse depth first.
|
---|
35 | BOOTSTRAPPING_SUBDIRS = \
|
---|
36 | sys-devel/make \
|
---|
37 | sys-devel/flex \
|
---|
38 | sys-devel/m4 \
|
---|
39 | sys-devel/automake-1.4 \
|
---|
40 | sys-devel/automake-1.7 \
|
---|
41 | sys-devel/automake-1.8 \
|
---|
42 | sys-devel/automake-1.9 \
|
---|
43 | sys-devel/automake-wrapper \
|
---|
44 | sys-devel/autoconf-2.13 \
|
---|
45 | sys-devel/autoconf \
|
---|
46 | sys-devel/autoconf-wrapper \
|
---|
47 | sys-devel/patch \
|
---|
48 | sys-libs/ncurses \
|
---|
49 | sys-libs/zlib \
|
---|
50 | sys-apps/coreutils \
|
---|
51 | sys-apps/diffutils \
|
---|
52 | sys-apps/findutils \
|
---|
53 | sys-apps/sed \
|
---|
54 | sys-apps/gawk \
|
---|
55 | sys-apps/grep \
|
---|
56 | sys-apps/texinfo \
|
---|
57 | app-arch/bzip2 \
|
---|
58 | app-arch/cpio \
|
---|
59 | app-arch/tar \
|
---|
60 | app-shells/bash \
|
---|
61 |
|
---|
62 | # sys-devel/automake-1.10 - either it depends on libtool or it's not working here...
|
---|
63 |
|
---|
64 | ## NOT_BOOTSTRAPPING_SUBDIRS
|
---|
65 | # The not bootstrapping subdirectories to traverse depth first.
|
---|
66 | NOT_BOOTSTRAPPING_SUBDIRS = \
|
---|
67 | app-arch/gzip \
|
---|
68 | dev-lang/perl \
|
---|
69 | dev-lang/python \
|
---|
70 | net-misc/wget \
|
---|
71 | sys-apps/prefix-portage \
|
---|
72 |
|
---|
73 |
|
---|
74 | ## def_do_subdir
|
---|
75 | # Generate rules to do one subdirectory.
|
---|
76 | # @remark This is evaluated twice.
|
---|
77 | define def_do_subdir
|
---|
78 |
|
---|
79 | # build and install
|
---|
80 | subdir_$(subdir)_all:
|
---|
81 | +$$(MAKE) -C $(subdir) $(make_extra) $(def_target)
|
---|
82 |
|
---|
83 | # install
|
---|
84 | subdir_$(subdir)_install:
|
---|
85 | +$$(MAKE) -C $(subdir) $(make_extra) install
|
---|
86 |
|
---|
87 | # packing
|
---|
88 | subdir_$(subdir)_packing:
|
---|
89 | +$$(MAKE) -C $(subdir) $(make_extra) packing
|
---|
90 |
|
---|
91 | .NOTPARALLEL: subdir_$(subdir)_all subdir_$(subdir)_install subdir_$(subdir)_packing
|
---|
92 | endef
|
---|
93 |
|
---|
94 | def_target := all
|
---|
95 | make_extra :=
|
---|
96 | $(foreach subdir,$(BOOTSTRAPPING_SUBDIRS),$(eval $(def_do_subdir)))
|
---|
97 |
|
---|
98 | # not bootstrapping.
|
---|
99 | def_target := all
|
---|
100 | make_extra := NOT_BOOTSTRAPPING_KNIX=1
|
---|
101 | $(foreach subdir,$(NOT_BOOTSTRAPPING_SUBDIRS),$(eval $(def_do_subdir)))
|
---|
102 |
|
---|
103 | #
|
---|
104 | # A pass
|
---|
105 | #
|
---|
106 | all_subdirs: | $(foreach subdir,$(BOOTSTRAPPING_SUBDIRS) $(NOT_BOOTSTRAPPING_SUBDIRS), subdir_$(subdir)_all)
|
---|
107 |
|
---|
108 | .NOTPARALLEL: all_subdirs
|
---|
109 |
|
---|
110 |
|
---|
111 | #
|
---|
112 | # The default rule.
|
---|
113 | #
|
---|
114 | all_recursive: | all_subdirs
|
---|
115 |
|
---|
116 | .NOTPARALLEL: all_recursive
|
---|
117 |
|
---|