1#   -*-makefile-*-
2#   Master/palette.make
3#
4#   Master Makefile rules to build GNUstep-based palettes.
5#
6#   Copyright (C) 1999 Free Software Foundation, Inc.
7#
8#   Author:  Scott Christley <scottc@net-community.com>
9#   Author:  Ovidiu Predescu <ovidiu@net-community.com>
10#   Author:  Richard Frith-Macdonald <richard@brainstorm.co.uk>
11#   Author:  Nicola Pero <nicola@brainstorm.co.uk>
12#
13#   This file is part of the GNUstep Makefile Package.
14#
15#   This library is free software; you can redistribute it and/or
16#   modify it under the terms of the GNU General Public License
17#   as published by the Free Software Foundation; either version 3
18#   of the License, or (at your option) any later version.
19#
20#   You should have received a copy of the GNU General Public
21#   License along with this library; see the file COPYING.
22#   If not, write to the Free Software Foundation,
23#   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24
25ifeq ($(RULES_MAKE_LOADED),)
26include $(GNUSTEP_MAKEFILES)/rules.make
27endif
28
29PALETTE_NAME:=$(strip $(PALETTE_NAME))
30
31ifeq ($(GNUSTEP_MAKE_PARALLEL_BUILDING), no)
32
33internal-all:: $(GNUSTEP_OBJ_DIR) $(PALETTE_NAME:=.all.palette.variables)
34
35else
36
37internal-all:: $(GNUSTEP_OBJ_DIR)
38	$(ECHO_NOTHING_RECURSIVE_MAKE)$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory --no-keep-going \
39	internal-master-palette-all \
40	GNUSTEP_BUILD_DIR="$(GNUSTEP_BUILD_DIR)" \
41	_GNUSTEP_MAKE_PARALLEL=yes$(END_ECHO_RECURSIVE_MAKE)
42
43.PHONY: internal-master-palette-all
44
45internal-master-palette-all: $(PALETTE_NAME:=.all.palette.variables)
46
47endif
48
49internal-install:: $(PALETTE_NAME:=.install.palette.variables)
50
51internal-uninstall:: $(PALETTE_NAME:=.uninstall.palette.variables)
52
53_PSWRAP_C_FILES = $(foreach palette,$(PALETTE_NAME),$($(palette)_PSWRAP_FILES:.psw=.c))
54_PSWRAP_H_FILES = $(foreach palette,$(PALETTE_NAME),$($(palette)_PSWRAP_FILES:.psw=.h))
55
56internal-clean::
57ifeq ($(GNUSTEP_IS_FLATTENED), no)
58	(cd $(GNUSTEP_BUILD_DIR); \
59	rm -rf $(_PSWRAP_C_FILES) $(_PSWRAP_H_FILES) *.palette/$(GNUSTEP_TARGET_LDIR))
60else
61	(cd $(GNUSTEP_BUILD_DIR); \
62	rm -rf $(_PSWRAP_C_FILES) $(_PSWRAP_H_FILES) *.palette)
63endif
64
65internal-distclean::
66ifeq ($(GNUSTEP_IS_FLATTENED), no)
67	(cd $(GNUSTEP_BUILD_DIR); rm -rf *.palette)
68endif
69
70PALETTES_WITH_SUBPROJECTS = $(strip $(foreach palette,$(PALETTE_NAME),$(patsubst %,$(palette),$($(palette)_SUBPROJECTS))))
71ifneq ($(PALETTES_WITH_SUBPROJECTS),)
72internal-clean:: $(PALETTES_WITH_SUBPROJECTS:=.clean.palette.subprojects)
73endif
74
75internal-strings:: $(PALETTE_NAME:=.strings.palette.variables)
76
77$(PALETTE_NAME): $(GNUSTEP_OBJ_DIR)
78	$(ECHO_NOTHING_RECURSIVE_MAKE)$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory $@.all.palette.variables$(END_ECHO_RECURSIVE_MAKE)
79