1 # This file is part of XEmacs.
3 # Copyright (C) 2002, 2003 Ben Wing.
5 # XEmacs is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by the
7 # Free Software Foundation; either version 2, or (at your option) any
10 # XEmacs is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 # You should have received a copy of the GNU General Public License
16 # along with XEmacs; see the file COPYING. If not, write to
17 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 # Boston, MA 02110-1301, USA.
21 # This is used by subdirectories that directly contain packages.
22 # Higher-level subdirectories should use meta-iterate.rules instead.
25 XEMACS_PACKAGES_BASE:= $(shell while [ ! -f XEmacs.rules ]; do \
30 include ${XEMACS_PACKAGES_BASE}/meta-targets.rules
34 include ${XEMACS_PACKAGES_BASE}/iterate-1.rules
36 # Master rule to pass down actual building
37 # Use a static pattern because of the extra dependencies
38 $(ALL_TARGETS) : %.target:
39 [ -d $(*D) ] && $(MAKE) $(MFLAGS) -C $(*D) $(*F)
41 .PHONY: $(ALL_TARGETS)
43 # Standard dependencies
45 # $(BYTECOMPILE_TARGETS): %bytecompile.target: %autoloads.target
47 # Optionally put in fake rules for packages that we cannot
48 # recursively build (yet)
49 ifneq ($(strip (ASSUMED_PRESENT)),)
50 ASSUMED_TARGETS = $(foreach package,$(ASSUMED_PRESENT), \
51 $(package)/autoloads.target \
52 $(package)/compile.target )
58 # Generate and load inter-package dependencies
60 DEPENDS_FILE_NAME = pdepends.mk
62 DEPENDS_FILES = $(PACKAGES:=/$(DEPENDS_FILE_NAME))
64 $(DEPENDS_FILES): %$(DEPENDS_FILE_NAME): %Makefile $(XEMACS_PACKAGES_BASE)/XEmacs.rules
65 $(MAKE) $(MFLAGS) -C $(*D) TARGET_BASE=$(dir $(*D)) \
68 # Compute, based on the target given on the command line, whether we need
69 # to load and recompute the pdepends.mk files (this happens automatically
70 # for any Makefile loaded or executed, if the name of the file appears
74 ifeq ($($(MAKECMDGOALS)_NEED_PDEPENDS),t)
75 include $(DEPENDS_FILES)