4 # Set all of the common environment variables.
6 # Copyright (C) 1997, 2001 Free Software Foundation, Inc.
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>
12 # This file is part of the GNUstep Makefile Package.
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 2
17 # of the License, or (at your option) any later version.
19 # You should have received a copy of the GNU General Public
20 # License along with this library; see the file COPYING.LIB.
21 # If not, write to the Free Software Foundation,
22 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 ifeq ($(COMMON_MAKE_LOADED),)
25 COMMON_MAKE_LOADED = yes
30 # Determine the compilation host and target
32 include $(GNUSTEP_MAKEFILES)/names.make
34 ifeq ($(GNUSTEP_FLATTENED),)
35 GNUSTEP_HOST_DIR = $(GNUSTEP_HOST_CPU)/$(GNUSTEP_HOST_OS)
36 GNUSTEP_TARGET_DIR = $(GNUSTEP_TARGET_CPU)/$(GNUSTEP_TARGET_OS)
37 GNUSTEP_HOST_LDIR = $(GNUSTEP_HOST_DIR)/$(LIBRARY_COMBO)
38 GNUSTEP_TARGET_LDIR = $(GNUSTEP_TARGET_DIR)/$(LIBRARY_COMBO)
41 GNUSTEP_TARGET_DIR = .
43 GNUSTEP_TARGET_LDIR = .
47 # Get the config information (host/target specific),
48 # this includes GNUSTEP_SYSTEM_ROOT etc.
50 include $(GNUSTEP_MAKEFILES)/$(GNUSTEP_TARGET_LDIR)/config.make
52 # GNUSTEP_BASE_INSTALL by default is `' - this is correct
54 # GNUSTEP_BUILD_DIR is the directory in which anything generated
55 # during the build will be placed. '.' means it's the same as the
56 # source directory; this case is the default/common and we optimize
57 # for it whenever possible.
58 ifeq ($(GNUSTEP_BUILD_DIR),)
63 # Scripts to run for parsing canonical names
65 CONFIG_GUESS_SCRIPT = $(GNUSTEP_MAKEFILES)/config.guess
66 CONFIG_SUB_SCRIPT = $(GNUSTEP_MAKEFILES)/config.sub
67 CONFIG_CPU_SCRIPT = $(GNUSTEP_MAKEFILES)/cpu.sh
68 CONFIG_VENDOR_SCRIPT = $(GNUSTEP_MAKEFILES)/vendor.sh
69 CONFIG_OS_SCRIPT = $(GNUSTEP_MAKEFILES)/os.sh
70 CLEAN_CPU_SCRIPT = $(GNUSTEP_MAKEFILES)/clean_cpu.sh
71 CLEAN_VENDOR_SCRIPT = $(GNUSTEP_MAKEFILES)/clean_vendor.sh
72 CLEAN_OS_SCRIPT = $(GNUSTEP_MAKEFILES)/clean_os.sh
73 ifeq ($(GNUSTEP_FLATTENED),)
75 = $(GNUSTEP_MAKEFILES)/$(GNUSTEP_HOST_CPU)/$(GNUSTEP_HOST_OS)/which_lib
77 WHICH_LIB_SCRIPT = $(GNUSTEP_MAKEFILES)/which_lib
79 LD_LIB_PATH_SCRIPT = $(GNUSTEP_MAKEFILES)/ld_lib_path.sh
80 TRANSFORM_PATHS_SCRIPT = $(GNUSTEP_MAKEFILES)/transform_paths.sh
81 REL_PATH_SCRIPT = $(GNUSTEP_MAKEFILES)/relative_path.sh
83 # Take the makefiles from the system root
84 ifeq ($(GNUSTEP_MAKEFILES),)
85 GNUSTEP_MAKEFILES = $(GNUSTEP_SYSTEM_ROOT)/Library/Makefiles
89 # Sanity checks - only performed at the first make invocation
91 # FIXME - these checks should probably be removed and/or rewritten.
94 # Please note that _GNUSTEP_TOP_INVOCATION_DONE is set by the first
95 # time Master/rules.make is read, and propagated to sub-makes. So
96 # this check will pass only the very first time we parse this file,
97 # and if Master/rules.make have not yet been parsed.
98 ifeq ($(_GNUSTEP_TOP_INVOCATION_DONE),)
100 # Sanity check on $PATH - NB: if PATH is wrong, we can't do certain things
101 # because we can't run the tools (not even using opentool as we can't even
102 # run opentool if PATH is wrong) - this is particularly bad for gui stuff
104 # Skip the check if we are on an Apple system. I was told that you can't
105 # source GNUstep.sh before running Apple's PB and that the only
106 # friendly solution is to disable the check.
107 ifneq ($(FOUNDATION_LIB), apple)
109 # NB - we can't trust PATH here because it's what we are trying to
110 # check ... but hopefully if we (common.make) have been found, we
111 # can trust that at least $(GNUSTEP_MAKEFILES) is set up correctly :-)
113 # We want to check that this path is in the PATH
114 SYS_TOOLS_PATH = $(GNUSTEP_SYSTEM_ROOT)/Tools
116 # But on cygwin we might need to first fix it up ...
117 ifeq ($(findstring cygwin, $(GNUSTEP_HOST_OS)), cygwin)
118 ifeq ($(shell echo "$(SYS_TOOLS_PATH)" | sed 's/^\([a-zA-Z]:.*\)//'),)
119 SYS_TOOLS_PATH := $(shell $(GNUSTEP_MAKEFILES)/fixpath.sh -u $(SYS_TOOLS_PATH))
123 # Under mingw paths are so confused this warning is not worthwhile
124 ifneq ($(findstring mingw, $(GNUSTEP_HOST_OS)), mingw)
125 ifeq ($(findstring $(SYS_TOOLS_PATH),$(PATH)),)
126 $(warning WARNING: Your PATH may not be set up correctly !)
127 $(warning Please try again after running ". $(GNUSTEP_MAKEFILES)/GNUstep.sh")
131 endif # code used when FOUNDATION_LIB != apple
133 endif # End of sanity checks run only at makelevel 0
136 # Get standard messages
138 include $(GNUSTEP_MAKEFILES)/messages.make
141 # Get flags/config options for core libraries
144 # First, work out precisely library combos etc
145 include $(GNUSTEP_MAKEFILES)/library-combo.make
146 # Then include custom makefiles with flags/config options
147 # This is meant to be used by the core libraries to override loading
148 # of the system makefiles from $(GNUSTEP_MAKEFILES)/Additional/*.make
149 # with their local copy (presumably more up-to-date)
150 ifneq ($(GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES),)
151 include $(GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES)
153 # Then include makefiles with flags/config options installed by the
154 # libraries themselves
155 -include $(GNUSTEP_MAKEFILES)/Additional/*.make
158 # Determine target specific settings
160 include $(GNUSTEP_MAKEFILES)/target.make
163 # GNUSTEP_INSTALLATION_DIR is the directory where all the things go. If you
164 # don't specify it defaults to GNUSTEP_LOCAL_ROOT.
166 ifeq ($(GNUSTEP_INSTALLATION_DIR),)
167 GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_LOCAL_ROOT)
170 # Make it public and available to all submakes invocations
171 export GNUSTEP_INSTALLATION_DIR
174 # Variables specifying the installation directory paths
176 GNUSTEP_APPS = $(GNUSTEP_INSTALLATION_DIR)/Applications
177 GNUSTEP_TOOLS = $(GNUSTEP_INSTALLATION_DIR)/Tools
178 GNUSTEP_LIBRARY = $(GNUSTEP_INSTALLATION_DIR)/Library
179 GNUSTEP_SERVICES = $(GNUSTEP_LIBRARY)/Services
180 ifeq ($(GNUSTEP_FLATTENED),yes)
181 GNUSTEP_HEADERS = $(GNUSTEP_INSTALLATION_DIR)/Library/Headers
183 GNUSTEP_HEADERS = $(GNUSTEP_INSTALLATION_DIR)/Library/Headers/$(LIBRARY_COMBO)
185 GNUSTEP_APPLICATION_SUPPORT = $(GNUSTEP_LIBRARY)/ApplicationSupport
186 GNUSTEP_BUNDLES = $(GNUSTEP_LIBRARY)/Bundles
187 GNUSTEP_FRAMEWORKS = $(GNUSTEP_LIBRARY)/Frameworks
188 GNUSTEP_PALETTES = $(GNUSTEP_LIBRARY)/ApplicationSupport/Palettes
189 GNUSTEP_LIBRARIES = $(GNUSTEP_INSTALLATION_DIR)/Library/Libraries
190 GNUSTEP_RESOURCES = $(GNUSTEP_LIBRARY)/Libraries/Resources
191 GNUSTEP_JAVA = $(GNUSTEP_LIBRARY)/Libraries/Java
192 GNUSTEP_DOCUMENTATION = $(GNUSTEP_LIBRARY)/Documentation
193 GNUSTEP_DOCUMENTATION_MAN = $(GNUSTEP_DOCUMENTATION)/man
194 GNUSTEP_DOCUMENTATION_INFO = $(GNUSTEP_DOCUMENTATION)/info
196 # The default name of the makefile to be used in recursive invocations of make
197 ifeq ($(MAKEFILE_NAME),)
198 MAKEFILE_NAME = GNUmakefile
201 # Now prepare the library and header flags - we first prepare the list
202 # of directories (trying to avoid duplicates in the list), then
203 # optionally remove the empty ones, then prepend -I / -L to them.
204 ifeq ($(GNUSTEP_FLATTENED),)
206 # The following variables have to be evaluated after setting dir to
207 # something, such as GNUSTEP_USER_ROOT. When you evaluate them in
208 # that situation, they will generate paths according to the following
209 # definition. Later, we'll systematically replace dir with
210 # GNUSTEP_USER_ROOT, the GNUSTEP_LOCAL_ROOT, then
211 # GNUSTEP_NETWORK_ROOT, then GNUSTEP_SYSTEM_ROOT.
213 $(dir)/Library/Headers/$(LIBRARY_COMBO)/$(GNUSTEP_TARGET_DIR) \
214 $(dir)/Library/Headers/$(LIBRARY_COMBO)
217 $(dir)/Library/Libraries/$(GNUSTEP_TARGET_LDIR) \
218 $(dir)/Library/Libraries/$(GNUSTEP_TARGET_DIR)
222 # In the flattened case, the paths to generate are considerably simpler.
224 GS_HEADER_PATH = $(dir)/Library/Headers
225 GS_LIBRARY_PATH = $(dir)/Library/Libraries
229 ifeq ($(FOUNDATION_LIB), apple)
230 GS_FRAMEWORK_PATH = $(dir)/Library/Frameworks
235 # First, we add paths based on GNUSTEP_USER_ROOT.
237 # Please note that the following causes GS_HEADER_PATH to be evaluated
238 # with the variable dir equal $(GNUSTEP_USER_ROOT), which gives the
240 GNUSTEP_HEADERS_DIRS = $(foreach dir,$(GNUSTEP_USER_ROOT),$(GS_HEADER_PATH))
241 GNUSTEP_LIBRARIES_DIRS = $(foreach dir,$(GNUSTEP_USER_ROOT),$(GS_LIBRARY_PATH))
242 GNUSTEP_FRAMEWORKS_DIRS = $(foreach dir,$(GNUSTEP_USER_ROOT),$(GS_FRAMEWORK_PATH))
244 # Second, if GNUSTEP_LOCAL_ROOT is different from GNUSTEP_USER_ROOT
245 # (which has already been added), we add the paths based on
246 # GNUSTEP_LOCAL_ROOT too.
247 ifneq ($(GNUSTEP_LOCAL_ROOT), $(GNUSTEP_USER_ROOT))
248 GNUSTEP_HEADERS_DIRS += $(foreach dir,$(GNUSTEP_LOCAL_ROOT),$(GS_HEADER_PATH))
249 GNUSTEP_LIBRARIES_DIRS += $(foreach dir,$(GNUSTEP_LOCAL_ROOT),$(GS_LIBRARY_PATH))
250 GNUSTEP_FRAMEWORKS_DIRS += $(foreach dir,$(GNUSTEP_LOCAL_ROOT),$(GS_FRAMEWORK_PATH))
253 # Third, if GNUSTEP_NETWORK_ROOT is different from GNUSTEP_USER_ROOT and
254 # GNUSTEP_LOCAL_ROOT (which have already been added), we add the paths
255 # based on GNUSTEP_NETWORK_ROOT too.
256 ifneq ($(GNUSTEP_NETWORK_ROOT), $(GNUSTEP_USER_ROOT))
257 ifneq ($(GNUSTEP_NETWORK_ROOT), $(GNUSTEP_LOCAL_ROOT))
258 GNUSTEP_HEADERS_DIRS += $(foreach dir,$(GNUSTEP_NETWORK_ROOT),$(GS_HEADER_PATH))
259 GNUSTEP_LIBRARIES_DIRS += $(foreach dir,$(GNUSTEP_NETWORK_ROOT),$(GS_LIBRARY_PATH))
260 GNUSTEP_FRAMEWORKS_DIRS += $(foreach dir,$(GNUSTEP_NETWORK_ROOT),$(GS_FRAMEWORK_PATH))
264 # Last, if GNUSTEP_SYSTEM_ROOT is different from GNUSTEP_USER_ROOT,
265 # GNUSTEP_LOCAL_ROOT and GNUSTEP_NETWORK_ROOT (which have already been
266 # added), we add the pathe paths based on GNUSTEP_SYSTEM_ROOT too.
267 ifneq ($(GNUSTEP_SYSTEM_ROOT), $(GNUSTEP_USER_ROOT))
268 ifneq ($(GNUSTEP_SYSTEM_ROOT), $(GNUSTEP_LOCAL_ROOT))
269 ifneq ($(GNUSTEP_SYSTEM_ROOT), $(GNUSTEP_NETWORK_ROOT))
270 GNUSTEP_HEADERS_DIRS += $(foreach dir,$(GNUSTEP_SYSTEM_ROOT),$(GS_HEADER_PATH))
271 GNUSTEP_LIBRARIES_DIRS += $(foreach dir,$(GNUSTEP_SYSTEM_ROOT),$(GS_LIBRARY_PATH))
272 GNUSTEP_FRAMEWORKS_DIRS += $(foreach dir,$(GNUSTEP_SYSTEM_ROOT),$(GS_FRAMEWORK_PATH))
277 ifeq ($(REMOVE_EMPTY_DIRS),yes)
278 # This variable, when evaluated, gives $(dir) if dir is non-empty, and
279 # nothing if dir is empty.
280 remove_if_empty = $(dir $(word 1,$(wildcard $(dir)/*)))
282 # Build the GNUSTEP_HEADER_FLAGS by removing the empty dirs from
283 # GNUSTEP_HEADER_DIRS, then prepending -I to each of them
285 # Important - because this variable is defined with = and not :=, it
286 # is only evaluated when it is used. Which is good - it means we don't
287 # scan the directories and try to remove the empty one on each make
288 # invocation (eg, on 'make clean') - we only scan the dirs when we are using
289 # GNUSTEP_HEADERS_FLAGS to compile. Please make sure to keep this
290 # behaviour otherwise scanning the directories each time a makefile is
291 # read might slow down the package unnecessarily for operations like
292 # make clean, make distclean etc.
294 # Doing this filtering still gives a 5% to 10% slowdown in compilation times
295 # due to directory scanning, which is why is normally turned off by
296 # default - by default we put all directories in compilation commands.
297 GNUSTEP_HEADERS_FLAGS = \
298 $(addprefix -I,$(foreach dir,$(GNUSTEP_HEADERS_DIRS),$(remove_if_empty)))
299 GNUSTEP_LIBRARIES_FLAGS = \
300 $(addprefix -L,$(foreach dir,$(GNUSTEP_LIBRARIES_DIRS),$(remove_if_empty)))
301 GNUSTEP_FRAMEWORKS_FLAGS = \
302 $(addprefix -F,$(foreach dir,$(GNUSTEP_FRAMEWORKS_DIRS),$(remove_if_empty)))
304 # Default case, just add -I / -L
305 GNUSTEP_HEADERS_FLAGS = $(addprefix -I,$(GNUSTEP_HEADERS_DIRS))
306 GNUSTEP_LIBRARIES_FLAGS = $(addprefix -L,$(GNUSTEP_LIBRARIES_DIRS))
307 GNUSTEP_FRAMEWORKS_FLAGS = $(addprefix -F,$(GNUSTEP_FRAMEWORKS_DIRS))
310 ifeq ($(FOUNDATION_LIB), fd)
312 # Map OBJC_RUNTIME_LIB values to OBJC_RUNTIME values as used by
313 # libFoundation. TODO/FIXME: Drop all this stuff and have
314 # libFoundation use OBJC_RUNTIME_LIB directly.
316 # TODO: Remove all this cruft. Standardize.
317 ifeq ($(OBJC_RUNTIME_LIB), nx)
320 ifeq ($(OBJC_RUNTIME_LIB), sun)
323 ifeq ($(OBJC_RUNTIME_LIB), apple)
326 ifeq ($(OBJC_RUNTIME_LIB), gnu)
329 ifeq ($(OBJC_RUNTIME_LIB), gnugc)
333 # If all of the following really needed ? If the system is not
334 # flattened, multiple Foundation libraries are not permitted anyway,
335 # so libFoundation could just put his headers in Foundation/. If
336 # library combos are used, all headers are in a library-combo
337 # directory, so libFoundation could still put his headers in
338 # Foundation/ and no conflict should arise. As for the
339 # GNUSTEP_TARGET_DIR, maybe we should key all of our headers in a
340 # GNUSTEP_TARGET_LDIR directory (rather than just a LIBRARY_COMBO
341 # directory). But does it really matter in practice anyway ?
342 ifeq ($(GNUSTEP_FLATTENED),yes)
343 GNUSTEP_HEADERS_FND_DIRS = \
344 $(GNUSTEP_USER_ROOT)/Library/Headers/libFoundation \
345 $(GNUSTEP_LOCAL_ROOT)/Library/Headers/libFoundation \
346 $(GNUSTEP_NETWORK_ROOT)/Library/Headers/libFoundation \
347 $(GNUSTEP_SYSTEM_ROOT)/Library/Headers/libFoundation \
348 $(GNUSTEP_USER_ROOT)/Library/Headers/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
349 $(GNUSTEP_LOCAL_ROOT)/Library/Headers/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
350 $(GNUSTEP_NETWORK_ROOT)/Library/Headers/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
351 $(GNUSTEP_SYSTEM_ROOT)/Library/Headers/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME)
353 GNUSTEP_HEADERS_FND_DIRS = \
354 $(GNUSTEP_USER_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation \
355 $(GNUSTEP_LOCAL_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation \
356 $(GNUSTEP_NETWORK_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation \
357 $(GNUSTEP_SYSTEM_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation \
358 $(GNUSTEP_USER_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
359 $(GNUSTEP_LOCAL_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
360 $(GNUSTEP_NETWORK_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
361 $(GNUSTEP_SYSTEM_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME)
364 ifeq ($(REMOVE_EMPTY_DIRS), yes)
365 # Build the GNUSTEP_HEADERS_FND_FLAG by removing the empty dirs
366 # from GNUSTEP_HEADERS_FND_DIRS, then prepending -I to each of them
367 GNUSTEP_HEADERS_FND_FLAG = \
368 $(addprefix -I,$(foreach dir,$(GNUSTEP_HEADERS_FND_DIRS),$(remove_if_empty)))
370 # default case - simply prepend -I
371 GNUSTEP_HEADERS_FND_FLAG = $(addprefix -I,$(GNUSTEP_HEADERS_FND_DIRS))
374 # Just add the result of all this to the standard header flags.
375 GNUSTEP_HEADERS_FLAGS += $(GNUSTEP_HEADERS_FND_FLAG)
381 # Overridable compilation flags
383 # FIXME: We use -fno-strict-aliasing to prevent annoying gcc3.3
384 # compiler warnings. But we really need to investigate why the
385 # warning appear in the first place, if they are serious or not, and
386 # what can be done about it.
387 OBJCFLAGS = -fno-strict-aliasing
391 # If the compiler supports native ObjC exceptions and the user wants us to
392 # use them, turn them on!
393 ifeq ($(USE_OBJC_EXCEPTIONS), yes)
394 OBJCFLAGS += -fobjc-exceptions -D_NATIVE_OBJC_EXCEPTIONS
398 # Now decide whether to build shared objects or not. Nothing depending
399 # on the value of the shared variable is allowed before this point!
403 # Fixup bundles to be always built as shared even when shared=no is given
406 ifeq ($(GNUSTEP_TYPE), bundle)
407 $(warning "Static bundles are meaningless! I am using shared=yes!")
408 override shared = yes
411 ifeq ($(GNUSTEP_TYPE), framework)
412 $(warning "Static frameworks are meaningless! I am using shared=yes!")
413 override shared = yes
418 # Enable building shared libraries by default. If the user wants to build a
419 # static library, he/she has to specify shared=no explicitly.
420 ifeq ($(HAVE_SHARED_LIBS), yes)
421 # Unless shared=no has been purposedly set ...
422 ifneq ($(shared), no)
423 # ... set shared = yes
428 ifeq ($(shared), yes)
429 LIB_LINK_CMD = $(SHARED_LIB_LINK_CMD)
430 OBJ_DIR_PREFIX += shared_
431 INTERNAL_OBJCFLAGS += $(SHARED_CFLAGS)
432 INTERNAL_CFLAGS += $(SHARED_CFLAGS)
433 AFTER_INSTALL_LIBRARY_CMD = $(AFTER_INSTALL_SHARED_LIB_CMD)
435 LIB_LINK_CMD = $(STATIC_LIB_LINK_CMD)
436 OBJ_DIR_PREFIX += static_
437 AFTER_INSTALL_LIBRARY_CMD = $(AFTER_INSTALL_STATIC_LIB_CMD)
438 LIBRARY_NAME_SUFFIX := s$(LIBRARY_NAME_SUFFIX)
441 ifeq ($(profile), yes)
442 ADDITIONAL_FLAGS += -pg
444 INTERNAL_LDFLAGS += -pg
446 OBJ_DIR_PREFIX += profile_
447 LIBRARY_NAME_SUFFIX := p$(LIBRARY_NAME_SUFFIX)
451 OPTFLAG := $(filter-out -O%, $(OPTFLAG))
452 ADDITIONAL_FLAGS += -g -Wall -DDEBUG -fno-omit-frame-pointer
453 INTERNAL_JAVACFLAGS += -g -deprecation
454 OBJ_DIR_PREFIX += debug_
456 INTERNAL_JAVACFLAGS += -O
459 OBJ_DIR_PREFIX += obj
462 ADDITIONAL_FLAGS += -UGSWARN
464 ADDITIONAL_FLAGS += -DGSWARN
467 ifeq ($(diagnose), no)
468 ADDITIONAL_FLAGS += -UGSDIAGNOSE
470 ADDITIONAL_FLAGS += -DGSDIAGNOSE
473 ifneq ($(LIBRARY_NAME_SUFFIX),)
474 LIBRARY_NAME_SUFFIX := _$(LIBRARY_NAME_SUFFIX)
477 AUXILIARY_CPPFLAGS += $(GNUSTEP_DEFINE) \
478 $(FND_DEFINE) $(GUI_DEFINE) $(BACKEND_DEFINE) \
479 $(RUNTIME_DEFINE) $(FOUNDATION_LIBRARY_DEFINE)
481 INTERNAL_OBJCFLAGS += $(ADDITIONAL_FLAGS) $(OPTFLAG) $(OBJCFLAGS) \
483 INTERNAL_CFLAGS += $(ADDITIONAL_FLAGS) $(OPTFLAG)
485 # trick needed to replace a space with nothing
487 space:= $(empty) $(empty)
488 GNUSTEP_OBJ_PREFIX = $(subst $(space),,$(OBJ_DIR_PREFIX))
491 # Support building of Multiple Architecture Binaries (MAB). The object files
492 # directory will be something like shared_obj/ix86_m68k_sun/
495 ARCH_OBJ_DIR = $(GNUSTEP_TARGET_DIR)
498 $(shell echo $(CLEANED_ARCH) | sed -e 's/ /_/g')/$(GNUSTEP_TARGET_OS)
501 ifeq ($(GNUSTEP_FLATTENED),)
502 GNUSTEP_OBJ_DIR_NAME = $(GNUSTEP_OBJ_PREFIX)/$(ARCH_OBJ_DIR)/$(LIBRARY_COMBO)
504 GNUSTEP_OBJ_DIR_NAME = $(GNUSTEP_OBJ_PREFIX)
507 GNUSTEP_OBJ_DIR = $(GNUSTEP_BUILD_DIR)/$(GNUSTEP_OBJ_DIR_NAME)
510 # Common variables for subprojects
512 SUBPROJECT_PRODUCT = subproject$(OEXT)
515 # Set JAVA_HOME if not set.
520 # Else, try by finding the path of javac and removing 'bin/javac' from it
522 JAVA_HOME = $(shell which javac | sed "s/bin\/javac//g")
523 else # $(JAVAC) != ""
524 JAVA_HOME = $(shell which $(JAVAC) | sed "s/bin\/javac//g")
526 else # $(JDK_HOME) != ""
527 JAVA_HOME = $(JDK_HOME)
535 JAVAC = $(JAVA_HOME)/bin/javac
539 # The java header compiler.
542 JAVAH = $(JAVA_HOME)/bin/javah
546 # Some GCJ Java Options
549 INTERNAL_AOT_JAVAFLAGS += -fjni -findirect-dispatch
551 ifeq ($(shared), yes)
552 INTERNAL_AOT_JAVAFLAGS += $(SHARED_CFLAGS)
555 INTERNAL_AOT_JAVAFLAGS += $(ADDITIONAL_FLAGS) $(OPTFLAG)
558 # Common variables - default values
560 # Because this file is included at the beginning of the user's
561 # GNUmakefile, the user can override these variables by setting them
562 # in the GNUmakefile.
563 BUNDLE_EXTENSION = .bundle
564 ifeq ($(profile), yes)
565 APP_EXTENSION = profile
568 APP_EXTENSION = debug
576 # We want total control over GNUSTEP_INSTANCE.
577 # GNUSTEP_INSTANCE determines wheter it's a Master or an Instance
578 # invocation. Whenever we run a submake, we want it to be a Master
579 # invocation, unless we specifically set it to run as an Instance
580 # invocation by adding the GNUSTEP_INSTANCE=xxx flag. Tell make not
581 # to mess with our games by passing this variable to submakes himself
582 unexport GNUSTEP_INSTANCE
583 unexport GNUSTEP_TYPE
585 endif # COMMON_MAKE_LOADED