Advertisement
Guest User

common.make

a guest
Nov 10th, 2013
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.38 KB | None | 0 0
  1. # -*-makefile-*-
  2. # common.make
  3. #
  4. # Set all of the common environment variables.
  5. #
  6. # Copyright (C) 1997, 2001 Free Software Foundation, Inc.
  7. #
  8. # Author: Scott Christley <scottc@net-community.com>
  9. # Author: Ovidiu Predescu <ovidiu@net-community.com>
  10. # Author: Nicola Pero <n.pero@mi.flashnet.it>
  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.  
  24. # TODO: It would be nice to check here that the 'make' command being
  25. # used is indeed GNU make, and exit with a user-friendly error message
  26. # if not. We could, for example, check that the variable MAKE_VERSION
  27. # (which is defined by GNU make but not other makes) is defined.
  28. # Unfortunately, there doesn't exist a shared make syntax for checking
  29. # that a variable is defined across different versiosn of make; BSD
  30. # make would use '.ifdef' which doesn't work with GNU make, and the
  31. # GNU make syntax (eg, ifneq ($(MAKE_VERSION),)) wouldn't work with
  32. # BSD make.
  33.  
  34. ifeq ($(COMMON_MAKE_LOADED),)
  35. COMMON_MAKE_LOADED = yes
  36.  
  37. SHELL = /bin/sh
  38.  
  39. # We have been located by using GNUSTEP_MAKEFILES. This variable
  40. # might actually have been determined in the user makefile by using
  41. # gnustep-config, so we want to export it to avoid sub-GNUmakefiles
  42. # from having to recompute it!
  43. export GNUSTEP_MAKEFILES
  44.  
  45. # The fact that this make invocation is building its targets in
  46. # parallel does not mean that submakes should do it too. We control
  47. # exactly which make invocation runs in parallel, and which does not.
  48. # So, we do not want to export _GNUSTEP_MAKE_PARALLEL to submakes,
  49. # unless passed on the command line. FIXME: This does not work, so as
  50. # a quick hack I added _GNUSTEP_MAKE_PARALLEL=no to all submake
  51. # invocations. That works fine, but might be troublesome for custom
  52. # GNUmakefiles that run submakes. Need to think.
  53. #unexport _GNUSTEP_MAKE_PARALLEL
  54.  
  55. #
  56. # Get the global config information. This includes
  57. # GNUSTEP_SYSTEM_ROOT, GNUSTEP_MAKE_VERSION, GNUSTEP_IS_FLATTENED,
  58. # default_library_combo, and, if multi-platform support is disabled,
  59. # it will also load GNUSTEP_HOST, GNUSTEP_HOST_CPU, etc.
  60. #
  61. include $(GNUSTEP_MAKEFILES)/config-noarch.make
  62.  
  63. #
  64. # Scripts to run for parsing canonical names
  65. #
  66. CONFIG_GUESS_SCRIPT = $(GNUSTEP_MAKEFILES)/config.guess
  67. CONFIG_SUB_SCRIPT = $(GNUSTEP_MAKEFILES)/config.sub
  68. CONFIG_CPU_SCRIPT = $(GNUSTEP_MAKEFILES)/cpu.sh
  69. CONFIG_VENDOR_SCRIPT = $(GNUSTEP_MAKEFILES)/vendor.sh
  70. CONFIG_OS_SCRIPT = $(GNUSTEP_MAKEFILES)/os.sh
  71. CLEAN_CPU_SCRIPT = $(GNUSTEP_MAKEFILES)/clean_cpu.sh
  72. CLEAN_VENDOR_SCRIPT = $(GNUSTEP_MAKEFILES)/clean_vendor.sh
  73. CLEAN_OS_SCRIPT = $(GNUSTEP_MAKEFILES)/clean_os.sh
  74. REL_PATH_SCRIPT = $(GNUSTEP_MAKEFILES)/relative_path.sh
  75.  
  76. #
  77. # Determine the compilation host and target
  78. #
  79. include $(GNUSTEP_MAKEFILES)/names.make
  80.  
  81. ifeq ($(GNUSTEP_IS_FLATTENED), no)
  82. GNUSTEP_HOST_DIR = $(GNUSTEP_HOST_CPU)/$(GNUSTEP_HOST_OS)
  83. GNUSTEP_TARGET_DIR = $(GNUSTEP_TARGET_CPU)/$(GNUSTEP_TARGET_OS)
  84. GNUSTEP_HOST_LDIR = $(GNUSTEP_HOST_DIR)/$(LIBRARY_COMBO)
  85. GNUSTEP_TARGET_LDIR = $(GNUSTEP_TARGET_DIR)/$(LIBRARY_COMBO)
  86. else
  87. GNUSTEP_HOST_DIR = .
  88. GNUSTEP_TARGET_DIR = .
  89. GNUSTEP_HOST_LDIR = .
  90. GNUSTEP_TARGET_LDIR = .
  91. endif
  92.  
  93. # Then, work out precisely library combos etc
  94. include $(GNUSTEP_MAKEFILES)/library-combo.make
  95.  
  96. #
  97. # Get the config information (host/target/library-combo specific),
  98. # this includes CC, OPTFLAG etc.
  99. #
  100. include $(GNUSTEP_MAKEFILES)/$(GNUSTEP_TARGET_LDIR)/config.make
  101.  
  102. # GNUSTEP_BUILD_DIR is the directory in which anything generated
  103. # during the build will be placed. '.' means it's the same as the
  104. # source directory; this case is the default/common and we optimize
  105. # for it whenever possible.
  106. ifeq ($(GNUSTEP_BUILD_DIR),)
  107. GNUSTEP_BUILD_DIR = .
  108. endif
  109.  
  110. #
  111. # Get standard messages
  112. #
  113. include $(GNUSTEP_MAKEFILES)/messages.make
  114.  
  115. ifneq ($(messages),yes)
  116. # This flag is passed to make so we do not print the directories that
  117. # we recurse into unless messages=yes is used.
  118. GNUSTEP_MAKE_NO_PRINT_DIRECTORY_FLAG = --no-print-directory
  119. else
  120. # If messages=yes is used, let make print out each directory it
  121. # recurses into.
  122. GNUSTEP_MAKE_NO_PRINT_DIRECTORY_FLAG =
  123. endif
  124.  
  125. #
  126. # Get flags/config options for core libraries
  127. #
  128.  
  129. # Then include custom makefiles with flags/config options
  130. # This is meant to be used by the core libraries to override loading
  131. # of the system makefiles from $(GNUSTEP_MAKEFILES)/Additional/*.make
  132. # with their local copy (presumably more up-to-date)
  133. ifneq ($(GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES),)
  134. include $(GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES)
  135. endif
  136. # Then include makefiles with flags/config options installed by the
  137. # libraries themselves
  138. -include $(GNUSTEP_MAKEFILES)/Additional/*.make
  139.  
  140. #
  141. # Determine target specific settings
  142. #
  143. include $(GNUSTEP_MAKEFILES)/target.make
  144.  
  145. #
  146. # Now load the filesystem locations.
  147. #
  148. include $(GNUSTEP_MAKEFILES)/filesystem.make
  149.  
  150. #
  151. # GNUSTEP_INSTALLATION_DOMAIN is the domain where all things go. This
  152. # is the variable you should use to specify where you want things to
  153. # be installed. Valid values are SYSTEM, LOCAL, NETWORK and USER,
  154. # corresponding to the various domains. If you don't specify it, it
  155. # defaults to LOCAL.
  156. #
  157. ifeq ($(GNUSTEP_INSTALLATION_DOMAIN), )
  158. GNUSTEP_INSTALLATION_DOMAIN = LOCAL
  159.  
  160. # Try to read install.conf, if one exists. This file can be used
  161. # when compiling from source to specify default installation location
  162. # for certain packages. The location of install.conf can be specified
  163. # using the GNUSTEP_INSTALLATION_DOMAINS_CONF_FILE variable; if that variable
  164. # is not set, we look for a file called install.conf in the same directory as
  165. # the GNUSTEP_CONFIG_FILE.
  166. ifeq ($(GNUSTEP_INSTALLATION_DOMAINS_CONF_FILE), )
  167. GNUSTEP_INSTALLATION_DOMAINS_CONF_FILE = $(dir $(GNUSTEP_CONFIG_FILE))installation-domains.conf
  168. endif
  169.  
  170. -include $(GNUSTEP_INSTALLATION_DOMAINS_CONF_FILE)
  171.  
  172. ifneq ($(filter $(PACKAGE_NAME), $(GNUSTEP_PACKAGES_TO_INSTALL_INTO_SYSTEM_BY_DEFAULT)), )
  173. GNUSTEP_INSTALLATION_DOMAIN = SYSTEM
  174. endif
  175.  
  176. ifneq ($(filter $(PACKAGE_NAME), $(GNUSTEP_PACKAGES_TO_INSTALL_INTO_LOCAL_BY_DEFAULT)), )
  177. GNUSTEP_INSTALLATION_DOMAIN = LOCAL
  178. endif
  179.  
  180. ifneq ($(filter $(PACKAGE_NAME), $(GNUSTEP_PACKAGES_TO_INSTALL_INTO_NETWORK_BY_DEFAULT)), )
  181. GNUSTEP_INSTALLATION_DOMAIN = NETWORK
  182. endif
  183.  
  184. ifneq ($(filter $(PACKAGE_NAME), $(GNUSTEP_PACKAGES_TO_INSTALL_INTO_USER_BY_DEFAULT)), )
  185. GNUSTEP_INSTALLATION_DOMAIN = USER
  186. endif
  187.  
  188. endif
  189.  
  190. # Safety check. Very annoying when you mistype and you end up
  191. # installing into /. ;-)
  192. ifneq ($(GNUSTEP_INSTALLATION_DOMAIN), SYSTEM)
  193. ifneq ($(GNUSTEP_INSTALLATION_DOMAIN), LOCAL)
  194. ifneq ($(GNUSTEP_INSTALLATION_DOMAIN), NETWORK)
  195. ifneq ($(GNUSTEP_INSTALLATION_DOMAIN), USER)
  196. $(error "Invalid value '$(GNUSTEP_INSTALLATION_DOMAIN)' for GNUSTEP_INSTALLATION_DOMAIN. Valid values are SYSTEM, LOCAL, NETWORK and USER")
  197. endif
  198. endif
  199. endif
  200. endif
  201.  
  202. #
  203. # GNUSTEP_INSTALLATION_DIR is an older/different mechanism for
  204. # specifying where things should be installed. It is expected to be a
  205. # fixed absolute path rather than a logical domain. You shouldn't
  206. # normally use it, but might be handy if you need to force things
  207. # and you're using the GNUstep filesystem structure.
  208. #
  209. # If GNUSTEP_INSTALLATION_DIR is set, we automatically install
  210. # everything in the GNUstep filesystem domain structure in the
  211. # specified directory. If the GNUstep filesystem structure is used,
  212. # then GNUSTEP_INSTALLATION_DOMAIN = SYSTEM is the same as
  213. # GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT).
  214. #
  215. # Please note that GNUSTEP_INSTALLATION_DIR overrides
  216. # GNUSTEP_INSTALLATION_DOMAIN, so if you want to use
  217. # GNUSTEP_INSTALLATION_DOMAIN, make sure you're not setting
  218. # GNUSTEP_INSTALLATION_DIR.
  219. #
  220.  
  221. # GNUSTEP_INSTALLATION_DIR overrides GNUSTEP_INSTALLATION_DOMAIN
  222. ifneq ($(GNUSTEP_INSTALLATION_DIR),)
  223.  
  224. # This is the case where we install things using a standard
  225. # GNUstep filesystem rooted in GNUSTEP_INSTALLATION_DIR.
  226. # This is not recommended since it does not work with custom
  227. # filesystem configurations.
  228. ifeq ($(GNUSTEP_MAKE_STRICT_V2_MODE),yes)
  229. $(error GNUSTEP_INSTALLATION_DIR is deprecated. Please use GNUSTEP_INSTALLATION_DOMAIN instead)
  230. else
  231. $(warning GNUSTEP_INSTALLATION_DIR is deprecated. Please use GNUSTEP_INSTALLATION_DOMAIN instead)
  232. endif
  233.  
  234. #
  235. # DESTDIR allows you to relocate the entire installation somewhere else
  236. # (as per GNU Coding Standards).
  237. #
  238. # Add DESTDIR as a prefix to GNUSTEP_INSTALLATION_DIR, but only if we're
  239. # at the first top-level invocation. Else we risk adding it multiple
  240. # times ;-)
  241. #
  242. ifeq ($(_GNUSTEP_TOP_INVOCATION_DONE),)
  243. ifneq ($(DESTDIR),)
  244. override GNUSTEP_INSTALLATION_DIR := $(DESTDIR)/$(GNUSTEP_INSTALLATION_DIR)
  245. endif
  246. endif
  247.  
  248. # Make it public and available to all submakes invocations
  249. export GNUSTEP_INSTALLATION_DIR
  250.  
  251. # Use GNUSTEP_INSTALLATION_DIR to set the installation dirs
  252. GNUSTEP_APPS = $(GNUSTEP_INSTALLATION_DIR)/Applications
  253. GNUSTEP_ADMIN_APPS = $(GNUSTEP_INSTALLATION_DIR)/Applications/Admin
  254. GNUSTEP_WEB_APPS = $(GNUSTEP_INSTALLATION_DIR)/Library/WebApplications
  255. GNUSTEP_TOOLS = $(GNUSTEP_INSTALLATION_DIR)/Tools
  256. GNUSTEP_ADMIN_TOOLS = $(GNUSTEP_INSTALLATION_DIR)/Tools/Admin
  257. GNUSTEP_LIBRARY = $(GNUSTEP_INSTALLATION_DIR)/Library
  258. GNUSTEP_SERVICES = $(GNUSTEP_LIBRARY)/Services
  259. ifeq ($(GNUSTEP_IS_FLATTENED),yes)
  260. GNUSTEP_HEADERS = $(GNUSTEP_INSTALLATION_DIR)/Library/Headers
  261. else
  262. GNUSTEP_HEADERS = $(GNUSTEP_INSTALLATION_DIR)/Library/Headers/$(LIBRARY_COMBO)
  263. endif
  264. GNUSTEP_APPLICATION_SUPPORT = $(GNUSTEP_LIBRARY)/ApplicationSupport
  265. GNUSTEP_BUNDLES = $(GNUSTEP_LIBRARY)/Bundles
  266. GNUSTEP_FRAMEWORKS = $(GNUSTEP_LIBRARY)/Frameworks
  267. GNUSTEP_PALETTES = $(GNUSTEP_LIBRARY)/ApplicationSupport/Palettes
  268. GNUSTEP_LIBRARIES = $(GNUSTEP_INSTALLATION_DIR)/Library/Libraries
  269. GNUSTEP_RESOURCES = $(GNUSTEP_LIBRARY)/Libraries/Resources
  270. GNUSTEP_JAVA = $(GNUSTEP_LIBRARY)/Libraries/Java
  271. GNUSTEP_DOC = $(GNUSTEP_LIBRARY)/Documentation
  272. GNUSTEP_DOC_MAN = $(GNUSTEP_DOC)/man
  273. GNUSTEP_DOC_INFO = $(GNUSTEP_DOC)/info
  274.  
  275. else
  276.  
  277. # This is the case where we install things in GNUSTEP_INSTALLATION_DOMAIN
  278. # according to the (potentially custom) filesystem configuration of
  279. # that domain. This is the recommended way.
  280.  
  281. # Make it public and available to all submakes invocations
  282. export GNUSTEP_INSTALLATION_DOMAIN
  283.  
  284. # Use DESTDIR + GNUSTEP_INSTALLATION_DOMAIN to set the installation dirs
  285. ifeq ($(DESTDIR),)
  286. MAYBE_DESTDIR=
  287. else
  288. MAYBE_DESTDIR=$(DESTDIR)/
  289. endif
  290.  
  291. GNUSTEP_APPS = $(MAYBE_DESTDIR)$(GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_APPS)
  292. GNUSTEP_ADMIN_APPS = $(MAYBE_DESTDIR)$(GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_ADMIN_APPS)
  293. GNUSTEP_WEB_APPS = $(MAYBE_DESTDIR)$(GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_WEB_APPS)
  294. GNUSTEP_TOOLS = $(MAYBE_DESTDIR)$(GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_TOOLS)
  295. GNUSTEP_ADMIN_TOOLS = $(MAYBE_DESTDIR)$(GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_ADMIN_TOOLS)
  296. GNUSTEP_LIBRARY = $(MAYBE_DESTDIR)$(GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_LIBRARY)
  297. GNUSTEP_SERVICES = $(MAYBE_DESTDIR)$(GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_SERVICES)
  298. ifeq ($(GNUSTEP_IS_FLATTENED),yes)
  299. GNUSTEP_HEADERS = $(MAYBE_DESTDIR)$(GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_HEADERS)
  300. else
  301. GNUSTEP_HEADERS = $(MAYBE_DESTDIR)$(GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_HEADERS)/$(LIBRARY_COMBO)
  302. endif
  303. GNUSTEP_APPLICATION_SUPPORT = $(MAYBE_DESTDIR)$(GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_APPLICATION_SUPPORT)
  304. GNUSTEP_BUNDLES = $(MAYBE_DESTDIR)$(GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_BUNDLES)
  305. GNUSTEP_FRAMEWORKS = $(MAYBE_DESTDIR)$(GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_FRAMEWORKS)
  306. GNUSTEP_PALETTES = $(MAYBE_DESTDIR)$(GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_PALETTES)
  307. GNUSTEP_LIBRARIES = $(MAYBE_DESTDIR)$(GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_LIBRARIES)
  308. GNUSTEP_RESOURCES = $(MAYBE_DESTDIR)$(GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_RESOURCES)
  309. GNUSTEP_JAVA = $(MAYBE_DESTDIR)$(GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_JAVA)
  310. GNUSTEP_DOC = $(MAYBE_DESTDIR)$(GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_DOC)
  311. GNUSTEP_DOC_MAN = $(MAYBE_DESTDIR)$(GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_DOC_MAN)
  312. GNUSTEP_DOC_INFO = $(MAYBE_DESTDIR)$(GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_DOC_INFO)
  313.  
  314. endif
  315.  
  316.  
  317. #
  318. # Backwards-compatible long name variant of GNUSTEP_DOC*.
  319. #
  320. # The long variables names were too long for shells (eg, tcsh 6.12 has
  321. # a 30-char variable name limit, and GNUSTEP_SYSTEM_DOCUMENTATION_MAN
  322. # is 32 chars), so we replaced them with the shorter variant. For
  323. # consistency, we'd like the shorter variant to be used everywhere,
  324. # both in shell and make code.
  325. #
  326. # But for backwards compatibility, you can still use the long name
  327. # variants in makefiles though ... we'll keep this backwards
  328. # compatibility hack in place for about 4 years from now, so until
  329. # Feb 2011.
  330. #
  331. ifeq ($(GNUSTEP_MAKE_STRICT_V2_MODE),yes)
  332. # FIXME - these would be nice but needs careful testing
  333. # GNUSTEP_DOCUMENTATION = $(error GNUSTEP_DOCUMENTATION is deprecated)
  334. # GNUSTEP_DOCUMENTATION_MAN = $(error GNUSTEP_DOCUMENTATION_MAN is deprecated)
  335. # GNUSTEP_DOCUMENTATION_INFO = $(error GNUSTEP_DOCUMENTATION_INF is deprecated)
  336. else
  337. GNUSTEP_DOCUMENTATION = $(GNUSTEP_DOC)
  338. GNUSTEP_DOCUMENTATION_MAN = $(GNUSTEP_DOC_MAN)
  339. GNUSTEP_DOCUMENTATION_INFO = $(GNUSTEP_DOC_INFO)
  340. endif
  341.  
  342. #
  343. # INSTALL_ROOT_DIR is the obsolete way of relocating stuff. It used
  344. # to only affect stuff that is not installed using
  345. # GNUSTEP_INSTALLATION_DIR (DESTDIR instead also affects stuff
  346. # installed using GNUSTEP_INSTALLATION_DIR). We prefer DESTDIR
  347. # because it is a widely accepted GNU standard, and makes packaging
  348. # easier.
  349. #
  350. # So all instances of INSTALL_ROOT_DIR in user's makefiles should be
  351. # replaced with DESTDIR.
  352. #
  353. # Anyway, until all makefiles have been updated, we set INSTALL_ROOT_DIR for backwards
  354. # compatibility.
  355. #
  356. ifeq ($(GNUSTEP_MAKE_STRICT_V2_MODE),yes)
  357. ifneq ($(INSTALL_ROOT_DIR),)
  358. $(error INSTALL_ROOT_DIR is deprecated in gnustep-make v2, please replace any instance of INSTALL_ROOT_DIR with DESTDIR)
  359. endif
  360. endif
  361.  
  362. ifneq ($(DESTDIR),)
  363. ifeq ($(INSTALL_ROOT_DIR),)
  364. INSTALL_ROOT_DIR = $(DESTDIR)
  365. endif
  366. endif
  367.  
  368. ifeq ($(GNUSTEP_MAKE_STRICT_V2_MODE),yes)
  369. # FIXME: Test that using 'error' here works reliably.
  370. # INSTALL_ROOT_DIR += $(error INSTALL_ROOT_DIR is deprecated, please replace any instance of INSTALL_ROOT_DIR with DESTDIR)
  371. INSTALL_ROOT_DIR += $(warning INSTALL_ROOT_DIR is deprecated, please replace any instance of INSTALL_ROOT_DIR with DESTDIR)
  372. else
  373. INSTALL_ROOT_DIR += $(warning INSTALL_ROOT_DIR is deprecated, please replace any instance of INSTALL_ROOT_DIR with DESTDIR)
  374. endif
  375.  
  376. # The default name of the makefile to be used in recursive invocations of make
  377. ifeq ($(MAKEFILE_NAME),)
  378. MAKEFILE_NAME = GNUmakefile
  379. endif
  380.  
  381. # Now prepare the library and header flags - we first prepare the list
  382. # of directories (trying to avoid duplicates in the list), then
  383. # optionally remove the empty ones, then prepend -I / -L to them.
  384. ifeq ($(GNUSTEP_IS_FLATTENED), no)
  385.  
  386. # The following variables have to be evaluated after setting domain to
  387. # something, such as USER. When you evaluate them in that situation,
  388. # they will generate paths according to the following definition.
  389. # Later, we'll systematically replace domain with USER, the LOCAL,
  390. # then NETWORK, then SYSTEM.
  391. GS_HEADER_PATH = \
  392. $(GNUSTEP_$(domain)_HEADERS)/$(LIBRARY_COMBO)/$(GNUSTEP_TARGET_DIR) \
  393. $(GNUSTEP_$(domain)_HEADERS)/$(LIBRARY_COMBO) \
  394. $(GNUSTEP_$(domain)_HEADERS)
  395.  
  396. GS_LIBRARY_PATH = \
  397. $(GNUSTEP_$(domain)_LIBRARIES)/$(GNUSTEP_TARGET_LDIR) \
  398. $(GNUSTEP_$(domain)_LIBRARIES)/$(GNUSTEP_TARGET_DIR)
  399.  
  400. else
  401.  
  402. # In the flattened case, the paths to generate are considerably simpler.
  403.  
  404. GS_HEADER_PATH = $(GNUSTEP_$(domain)_HEADERS)
  405. GS_LIBRARY_PATH = $(GNUSTEP_$(domain)_LIBRARIES)
  406.  
  407. endif
  408.  
  409. ifeq ($(FOUNDATION_LIB), apple)
  410. GS_FRAMEWORK_PATH = $(GNUSTEP_$(domain)_FRAMEWORKS)
  411. else
  412. GS_FRAMEWORK_PATH =
  413. endif
  414.  
  415. # First, we add paths based in the USER domain.
  416.  
  417. # Don't add GNUSTEP_USER_ROOT paths if being built by dpkg-buildpackage
  418. ifndef DEB_BUILD_ARCH
  419.  
  420. # Please note that the following causes GS_HEADER_PATH to be evaluated
  421. # with the variable domain equal to USER, which gives the effect we
  422. # wanted.
  423. GNUSTEP_HEADERS_DIRS = $(foreach domain,USER,$(GS_HEADER_PATH))
  424. GNUSTEP_LIBRARIES_DIRS = $(foreach domain,USER,$(GS_LIBRARY_PATH))
  425. GNUSTEP_FRAMEWORKS_DIRS = $(foreach domain,USER,$(GS_FRAMEWORK_PATH))
  426.  
  427. endif
  428.  
  429. # Second, if LOCAL flags are different from USER flags (which have
  430. # already been added), we add the LOCAL flags too.
  431. ifneq ($(GNUSTEP_LOCAL_HEADERS), $(GNUSTEP_USER_HEADERS))
  432. GNUSTEP_HEADERS_DIRS += $(foreach domain,LOCAL,$(GS_HEADER_PATH))
  433. endif
  434.  
  435. ifneq ($(GNUSTEP_LOCAL_LIBRARIES), $(GNUSTEP_USER_LIBRARIES))
  436. GNUSTEP_LIBRARIES_DIRS += $(foreach domain,LOCAL,$(GS_LIBRARY_PATH))
  437. endif
  438.  
  439. ifneq ($(GNUSTEP_LOCAL_FRAMEWORKS), $(GNUSTEP_USER_FRAMEWORKS))
  440. GNUSTEP_FRAMEWORKS_DIRS += $(foreach domain,LOCAL,$(GS_FRAMEWORK_PATH))
  441. endif
  442.  
  443. # Third, if NETWORK flags are different from USER and LOCAL flags (which
  444. # have already been added), we add those too.
  445. ifneq ($(GNUSTEP_NETWORK_HEADERS), $(GNUSTEP_USER_HEADERS))
  446. ifneq ($(GNUSTEP_NETWORK_HEADERS), $(GNUSTEP_LOCAL_HEADERS))
  447. GNUSTEP_HEADERS_DIRS += $(foreach domain,NETWORK,$(GS_HEADER_PATH))
  448. endif
  449. endif
  450.  
  451. ifneq ($(GNUSTEP_NETWORK_LIBRARIES), $(GNUSTEP_USER_LIBRARIES))
  452. ifneq ($(GNUSTEP_NETWORK_LIBRARIES), $(GNUSTEP_LOCAL_LIBRARIES))
  453. GNUSTEP_LIBRARIES_DIRS += $(foreach domain,NETWORK,$(GS_LIBRARY_PATH))
  454. endif
  455. endif
  456.  
  457. ifneq ($(GNUSTEP_NETWORK_FRAMEWORKS), $(GNUSTEP_USER_FRAMEWORKS))
  458. ifneq ($(GNUSTEP_NETWORK_FRAMEWORKS), $(GNUSTEP_LOCAL_FRAMEWORKS))
  459. GNUSTEP_FRAMEWORKS_DIRS += $(foreach domain,NETWORK,$(GS_FRAMEWORK_PATH))
  460. endif
  461. endif
  462.  
  463. # Last, if SYSTEM flags are different from USER, LOCAL and NETWORK
  464. # flags (which have already been added), we add the ones based on
  465. # SYSTEM too.
  466. ifneq ($(GNUSTEP_SYSTEM_HEADERS), $(GNUSTEP_USER_HEADERS))
  467. ifneq ($(GNUSTEP_SYSTEM_HEADERS), $(GNUSTEP_LOCAL_HEADERS))
  468. ifneq ($(GNUSTEP_SYSTEM_HEADERS), $(GNUSTEP_NETWORK_HEADERS))
  469. GNUSTEP_HEADERS_DIRS += $(foreach domain,SYSTEM,$(GS_HEADER_PATH))
  470. endif
  471. endif
  472. endif
  473.  
  474. ifneq ($(GNUSTEP_SYSTEM_LIBRARIES), $(GNUSTEP_USER_LIBRARIES))
  475. ifneq ($(GNUSTEP_SYSTEM_LIBRARIES), $(GNUSTEP_LOCAL_LIBRARIES))
  476. ifneq ($(GNUSTEP_SYSTEM_LIBRARIES), $(GNUSTEP_NETWORK_LIBRARIES))
  477. GNUSTEP_LIBRARIES_DIRS += $(foreach domain,SYSTEM,$(GS_LIBRARY_PATH))
  478. endif
  479. endif
  480. endif
  481.  
  482. ifneq ($(GNUSTEP_SYSTEM_FRAMEWORKS), $(GNUSTEP_USER_FRAMEWORKS))
  483. ifneq ($(GNUSTEP_SYSTEM_FRAMEWORKS), $(GNUSTEP_LOCAL_FRAMEWORKS))
  484. ifneq ($(GNUSTEP_SYSTEM_FRAMEWORKS), $(GNUSTEP_NETWORK_FRAMEWORKS))
  485. GNUSTEP_FRAMEWORKS_DIRS += $(foreach domain,SYSTEM,$(GS_FRAMEWORK_PATH))
  486. endif
  487. endif
  488. endif
  489.  
  490. ifeq ($(REMOVE_EMPTY_DIRS),yes)
  491. # This variable, when evaluated, gives $(dir) if dir is non-empty, and
  492. # nothing if dir is empty.
  493. remove_if_empty = $(dir $(word 1,$(wildcard $(dir)/*)))
  494.  
  495. # Build the GNUSTEP_HEADER_FLAGS by removing the empty dirs from
  496. # GNUSTEP_HEADER_DIRS, then prepending -I to each of them
  497. #
  498. # Important - because this variable is defined with = and not :=, it
  499. # is only evaluated when it is used. Which is good - it means we don't
  500. # scan the directories and try to remove the empty one on each make
  501. # invocation (eg, on 'make clean') - we only scan the dirs when we are using
  502. # GNUSTEP_HEADERS_FLAGS to compile. Please make sure to keep this
  503. # behaviour otherwise scanning the directories each time a makefile is
  504. # read might slow down the package unnecessarily for operations like
  505. # make clean, make distclean etc.
  506. #
  507. # Doing this filtering still gives a 5% to 10% slowdown in compilation times
  508. # due to directory scanning, which is why is normally turned off by
  509. # default - by default we put all directories in compilation commands.
  510. GNUSTEP_HEADERS_FLAGS = \
  511. $(addprefix -I,$(foreach dir,$(GNUSTEP_HEADERS_DIRS),$(remove_if_empty)))
  512. GNUSTEP_LIBRARIES_FLAGS = \
  513. $(addprefix -L,$(foreach dir,$(GNUSTEP_LIBRARIES_DIRS),$(remove_if_empty)))
  514. GNUSTEP_FRAMEWORKS_FLAGS = \
  515. $(addprefix -F,$(foreach dir,$(GNUSTEP_FRAMEWORKS_DIRS),$(remove_if_empty)))
  516. else
  517. # Default case, just add -I / -L
  518. GNUSTEP_HEADERS_FLAGS = $(addprefix -I,$(GNUSTEP_HEADERS_DIRS))
  519. GNUSTEP_LIBRARIES_FLAGS = $(addprefix -L,$(GNUSTEP_LIBRARIES_DIRS))
  520. GNUSTEP_FRAMEWORKS_FLAGS = $(addprefix -F,$(GNUSTEP_FRAMEWORKS_DIRS))
  521. endif
  522.  
  523. ifeq ($(FOUNDATION_LIB), fd)
  524.  
  525. # Map OBJC_RUNTIME_LIB values to OBJC_RUNTIME values as used by
  526. # libFoundation. TODO/FIXME: Drop all this stuff and have
  527. # libFoundation use OBJC_RUNTIME_LIB directly.
  528.  
  529. # TODO: Remove all this cruft. Standardize.
  530. ifeq ($(OBJC_RUNTIME_LIB), nx)
  531. OBJC_RUNTIME = NeXT
  532. endif
  533. ifeq ($(OBJC_RUNTIME_LIB), sun)
  534. OBJC_RUNTIME = Sun
  535. endif
  536. ifeq ($(OBJC_RUNTIME_LIB), apple)
  537. OBJC_RUNTIME = apple
  538. endif
  539. ifeq ($(OBJC_RUNTIME_LIB), gnu)
  540. OBJC_RUNTIME = GNU
  541. endif
  542. ifeq ($(OBJC_RUNTIME_LIB), gnugc)
  543. OBJC_RUNTIME = GNU
  544. endif
  545.  
  546. # If all of the following really needed ? If the system is not
  547. # flattened, multiple Foundation libraries are not permitted anyway,
  548. # so libFoundation could just put his headers in Foundation/. If
  549. # library combos are used, all headers are in a library-combo
  550. # directory, so libFoundation could still put his headers in
  551. # Foundation/ and no conflict should arise. As for the
  552. # GNUSTEP_TARGET_DIR, maybe we should key all of our headers in a
  553. # GNUSTEP_TARGET_LDIR directory (rather than just a LIBRARY_COMBO
  554. # directory). But does it really matter in practice anyway ?
  555. ifeq ($(GNUSTEP_IS_FLATTENED),yes)
  556. GNUSTEP_HEADERS_FND_DIRS = \
  557. $(GNUSTEP_USER_HEADERS)/libFoundation \
  558. $(GNUSTEP_LOCAL_HEADERS)/libFoundation \
  559. $(GNUSTEP_NETWORK_HEADERS)/libFoundation \
  560. $(GNUSTEP_SYSTEM_HEADERS)/libFoundation \
  561. $(GNUSTEP_USER_HEADERS)/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
  562. $(GNUSTEP_LOCAL_HEADERS)/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
  563. $(GNUSTEP_NETWORK_HEADERS)/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
  564. $(GNUSTEP_SYSTEM_HEADERS)/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME)
  565. else
  566. GNUSTEP_HEADERS_FND_DIRS = \
  567. $(GNUSTEP_USER_HEADERS)/$(LIBRARY_COMBO)/libFoundation \
  568. $(GNUSTEP_LOCAL_HEADERS)/$(LIBRARY_COMBO)/libFoundation \
  569. $(GNUSTEP_NETWORK_HEADERS)/$(LIBRARY_COMBO)/libFoundation \
  570. $(GNUSTEP_SYSTEM_HEADERS)/$(LIBRARY_COMBO)/libFoundation \
  571. $(GNUSTEP_USER_HEADERS)/$(LIBRARY_COMBO)/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
  572. $(GNUSTEP_LOCAL_HEADERS)/$(LIBRARY_COMBO)/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
  573. $(GNUSTEP_NETWORK_HEADERS)/$(LIBRARY_COMBO)/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
  574. $(GNUSTEP_SYSTEM_HEADERS)/$(LIBRARY_COMBO)/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME)
  575. endif
  576.  
  577. ifeq ($(REMOVE_EMPTY_DIRS), yes)
  578. # Build the GNUSTEP_HEADERS_FND_FLAG by removing the empty dirs
  579. # from GNUSTEP_HEADERS_FND_DIRS, then prepending -I to each of them
  580. GNUSTEP_HEADERS_FND_FLAG = \
  581. $(addprefix -I,$(foreach dir,$(GNUSTEP_HEADERS_FND_DIRS),$(remove_if_empty)))
  582. else
  583. # default case - simply prepend -I
  584. GNUSTEP_HEADERS_FND_FLAG = $(addprefix -I,$(GNUSTEP_HEADERS_FND_DIRS))
  585. endif
  586.  
  587. # Just add the result of all this to the standard header flags.
  588. GNUSTEP_HEADERS_FLAGS += $(GNUSTEP_HEADERS_FND_FLAG)
  589.  
  590. endif
  591.  
  592.  
  593. #
  594. # Overridable compilation flags
  595. #
  596. # FIXME: We use -fno-strict-aliasing to prevent annoying gcc3.3
  597. # compiler warnings. But we really need to investigate why the
  598. # warning appear in the first place, if they are serious or not, and
  599. # what can be done about it.
  600. INTERNAL_OBJCFLAGS = -fno-strict-aliasing
  601.  
  602. CFLAGS =
  603.  
  604. # If the compiler supports native ObjC exceptions and the user wants us to
  605. # use them, turn them on!
  606. ifeq ($(USE_OBJC_EXCEPTIONS), yes)
  607. INTERNAL_OBJCFLAGS += -fexceptions -fobjc-exceptions -D_NATIVE_OBJC_EXCEPTIONS
  608. INTERNAL_LDFLAGS += -shared-libgcc -fexceptions
  609. endif
  610.  
  611. # If the compiler supports nonfragile ABI and the user wants us to
  612. # use them, turn them on!
  613. ifeq ($(USE_NONFRAGILE_ABI), yes)
  614. INTERNAL_OBJCFLAGS += -fobjc-nonfragile-abi -D_NONFRAGILE_ABI
  615. INTERNAL_LDFLAGS += -fobjc-nonfragile-abi
  616. endif
  617.  
  618. # If we are using garbage collection we set a define to say so.
  619. ifeq ($(OBJC_WITH_GC), yes)
  620. INTERNAL_OBJCFLAGS += -DGS_WITH_GC=1
  621. endif
  622.  
  623. #
  624. # Now decide whether to build shared objects or not. Nothing depending
  625. # on the value of the shared variable is allowed before this point!
  626. #
  627.  
  628. #
  629. # Fixup bundles to be always built as shared even when shared=no is given
  630. #
  631. ifeq ($(shared), no)
  632. ifeq ($(GNUSTEP_TYPE), bundle)
  633. $(warning "Static bundles are meaningless! I am using shared=yes!")
  634. override shared = yes
  635. export shared
  636. endif
  637. ifeq ($(GNUSTEP_TYPE), framework)
  638. $(warning "Static frameworks are meaningless! I am using shared=yes!")
  639. override shared = yes
  640. export shared
  641. endif
  642. endif
  643.  
  644. # Enable building shared libraries by default. If the user wants to build a
  645. # static library, he/she has to specify shared=no explicitly.
  646. ifeq ($(HAVE_SHARED_LIBS), yes)
  647. # Unless shared=no has been purposedly set ...
  648. ifneq ($(shared), no)
  649. # ... set shared = yes
  650. shared = yes
  651. endif
  652. endif
  653.  
  654. ifeq ($(shared), yes)
  655. LIB_LINK_CMD = $(SHARED_LIB_LINK_CMD)
  656. INTERNAL_OBJCFLAGS += $(SHARED_CFLAGS)
  657. INTERNAL_CFLAGS += $(SHARED_CFLAGS)
  658. AFTER_INSTALL_LIBRARY_CMD = $(AFTER_INSTALL_SHARED_LIB_CMD)
  659. else
  660. LIB_LINK_CMD = $(STATIC_LIB_LINK_CMD)
  661. AFTER_INSTALL_LIBRARY_CMD = $(AFTER_INSTALL_STATIC_LIB_CMD)
  662. endif
  663.  
  664. ifeq ($(profile), yes)
  665. ADDITIONAL_FLAGS += -pg
  666. ifeq ($(LD), $(CC))
  667. INTERNAL_LDFLAGS += -pg
  668. endif
  669. endif
  670.  
  671. # The default set of compilation flags are set in config.make in the
  672. # OPTFLAG variable. They should default to -g -O2. These should be
  673. # an "average" set of flags, midway between debugging and performance;
  674. # they are used, unchanged, when we build with debug=no (the default
  675. # unless --enable-debug-by-default was used when configuring
  676. # gnustep-make). Using the set of GCC flags -g -O2 as default is
  677. # recommended by the GNU Coding Standards and is common practice. If
  678. # you specify debug=yes, you want to do a debug build, so we remove
  679. # the optimization flag that makes it harder to debug. If you specify
  680. # strip=yes, you do not want debugging symbols, so we strip all
  681. # executables before installing them. This gives you three main
  682. # options to use in a default setup:
  683. #
  684. # make (some optimization, and some debugging symbols are used)
  685. # make debug=yes (removes optimization flags)
  686. # make strip=yes (removes debugging symbols)
  687. #
  688.  
  689. # By default we build using debug=no (unless --enable-debug-by-default
  690. # was specified when configuring gnustep-make) - so that the default
  691. # compilation flags should be -g -O2. This is according to the GNU
  692. # Coding Standards.
  693. ifeq ($(debug),)
  694. debug = $(GNUSTEP_DEFAULT_DEBUG)
  695. endif
  696.  
  697. ifeq ($(debug), yes)
  698. # Optimization flags are filtered out as they make debugging harder.
  699. OPTFLAG := $(filter-out -O%, $(OPTFLAG))
  700. # If OPTFLAG does not already include -g, add it here.
  701. ifneq ($(filter -g, $(OPTFLAG)), -g)
  702. ADDITIONAL_FLAGS += -g
  703. endif
  704. # Add standard debug compiler flags.
  705. ADDITIONAL_FLAGS += -DDEBUG -fno-omit-frame-pointer
  706.  
  707. # The following is for Java.
  708. INTERNAL_JAVACFLAGS += -g
  709. else
  710. # The default OPTFLAG set in config.make are used to compile.
  711.  
  712. # The following is for Java.
  713. INTERNAL_JAVACFLAGS += -O
  714. endif
  715.  
  716. ifeq ($(warn), no)
  717. ADDITIONAL_FLAGS += -UGSWARN
  718. else
  719. ADDITIONAL_FLAGS += -Wall -DGSWARN
  720. INTERNAL_JAVACFLAGS += -deprecation
  721. endif
  722.  
  723. ifeq ($(diagnose), no)
  724. ADDITIONAL_FLAGS += -UGSDIAGNOSE
  725. else
  726. ADDITIONAL_FLAGS += -DGSDIAGNOSE
  727. endif
  728.  
  729. # The use of #import is no longer deprecated in gcc, and is supposed
  730. # to be recommended from now on ... so we disable the warnings for
  731. # older compilers.
  732. ADDITIONAL_FLAGS += -Wno-import
  733.  
  734. AUXILIARY_CPPFLAGS += $(GNUSTEP_DEFINE) \
  735. $(FND_DEFINE) $(GUI_DEFINE) $(BACKEND_DEFINE) \
  736. $(RUNTIME_DEFINE) $(FOUNDATION_LIBRARY_DEFINE)
  737.  
  738. INTERNAL_OBJCFLAGS += $(ADDITIONAL_FLAGS) $(OPTFLAG) $(OBJCFLAGS) \
  739. $(RUNTIME_FLAG)
  740. INTERNAL_CFLAGS += $(ADDITIONAL_FLAGS) $(OPTFLAG)
  741.  
  742. #
  743. # Support building of Multiple Architecture Binaries (MAB). The object files
  744. # directory will be something like obj/ix86_m68k_sun/
  745. #
  746. ifeq ($(arch),)
  747. ARCH_OBJ_DIR = $(GNUSTEP_TARGET_DIR)
  748. else
  749. ARCH_OBJ_DIR = \
  750. $(shell echo $(CLEANED_ARCH) | sed -e 's/ /_/g')/$(GNUSTEP_TARGET_OS)
  751. endif
  752.  
  753. ifeq ($(GNUSTEP_IS_FLATTENED), no)
  754. GNUSTEP_OBJ_DIR_NAME = obj/$(ARCH_OBJ_DIR)/$(LIBRARY_COMBO)
  755. else
  756. GNUSTEP_OBJ_DIR_NAME = obj
  757. endif
  758.  
  759. GNUSTEP_OBJ_DIR = $(GNUSTEP_BUILD_DIR)/$(GNUSTEP_OBJ_DIR_NAME)
  760.  
  761. ifneq ($(GNUSTEP_INSTANCE),)
  762. GNUSTEP_OBJ_INSTANCE_DIR_NAME = $(GNUSTEP_OBJ_DIR_NAME)/$(GNUSTEP_INSTANCE).obj
  763. GNUSTEP_OBJ_INSTANCE_DIR = $(GNUSTEP_BUILD_DIR)/$(GNUSTEP_OBJ_INSTANCE_DIR_NAME)
  764. else
  765. GNUSTEP_OBJ_INSTANCE_DIR_NAME = $(warn "Makefile bug ... GNUSTEP_OBJ_INSTANCE_DIR_NAME used in Master invocation!")
  766. GNUSTEP_OBJ_INSTANCE_DIR = $(warn "Makefile bug ... GNUSTEP_OBJ_INSTANCE_DIR used in Master invocation!")
  767. endif
  768.  
  769. #
  770. # Common variables for subprojects
  771. #
  772. SUBPROJECT_PRODUCT = subproject$(OEXT)
  773.  
  774. #
  775. # Set JAVA_HOME if not set.
  776. #
  777. ifeq ($(JAVA_HOME),)
  778. # Else, try JDK_HOME
  779. ifeq ($(JDK_HOME),)
  780. # Else, try by finding the path of javac and removing 'bin/javac' from it.
  781. # Please note that this is really inefficient, you should rather
  782. # set JAVA_HOME!
  783. ifeq ($(JAVAC),)
  784. JAVA_HOME = $(shell which javac | sed "s/bin\/javac//g")
  785. else # $(JAVAC) != ""
  786. JAVA_HOME = $(shell which $(JAVAC) | sed "s/bin\/javac//g")
  787. endif
  788. else # $(JDK_HOME) != ""
  789. JAVA_HOME = $(JDK_HOME)
  790. endif
  791. endif
  792.  
  793. #
  794. # The java compiler.
  795. #
  796. ifeq ($(JAVAC),)
  797. JAVAC = $(JAVA_HOME)/bin/javac
  798. endif
  799.  
  800. #
  801. # The java header compiler.
  802. #
  803. ifeq ($(JAVAH),)
  804. JAVAH = $(JAVA_HOME)/bin/javah
  805. endif
  806.  
  807. #
  808. # Common variables - default values
  809. #
  810. # Because this file is included at the beginning of the user's
  811. # GNUmakefile, the user can override these variables by setting them
  812. # in the GNUmakefile.
  813. BUNDLE_EXTENSION = .bundle
  814. APP_EXTENSION = app
  815.  
  816. # We want total control over GNUSTEP_INSTANCE.
  817. # GNUSTEP_INSTANCE determines wheter it's a Master or an Instance
  818. # invocation. Whenever we run a submake, we want it to be a Master
  819. # invocation, unless we specifically set it to run as an Instance
  820. # invocation by adding the GNUSTEP_INSTANCE=xxx flag. Tell make not
  821. # to mess with our games by passing this variable to submakes himself
  822. unexport GNUSTEP_INSTANCE
  823. unexport GNUSTEP_TYPE
  824.  
  825. #
  826. # Sanity checks - only performed at the first make invocation
  827. #
  828.  
  829. # Please note that _GNUSTEP_TOP_INVOCATION_DONE is set by the first
  830. # time Master/rules.make is read, and propagated to sub-makes. So
  831. # this check will pass only the very first time we parse this file,
  832. # and if Master/rules.make have not yet been parsed.
  833. ifeq ($(_GNUSTEP_TOP_INVOCATION_DONE),)
  834.  
  835. # Print out a message with our version number and how to get help on
  836. # targets and options. We use $(notdir $(MAKE)) to print the command
  837. # that was used to invoke us; this is usually 'make' but it often is
  838. # 'gmake' on *BSD systems.
  839. ifeq ($(MAKE_WITH_INFO_FUNCTION),yes)
  840. # Use 'make quiet=yes' to disable the message
  841. ifneq ($(quiet),yes)
  842. $(info This is gnustep-make $(GNUSTEP_MAKE_VERSION). Type '$(notdir $(MAKE)) print-gnustep-make-help' for help.)
  843. ifeq ($(GNUSTEP_MAKE_STRICT_V2_MODE),yes)
  844. $(info Running in gnustep-make version 2 strict mode.)
  845. endif
  846. endif
  847. endif
  848.  
  849. # Sanity check on $PATH - NB: if PATH is wrong, we can't do certain
  850. # things because we can't run the tools (and we can't locate tools
  851. # using opentool because we can't even run opentool if PATH is wrong)
  852. # - this is particularly bad for gui stuff
  853.  
  854. # Skip the check if we are on an Apple system. I was told that you can't
  855. # source GNUstep.sh before running Apple's PB and that the only
  856. # friendly solution is to disable the check.
  857. ifneq ($(FOUNDATION_LIB), apple)
  858. # Under Win32 paths are so confused this warning is not worthwhile
  859. ifneq ($(findstring mingw, $(GNUSTEP_HOST_OS)), mingw)
  860.  
  861. ifeq ($(findstring $(GNUSTEP_SYSTEM_TOOLS),$(PATH)),)
  862. $(warning WARNING: Your PATH may not be set up correctly !)
  863. $(warning Please try again after adding "$(GNUSTEP_SYSTEM_TOOLS)" to your path)
  864. endif
  865.  
  866. endif
  867. endif # code used when FOUNDATION_LIB != apple
  868.  
  869. endif # End of sanity checks run only at makelevel 0
  870.  
  871. endif # COMMON_MAKE_LOADED
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement