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