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 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 ifeq ($(COMMON_MAKE_LOADED),)
25 COMMON_MAKE_LOADED = yes
29 # GNUSTEP_BASE_INSTALL by default is `' - this is correct
31 # GNUSTEP_BUILD_DIR is the directory in which anything generated
32 # during the build will be placed. '.' means it's the same as the
33 # source directory; this case is the default/common and we optimize
34 # for it whenever possible.
35 ifeq ($(GNUSTEP_BUILD_DIR),)
40 # Scripts to run for parsing canonical names
42 CONFIG_GUESS_SCRIPT = $(GNUSTEP_MAKEFILES)/config.guess
43 CONFIG_SUB_SCRIPT = $(GNUSTEP_MAKEFILES)/config.sub
44 CONFIG_CPU_SCRIPT = $(GNUSTEP_MAKEFILES)/cpu.sh
45 CONFIG_VENDOR_SCRIPT = $(GNUSTEP_MAKEFILES)/vendor.sh
46 CONFIG_OS_SCRIPT = $(GNUSTEP_MAKEFILES)/os.sh
47 CLEAN_CPU_SCRIPT = $(GNUSTEP_MAKEFILES)/clean_cpu.sh
48 CLEAN_VENDOR_SCRIPT = $(GNUSTEP_MAKEFILES)/clean_vendor.sh
49 CLEAN_OS_SCRIPT = $(GNUSTEP_MAKEFILES)/clean_os.sh
50 ifeq ($(GNUSTEP_FLATTENED),)
52 = $(GNUSTEP_MAKEFILES)/$(GNUSTEP_HOST_CPU)/$(GNUSTEP_HOST_OS)/which_lib
54 WHICH_LIB_SCRIPT = $(GNUSTEP_MAKEFILES)/which_lib
56 LD_LIB_PATH_SCRIPT = $(GNUSTEP_MAKEFILES)/ld_lib_path.sh
57 TRANSFORM_PATHS_SCRIPT = $(GNUSTEP_MAKEFILES)/transform_paths.sh
58 REL_PATH_SCRIPT = $(GNUSTEP_MAKEFILES)/relative_path.sh
60 # Take the makefiles from the system root
61 ifeq ($(GNUSTEP_MAKEFILES),)
62 GNUSTEP_MAKEFILES = $(GNUSTEP_SYSTEM_ROOT)/Library/Makefiles
66 # Determine the compilation host and target
68 include $(GNUSTEP_MAKEFILES)/names.make
70 ifeq ($(GNUSTEP_FLATTENED),)
71 GNUSTEP_HOST_DIR = $(GNUSTEP_HOST_CPU)/$(GNUSTEP_HOST_OS)
72 GNUSTEP_TARGET_DIR = $(GNUSTEP_TARGET_CPU)/$(GNUSTEP_TARGET_OS)
73 GNUSTEP_HOST_LDIR = $(GNUSTEP_HOST_DIR)/$(LIBRARY_COMBO)
74 GNUSTEP_TARGET_LDIR = $(GNUSTEP_TARGET_DIR)/$(LIBRARY_COMBO)
77 GNUSTEP_TARGET_DIR = .
79 GNUSTEP_TARGET_LDIR = .
83 # Get the config information
85 include $(GNUSTEP_MAKEFILES)/$(GNUSTEP_TARGET_DIR)/config.make
88 # Sanity checks - only performed at the first make invocation
92 # Sanity check on GNUSTEP_*_ROOT. We want them all to be non-empty.
95 ifeq ($(GNUSTEP_USER_ROOT),)
96 GNUSTEP_ERROR=GNUSTEP_USER_ROOT
98 ifeq ($(GNUSTEP_LOCAL_ROOT),)
99 GNUSTEP_ERROR=GNUSTEP_LOCAL_ROOT
101 ifeq ($(GNUSTEP_NETWORK_ROOT),)
102 GNUSTEP_ERROR=GNUSTEP_NETWORK_ROOT
104 ifeq ($(GNUSTEP_SYSTEM_ROOT),)
105 GNUSTEP_ERROR=GNUSTEP_SYSTEM_ROOT
108 ifneq ($(GNUSTEP_ERROR),)
109 $(warning ERROR: Your $(GNUSTEP_ERROR) environment variable is empty !)
110 $(error Please try again after running ". $(GNUSTEP_MAKEFILES)/GNUstep.sh")
113 # Sanity check on $PATH - NB: if PATH is wrong, we can't do certain things
114 # because we can't run the tools (not even using opentool as we can't even
115 # run opentool if PATH is wrong) - this is particularly bad for gui stuff
117 # Skip the check if we are on an Apple system. I was told that you can't
118 # source GNUstep.sh before running Apple's PB and that the only
119 # friendly solution is to disable the check.
120 ifneq ($(FOUNDATION_LIB), apple)
122 # NB - we can't trust PATH here because it's what we are trying to
123 # check ... but hopefully if we (common.make) have been found, we
124 # can trust that at least $(GNUSTEP_MAKEFILES) is set up correctly :-)
126 # We want to check that this path is in the PATH
127 SYS_TOOLS_PATH = $(GNUSTEP_SYSTEM_ROOT)/Tools
129 # But on cygwin we might need to first fix it up ...
130 ifeq ($(findstring cygwin, $(GNUSTEP_HOST_OS)), cygwin)
131 ifeq ($(shell echo "$(SYS_TOOLS_PATH)" | sed 's/^\([a-zA-Z]:.*\)//'),)
132 SYS_TOOLS_PATH := $(shell $(GNUSTEP_MAKEFILES)/fixpath.sh -u $(SYS_TOOLS_PATH))
136 # Under mingw paths are so confused this warning is not worthwhile
137 ifneq ($(findstring mingw, $(GNUSTEP_HOST_OS)), mingw)
138 ifeq ($(findstring $(SYS_TOOLS_PATH),$(PATH)),)
139 $(warning WARNING: Your PATH may not be set up correctly !)
140 $(warning Please try again after running ". $(GNUSTEP_MAKEFILES)/GNUstep.sh")
144 endif # code used when FOUNDATION_LIB != apple
146 endif # End of sanity checks run only at makelevel 0
149 # Get standard messages
151 include $(GNUSTEP_MAKEFILES)/messages.make
154 # Get flags/config options for core libraries
157 # First, work out precisely library combos etc
158 include $(GNUSTEP_MAKEFILES)/library-combo.make
159 # Then include custom makefiles with flags/config options
160 # This is meant to be used by the core libraries to override loading
161 # of the system makefiles from $(GNUSTEP_MAKEFILES)/Additional/*.make
162 # with their local copy (presumably more up-to-date)
163 ifneq ($(GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES),)
164 include $(GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES)
166 # Then include makefiles with flags/config options installed by the
167 # libraries themselves
168 -include $(GNUSTEP_MAKEFILES)/Additional/*.make
171 # Determine target specific settings
173 include $(GNUSTEP_MAKEFILES)/target.make
176 # GNUSTEP_INSTALLATION_DIR is the directory where all the things go. If you
177 # don't specify it defaults to GNUSTEP_LOCAL_ROOT.
179 ifeq ($(GNUSTEP_INSTALLATION_DIR),)
180 GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_LOCAL_ROOT)
183 # Make it public and available to all submakes invocations
184 export GNUSTEP_INSTALLATION_DIR
187 # Variables specifying the installation directory paths
189 GNUSTEP_APPS = $(GNUSTEP_INSTALLATION_DIR)/Applications
190 GNUSTEP_TOOLS = $(GNUSTEP_INSTALLATION_DIR)/Tools
191 GNUSTEP_LIBRARY = $(GNUSTEP_INSTALLATION_DIR)/Library
192 GNUSTEP_SERVICES = $(GNUSTEP_LIBRARY)/Services
193 ifeq ($(GNUSTEP_FLATTENED),yes)
194 GNUSTEP_HEADERS = $(GNUSTEP_INSTALLATION_DIR)/Library/Headers
196 GNUSTEP_HEADERS = $(GNUSTEP_INSTALLATION_DIR)/Library/Headers/$(LIBRARY_COMBO)
198 GNUSTEP_APPLICATION_SUPPORT = $(GNUSTEP_LIBRARY)/ApplicationSupport
199 GNUSTEP_BUNDLES = $(GNUSTEP_LIBRARY)/Bundles
200 GNUSTEP_FRAMEWORKS = $(GNUSTEP_LIBRARY)/Frameworks
201 GNUSTEP_PALETTES = $(GNUSTEP_LIBRARY)/ApplicationSupport/Palettes
202 GNUSTEP_LIBRARIES = $(GNUSTEP_INSTALLATION_DIR)/Library/Libraries
203 GNUSTEP_RESOURCES = $(GNUSTEP_LIBRARY)/Libraries/Resources
204 GNUSTEP_JAVA = $(GNUSTEP_LIBRARY)/Libraries/Java
205 GNUSTEP_DOCUMENTATION = $(GNUSTEP_LIBRARY)/Documentation
206 GNUSTEP_DOCUMENTATION_MAN = $(GNUSTEP_DOCUMENTATION)/man
207 GNUSTEP_DOCUMENTATION_INFO = $(GNUSTEP_DOCUMENTATION)/info
209 # The default name of the makefile to be used in recursive invocations of make
210 ifeq ($(MAKEFILE_NAME),)
211 MAKEFILE_NAME = GNUmakefile
214 # Now prepare the library and header flags - we first prepare the list
215 # of directories (trying to avoid duplicates in the list), then
216 # optionally remove the empty ones, then prepend -I / -L to them.
217 ifeq ($(GNUSTEP_FLATTENED),)
219 # The following variables have to be evaluated after setting dir to
220 # something, such as GNUSTEP_USER_ROOT. When you evaluate them in
221 # that situation, they will generate paths according to the following
222 # definition. Later, we'll systematically replace dir with
223 # GNUSTEP_USER_ROOT, the GNUSTEP_LOCAL_ROOT, then
224 # GNUSTEP_NETWORK_ROOT, then GNUSTEP_SYSTEM_ROOT.
226 $(dir)/Library/Headers/$(LIBRARY_COMBO)/$(GNUSTEP_TARGET_DIR) \
227 $(dir)/Library/Headers/$(LIBRARY_COMBO)
230 $(dir)/Library/Libraries/$(GNUSTEP_TARGET_LDIR) \
231 $(dir)/Library/Libraries/$(GNUSTEP_TARGET_DIR)
235 # In the flattened case, the paths to generate are considerably simpler.
237 GS_HEADER_PATH = $(dir)/Library/Headers
238 GS_LIBRARY_PATH = $(dir)/Library/Libraries
242 ifeq ($(FOUNDATION_LIB), apple)
243 GS_FRAMEWORK_PATH = $(dir)/Library/Frameworks
248 # First, we add paths based on GNUSTEP_USER_ROOT.
250 # Please note that the following causes GS_HEADER_PATH to be evaluated
251 # with the variable dir equal $(GNUSTEP_USER_ROOT), which gives the
253 GNUSTEP_HEADERS_DIRS = $(foreach dir,$(GNUSTEP_USER_ROOT),$(GS_HEADER_PATH))
254 GNUSTEP_LIBRARIES_DIRS = $(foreach dir,$(GNUSTEP_USER_ROOT),$(GS_LIBRARY_PATH))
255 GNUSTEP_FRAMEWORKS_DIRS = $(foreach dir,$(GNUSTEP_USER_ROOT),$(GS_FRAMEWORK_PATH))
257 # Second, if GNUSTEP_LOCAL_ROOT is different from GNUSTEP_USER_ROOT
258 # (which has already been added), we add the paths based on
259 # GNUSTEP_LOCAL_ROOT too.
260 ifneq ($(GNUSTEP_LOCAL_ROOT), $(GNUSTEP_USER_ROOT))
261 GNUSTEP_HEADERS_DIRS += $(foreach dir,$(GNUSTEP_LOCAL_ROOT),$(GS_HEADER_PATH))
262 GNUSTEP_LIBRARIES_DIRS += $(foreach dir,$(GNUSTEP_LOCAL_ROOT),$(GS_LIBRARY_PATH))
263 GNUSTEP_FRAMEWORKS_DIRS += $(foreach dir,$(GNUSTEP_LOCAL_ROOT),$(GS_FRAMEWORK_PATH))
266 # Third, if GNUSTEP_NETWORK_ROOT is different from GNUSTEP_USER_ROOT and
267 # GNUSTEP_LOCAL_ROOT (which have already been added), we add the paths
268 # based on GNUSTEP_NETWORK_ROOT too.
269 ifneq ($(GNUSTEP_NETWORK_ROOT), $(GNUSTEP_USER_ROOT))
270 ifneq ($(GNUSTEP_NETWORK_ROOT), $(GNUSTEP_LOCAL_ROOT))
271 GNUSTEP_HEADERS_DIRS += $(foreach dir,$(GNUSTEP_NETWORK_ROOT),$(GS_HEADER_PATH))
272 GNUSTEP_LIBRARIES_DIRS += $(foreach dir,$(GNUSTEP_NETWORK_ROOT),$(GS_LIBRARY_PATH))
273 GNUSTEP_FRAMEWORKS_DIRS += $(foreach dir,$(GNUSTEP_NETWORK_ROOT),$(GS_FRAMEWORK_PATH))
277 # Last, if GNUSTEP_SYSTEM_ROOT is different from GNUSTEP_USER_ROOT,
278 # GNUSTEP_LOCAL_ROOT and GNUSTEP_NETWORK_ROOT (which have already been
279 # added), we add the pathe paths based on GNUSTEP_SYSTEM_ROOT too.
280 ifneq ($(GNUSTEP_SYSTEM_ROOT), $(GNUSTEP_USER_ROOT))
281 ifneq ($(GNUSTEP_SYSTEM_ROOT), $(GNUSTEP_LOCAL_ROOT))
282 ifneq ($(GNUSTEP_SYSTEM_ROOT), $(GNUSTEP_NETWORK_ROOT))
283 GNUSTEP_HEADERS_DIRS += $(foreach dir,$(GNUSTEP_SYSTEM_ROOT),$(GS_HEADER_PATH))
284 GNUSTEP_LIBRARIES_DIRS += $(foreach dir,$(GNUSTEP_SYSTEM_ROOT),$(GS_LIBRARY_PATH))
285 GNUSTEP_FRAMEWORKS_DIRS += $(foreach dir,$(GNUSTEP_SYSTEM_ROOT),$(GS_FRAMEWORK_PATH))
290 ifeq ($(REMOVE_EMPTY_DIRS),yes)
291 # This variable, when evaluated, gives $(dir) if dir is non-empty, and
292 # nothing if dir is empty.
293 remove_if_empty = $(dir $(word 1,$(wildcard $(dir)/*)))
295 # Build the GNUSTEP_HEADER_FLAGS by removing the empty dirs from
296 # GNUSTEP_HEADER_DIRS, then prepending -I to each of them
298 # Important - because this variable is defined with = and not :=, it
299 # is only evaluated when it is used. Which is good - it means we don't
300 # scan the directories and try to remove the empty one on each make
301 # invocation (eg, on 'make clean') - we only scan the dirs when we are using
302 # GNUSTEP_HEADERS_FLAGS to compile. Please make sure to keep this
303 # behaviour otherwise scanning the directories each time a makefile is
304 # read might slow down the package unnecessarily for operations like
305 # make clean, make distclean etc.
307 # Doing this filtering still gives a 5% to 10% slowdown in compilation times
308 # due to directory scanning, which is why is normally turned off by
309 # default - by default we put all directories in compilation commands.
310 GNUSTEP_HEADERS_FLAGS = \
311 $(addprefix -I,$(foreach dir,$(GNUSTEP_HEADERS_DIRS),$(remove_if_empty)))
312 GNUSTEP_LIBRARIES_FLAGS = \
313 $(addprefix -L,$(foreach dir,$(GNUSTEP_LIBRARIES_DIRS),$(remove_if_empty)))
314 GNUSTEP_FRAMEWORKS_FLAGS = \
315 $(addprefix -F,$(foreach dir,$(GNUSTEP_FRAMEWORKS_DIRS),$(remove_if_empty)))
317 # Default case, just add -I / -L
318 GNUSTEP_HEADERS_FLAGS = $(addprefix -I,$(GNUSTEP_HEADERS_DIRS))
319 GNUSTEP_LIBRARIES_FLAGS = $(addprefix -L,$(GNUSTEP_LIBRARIES_DIRS))
320 GNUSTEP_FRAMEWORKS_FLAGS = $(addprefix -F,$(GNUSTEP_FRAMEWORKS_DIRS))
323 ifeq ($(FOUNDATION_LIB), fd)
325 # Map OBJC_RUNTIME_LIB values to OBJC_RUNTIME values as used by
326 # libFoundation. TODO/FIXME: Drop all this stuff and have
327 # libFoundation use OBJC_RUNTIME_LIB directly.
329 # TODO: Remove all this cruft. Standardize.
330 ifeq ($(OBJC_RUNTIME_LIB), nx)
333 ifeq ($(OBJC_RUNTIME_LIB), sun)
336 ifeq ($(OBJC_RUNTIME_LIB), apple)
339 ifeq ($(OBJC_RUNTIME_LIB), gnu)
342 ifeq ($(OBJC_RUNTIME_LIB), gnugc)
346 # If all of the following really needed ? If the system is not
347 # flattened, multiple Foundation libraries are not permitted anyway,
348 # so libFoundation could just put his headers in Foundation/. If
349 # library combos are used, all headers are in a library-combo
350 # directory, so libFoundation could still put his headers in
351 # Foundation/ and no conflict should arise. As for the
352 # GNUSTEP_TARGET_DIR, maybe we should key all of our headers in a
353 # GNUSTEP_TARGET_LDIR directory (rather than just a LIBRARY_COMBO
354 # directory). But does it really matter in practice anyway ?
355 ifeq ($(GNUSTEP_FLATTENED),yes)
356 GNUSTEP_HEADERS_FND_DIRS = \
357 $(GNUSTEP_USER_ROOT)/Library/Headers/libFoundation \
358 $(GNUSTEP_LOCAL_ROOT)/Library/Headers/libFoundation \
359 $(GNUSTEP_NETWORK_ROOT)/Library/Headers/libFoundation \
360 $(GNUSTEP_SYSTEM_ROOT)/Library/Headers/libFoundation \
361 $(GNUSTEP_USER_ROOT)/Library/Headers/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
362 $(GNUSTEP_LOCAL_ROOT)/Library/Headers/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
363 $(GNUSTEP_NETWORK_ROOT)/Library/Headers/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
364 $(GNUSTEP_SYSTEM_ROOT)/Library/Headers/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME)
366 GNUSTEP_HEADERS_FND_DIRS = \
367 $(GNUSTEP_USER_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation \
368 $(GNUSTEP_LOCAL_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation \
369 $(GNUSTEP_NETWORK_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation \
370 $(GNUSTEP_SYSTEM_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation \
371 $(GNUSTEP_USER_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
372 $(GNUSTEP_LOCAL_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
373 $(GNUSTEP_NETWORK_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME) \
374 $(GNUSTEP_SYSTEM_ROOT)/Library/Headers/$(LIBRARY_COMBO)/libFoundation/$(GNUSTEP_TARGET_DIR)/$(OBJC_RUNTIME)
377 ifeq ($(REMOVE_EMPTY_DIRS), yes)
378 # Build the GNUSTEP_HEADERS_FND_FLAG by removing the empty dirs
379 # from GNUSTEP_HEADERS_FND_DIRS, then prepending -I to each of them
380 GNUSTEP_HEADERS_FND_FLAG = \
381 $(addprefix -I,$(foreach dir,$(GNUSTEP_HEADERS_FND_DIRS),$(remove_if_empty)))
383 # default case - simply prepend -I
384 GNUSTEP_HEADERS_FND_FLAG = $(addprefix -I,$(GNUSTEP_HEADERS_FND_DIRS))
387 # Just add the result of all this to the standard header flags.
388 GNUSTEP_HEADERS_FLAGS += $(GNUSTEP_HEADERS_FND_FLAG)
394 # Overridable compilation flags
396 # FIXME: We use -fno-strict-aliasing to prevent annoying gcc3.3
397 # compiler warnings. But we really need to investigate why the
398 # warning appear in the first place, if they are serious or not, and
399 # what can be done about it.
400 OBJCFLAGS = -fno-strict-aliasing
404 # If the compiler supports native ObjC exceptions and the user wants us to
405 # use them, turn them on!
406 ifeq ($(USE_OBJC_EXCEPTIONS), yes)
407 OBJCFLAGS += -fobjc-exceptions
411 # Now decide whether to build shared objects or not. Nothing depending
412 # on the value of the shared variable is allowed before this point!
416 # Fixup bundles to be always built as shared even when shared=no is given
419 ifeq ($(GNUSTEP_TYPE), bundle)
420 $(warning "Static bundles are meaningless! I am using shared=yes!")
421 override shared = yes
424 ifeq ($(GNUSTEP_TYPE), framework)
425 $(warning "Static frameworks are meaningless! I am using shared=yes!")
426 override shared = yes
431 # Enable building shared libraries by default. If the user wants to build a
432 # static library, he/she has to specify shared=no explicitly.
433 ifeq ($(HAVE_SHARED_LIBS), yes)
434 # Unless shared=no has been purposedly set ...
435 ifneq ($(shared), no)
436 # ... set shared = yes
441 ifeq ($(shared), yes)
442 LIB_LINK_CMD = $(SHARED_LIB_LINK_CMD)
443 OBJ_DIR_PREFIX += shared_
444 INTERNAL_OBJCFLAGS += $(SHARED_CFLAGS)
445 INTERNAL_CFLAGS += $(SHARED_CFLAGS)
446 AFTER_INSTALL_LIBRARY_CMD = $(AFTER_INSTALL_SHARED_LIB_CMD)
448 LIB_LINK_CMD = $(STATIC_LIB_LINK_CMD)
449 OBJ_DIR_PREFIX += static_
450 AFTER_INSTALL_LIBRARY_CMD = $(AFTER_INSTALL_STATIC_LIB_CMD)
451 LIBRARY_NAME_SUFFIX := s$(LIBRARY_NAME_SUFFIX)
454 ifeq ($(profile), yes)
455 ADDITIONAL_FLAGS += -pg
457 INTERNAL_LDFLAGS += -pg
459 OBJ_DIR_PREFIX += profile_
460 LIBRARY_NAME_SUFFIX := p$(LIBRARY_NAME_SUFFIX)
464 OPTFLAG := $(filter-out -O%, $(OPTFLAG))
465 ADDITIONAL_FLAGS += -g -Wall -DDEBUG -fno-omit-frame-pointer
466 INTERNAL_JAVACFLAGS += -g -deprecation
467 OBJ_DIR_PREFIX += debug_
468 LIBRARY_NAME_SUFFIX := d$(LIBRARY_NAME_SUFFIX)
470 INTERNAL_JAVACFLAGS += -O
473 OBJ_DIR_PREFIX += obj
476 ADDITIONAL_FLAGS += -UGSWARN
478 ADDITIONAL_FLAGS += -DGSWARN
481 ifeq ($(diagnose), no)
482 ADDITIONAL_FLAGS += -UGSDIAGNOSE
484 ADDITIONAL_FLAGS += -DGSDIAGNOSE
487 ifneq ($(LIBRARY_NAME_SUFFIX),)
488 LIBRARY_NAME_SUFFIX := _$(LIBRARY_NAME_SUFFIX)
491 AUXILIARY_CPPFLAGS += $(GNUSTEP_DEFINE) \
492 $(FND_DEFINE) $(GUI_DEFINE) $(BACKEND_DEFINE) \
493 $(RUNTIME_DEFINE) $(FOUNDATION_LIBRARY_DEFINE)
495 INTERNAL_OBJCFLAGS += $(ADDITIONAL_FLAGS) $(OPTFLAG) $(OBJCFLAGS) \
497 INTERNAL_CFLAGS += $(ADDITIONAL_FLAGS) $(OPTFLAG)
499 # trick needed to replace a space with nothing
501 space:= $(empty) $(empty)
502 GNUSTEP_OBJ_PREFIX = $(subst $(space),,$(OBJ_DIR_PREFIX))
505 # Support building of Multiple Architecture Binaries (MAB). The object files
506 # directory will be something like shared_obj/ix86_m68k_sun/
509 ARCH_OBJ_DIR = $(GNUSTEP_TARGET_DIR)
512 $(shell echo $(CLEANED_ARCH) | sed -e 's/ /_/g')/$(GNUSTEP_TARGET_OS)
515 ifeq ($(GNUSTEP_FLATTENED),)
516 GNUSTEP_OBJ_DIR_NAME = $(GNUSTEP_OBJ_PREFIX)/$(ARCH_OBJ_DIR)/$(LIBRARY_COMBO)
518 GNUSTEP_OBJ_DIR_NAME = $(GNUSTEP_OBJ_PREFIX)
521 GNUSTEP_OBJ_DIR = $(GNUSTEP_BUILD_DIR)/$(GNUSTEP_OBJ_DIR_NAME)
524 # Common variables for subprojects
526 SUBPROJECT_PRODUCT = subproject$(OEXT)
529 # Set JAVA_HOME if not set.
534 # Else, try by finding the path of javac and removing 'bin/javac' from it
536 JAVA_HOME = $(shell which javac | sed "s/bin\/javac//g")
537 else # $(JAVAC) != ""
538 JAVA_HOME = $(shell which $(JAVAC) | sed "s/bin\/javac//g")
540 else # $(JDK_HOME) != ""
541 JAVA_HOME = $(JDK_HOME)
549 JAVAC = $(JAVA_HOME)/bin/javac
553 # The java header compiler.
556 JAVAH = $(JAVA_HOME)/bin/javah
560 # Common variables - default values
562 # Because this file is included at the beginning of the user's
563 # GNUmakefile, the user can override these variables by setting them
564 # in the GNUmakefile.
565 BUNDLE_EXTENSION = .bundle
566 ifeq ($(profile), yes)
567 APP_EXTENSION = profile
570 APP_EXTENSION = debug
578 # We want total control over GNUSTEP_INSTANCE.
579 # GNUSTEP_INSTANCE determines wheter it's a Master or an Instance
580 # invocation. Whenever we run a submake, we want it to be a Master
581 # invocation, unless we specifically set it to run as an Instance
582 # invocation by adding the GNUSTEP_INSTANCE=xxx flag. Tell make not
583 # to mess with our games by passing this variable to submakes himself
584 unexport GNUSTEP_INSTANCE
585 unexport GNUSTEP_TYPE
587 endif # COMMON_MAKE_LOADED