# ============================================================== # Copyright (c) 1996-1998 Tim Barbour. # Copyright (c) 1998-1999 ACT Financial Systems Pty Ltd. # All Rights Reserved. # This make library may be used and distributed under the terms # of the GNU LGPL, as published by the Free Software Foundation. # See the file COPYING for details. # ============================================================== # $Id: defaults.mk,v 1.16 2001/12/02 07:56:50 trb Exp $ #------------------------------------------------------------------------------------------------------- # text requires: CXX_TOOL IDL_TOOL STL_TOOL TARGET_NAME LIBRARY_TYPE PROGRAM_TYPE TARGET_PLATFORMS # SOURCE_DIR vc_tool_name HDRS_TO_INSTALL IDLS_TO_INSTALL EMISSION_ROOT #------------------------------------------------------------------------------------------------------- # refers to: default_main_language default_cxx_tool_name default_idl_tool_name DEFAULT_STL_TOOL_NAME # target_root supported_os_kinds srcs_h srcs_hxx srcs_idl #------------------------------------------------------------------------------------------------------- # provides variables: main_language cxx_tool_name idl_tool_name stl_tool_name emission_root # default_library default_program target_name hdrs_to_install idls_to_install # inst_dir baseline_dir qa_dir production_dir qa_way production_way servant_suffix # inst_dir_perm inst_file_perm inst_exe_perm pass_suffix fail_suffix tmp_suffix # test_result_dir src_dir tarfile # library_type program_type target_os_kinds #------------------------------------------------------------------------------------------------------- default_inst_dir_perm = 755 default_inst_file_perm = 644 default_inst_exe_perm = 755 default_baseline_umask = 007 ifneq ($(strip $(EMISSION_BASE)),) emission_base = $(EMISSION_BASE) else emission_base = $(default_emission_base) endif # use given or default main language default_main_language = ouch_no_language ifneq ($(strip $(MAIN_LANGUAGE)),) main_language = $(MAIN_LANGUAGE) else main_language = $(default_main_language) endif # use given or default C compiler/linker ifneq ($(strip $(C_TOOL)),) c_tool_name = $(C_TOOL) else c_tool_name = $(default_c_tool_name) endif # use given or default C++ compiler/linker ifneq ($(strip $(CXX_TOOL)),) cxx_tool_name = $(CXX_TOOL) else cxx_tool_name = $(default_cxx_tool_name) endif # use given or default Haskell compiler/linker ifneq ($(strip $(HS_TOOL)),) hs_tool_name = $(HS_TOOL) else hs_tool_name = $(default_hs_tool_name) endif ifneq ($(strip $(IDL_TOOL)),) idl_tool_name = $(IDL_TOOL) else idl_tool_name = $(default_idl_tool_name) endif # use given or default C++ STL library ifneq ($(strip $(STL_TOOL)),) # strip this, in case the user included white-space; #//+ timb: saves worrying about it later - should do others the same way stl_tool_name = $(strip $(STL_TOOL)) else stl_tool_name = $(DEFAULT_STL_TOOL_NAME) endif # default library and program names default_library = $(library_prefix)$(target_name) default_program = $(target_name)$(program_ext) # default_kernel_module is defined in kernel_module_impl.mk kernel_module_license = $(firstword $(KERNEL_MODULE_LICENSE) \"GPL\") # use given target name or calculate default ifneq ($(strip $(TARGET_NAME)),) target_name = $(TARGET_NAME) else target_name0 = $(notdir $(target_root)) # need to strip the trailing slash for benefit of notdir below target_parent = $(patsubst %/,%, $(dir $(target_root))) test_parent_name = $(notdir $(target_parent)) # if the target name is 'test' we prefix it with the name of its parent target_name = $(target_name0:test=$(test_parent_name)_test) endif # default target settings default_library_type = static default_program_type = console # use given or default target settings ifneq ($(strip $(LIBRARY_TYPE)),) library_type = $(LIBRARY_TYPE) else library_type = $(default_library_type) endif ifneq ($(strip $(PROGRAM_TYPE)),) program_type = $(PROGRAM_TYPE) else program_type = $(default_program_type) endif ifneq ($(strip $(TARGET_PLATFORMS)),) target_os_kinds = $(TARGET_PLATFORMS) else target_os_kinds = $(supported_os_kinds) endif # use given or default source directory default_source_dir = src ifneq ($(strip $(SOURCE_DIR)),) src_dir = $(SOURCE_DIR) else src_dir = $(default_source_dir) endif ifneq ($(strip $(EMISSION_ROOT)),) emission_root = $(EMISSION_ROOT) else emission_root = $(HOME)/emission endif # use given Visual C++ DevStudio compatible setting or default # conditional must follow user Makefile settings (so not in windows.mk) and # precede use of vc_compatible in paths.mk and ways.mk ifeq ($(strip $(cxx_tool_name)),$(vc_tool_name)) default_vc_compatible = yes ifneq ($(strip $(VC_COMPATIBLE)),) vc_compatible = $(VC_COMPATIBLE) else vc_compatible = $(default_vc_compatible) endif endif #//+ fix these to remove language-specific distinctions between different kinds of interface files ifneq ($(strip $(HDRS_TO_INSTALL)),) hdrs_to_install = $(HDRS_TO_INSTALL) else hdrs_to_install = $(srcs_h) $(srcs_hxx) endif #//+ timb: this is not behaving properly yet ## only libraries have interfaces to install #ifneq ($(strip $(library_name)),) # ifneq ($(strip $(INTERFACES_TO_INSTALL)),) # interfaces_to_install = $(INTERFACES_TO_INSTALL) # else # interfaces_to_install = $(default_interfaces_to_install) # endif #endif ifneq ($(strip $(IDLS_TO_INSTALL)),) idls_to_install = $(IDLS_TO_INSTALL) else idls_to_install = $(srcs_idl) endif inst_dir = $(INST_DIR) # anything with this suffix is a corba object implementation ifneq ($(strip $(SERVANT_SUFFIX)),) servant_suffix = $(strip $(SERVANT_SUFFIX)) else servant_suffix = _impl endif ifneq ($(strip $(INST_DIR_PERM)),) inst_dir_perm = $(INST_DIR_PERM) else inst_dir_perm = $(default_inst_dir_perm) endif ifneq ($(strip $(INST_FILE_PERM)),) inst_file_perm = $(INST_FILE_PERM) else inst_file_perm = $(default_inst_file_perm) endif ifneq ($(strip $(INST_EXE_PERM)),) inst_exe_perm = $(INST_EXE_PERM) else inst_exe_perm = $(default_inst_exe_perm) endif ifneq ($(strip $(BASELINE_UMASK)),) baseline_umask = $(BASELINE_UMASK) else baseline_umask = $(default_baseline_umask) endif # suffixes for unit test result files pass_suffix = pass fail_suffix = fail tmp_suffix = tmp # akivaq: run automatic unit test if requested or no request and directory is "test" ifneq ($(strip $(UNIT_TEST)),) unit_test = $(UNIT_TEST) else # check if current directory is named "test" ifeq ($(shell basename `pwd`),test) unit_test = yes endif endif ifneq ($(strip $(TEST_RESULT_DIR)),) test_result_dir = $(TEST_RESULT_DIR) else test_result_dir = $(emission_base)/test_result endif # used to control whether dependency tool invocation is echoed (useful for debugging) ifeq ($(strip $(ECHO_DEP_GENERATION)),) echo_dep = @ endif # used to control whether to show C++ kernel module prelink errors (useful when errors occur in template instantiation) ifeq ($(strip $(SHOW_CXX_PRELINK_ERRORS)),) hide_cxx_template_prelink_errors = 2> /dev/null endif