gbuild: UnpackedTarball: do not rename files; set cxx suffix for library
Change-Id: I8bf119a4ab3fc7c2febfa80176358f668003b7d1
This commit is contained in:
parent
9b721623b6
commit
38cc4f7fde
7 changed files with 35 additions and 34 deletions
|
@ -63,6 +63,8 @@ $(eval $(call gb_Library_use_libraries,clucene,\
|
|||
))
|
||||
endif
|
||||
|
||||
$(eval $(call gb_Library_set_cxx_suffix,clucene,cpp))
|
||||
|
||||
$(eval $(call gb_Library_add_generated_exception_objects,clucene,\
|
||||
UnpackedTarball/clucene/src/shared/CLucene/SharedHeader \
|
||||
UnpackedTarball/clucene/src/shared/CLucene/config/gunichartables \
|
||||
|
|
|
@ -11,8 +11,6 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,clucene))
|
|||
|
||||
$(eval $(call gb_UnpackedTarball_set_tarball,clucene,$(CLUCENE_TARBALL)))
|
||||
|
||||
$(eval $(call gb_UnpackedTarball_fix_cxx_suffix,clucene,cpp))
|
||||
|
||||
ifneq ($(OS),WNT)
|
||||
$(eval $(call gb_UnpackedTarball_set_post_action,clucene,\
|
||||
mkdir -p inc/internal/CLucene/util && \
|
||||
|
|
|
@ -131,6 +131,7 @@ $(eval $(foreach method,\
|
|||
add_sdi_headers \
|
||||
add_nativeres \
|
||||
set_warnings_not_errors \
|
||||
set_cxx_suffix \
|
||||
,\
|
||||
$(call gb_Executable_forward_to_Linktarget,$(method))\
|
||||
))
|
||||
|
|
|
@ -218,6 +218,7 @@ $(eval $(foreach method,\
|
|||
export_objects_list \
|
||||
add_nativeres \
|
||||
set_warnings_not_errors \
|
||||
set_cxx_suffix \
|
||||
,\
|
||||
$(call gb_Library__forward_to_Linktarget,$(method))\
|
||||
))
|
||||
|
|
|
@ -155,9 +155,9 @@ gb_GenCObject_get_source = $(WORKDIR)/$(1).c
|
|||
# defined by platform
|
||||
# gb_CObject__command
|
||||
|
||||
$(call gb_GenCObject_get_target,%) : $(call gb_GenCObject_get_source,%)
|
||||
test -f $< || (echo "Missing generated source file $<" && false)
|
||||
$(call gb_CObject__command,$@,$*,$<,$(call gb_GenCObject_get_dep_target,$*))
|
||||
$(call gb_GenCObject_get_target,%) :
|
||||
test -f $(call gb_GenCObject_get_source,$*) || (echo "Missing generated source file $(call gb_GenCObject_get_source,$*)" && false)
|
||||
$(call gb_CObject__command,$@,$*,$(call gb_GenCObject_get_source,$*),$(call gb_GenCObject_get_dep_target,$*))
|
||||
|
||||
ifeq ($(gb_FULLDEPS),$(true))
|
||||
$(call gb_GenCObject_get_dep_target,%) :
|
||||
|
@ -169,13 +169,13 @@ endif
|
|||
|
||||
# GenCxxObject class
|
||||
|
||||
gb_GenCxxObject_get_source = $(WORKDIR)/$(1).cxx
|
||||
gb_GenCxxObject_get_source = $(WORKDIR)/$(1).$(CXX_SUFFIX)
|
||||
# defined by platform
|
||||
# gb_CxxObject__command
|
||||
|
||||
$(call gb_GenCxxObject_get_target,%) : $(call gb_GenCxxObject_get_source,%)
|
||||
test -f $< || (echo "Missing generated source file $<" && false)
|
||||
$(call gb_CxxObject__command,$@,$*,$<,$(call gb_GenCxxObject_get_dep_target,$*))
|
||||
$(call gb_GenCxxObject_get_target,%) :
|
||||
test -f $(call gb_GenCxxObject_get_source,$*) || (echo "Missing generated source file $(call gb_GenCxxObject_get_source,$*)" && false)
|
||||
$(call gb_CxxObject__command,$@,$*,$(call gb_GenCxxObject_get_source,$*),$(call gb_GenCxxObject_get_dep_target,$*))
|
||||
|
||||
ifeq ($(gb_FULLDEPS),$(true))
|
||||
$(call gb_GenCxxObject_get_dep_target,%) :
|
||||
|
@ -494,6 +494,7 @@ $(call gb_LinkTarget_get_target,$(1)) : PDBFILE :=
|
|||
$(call gb_LinkTarget_get_target,$(1)) : EXTRAOBJECTLISTS :=
|
||||
$(call gb_LinkTarget_get_target,$(1)) : NATIVERES :=
|
||||
$(call gb_LinkTarget_get_target,$(1)) : WARNINGS_NOT_ERRORS :=
|
||||
$(call gb_LinkTarget_get_target,$(1)) : $(eval CXX_SUFFIX := cxx)
|
||||
|
||||
ifeq ($(gb_FULLDEPS),$(true))
|
||||
-include $(call gb_LinkTarget_get_dep_target,$(1))
|
||||
|
@ -517,6 +518,7 @@ $(call gb_LinkTarget_get_dep_target,$(1)) : TARGETTYPE :=
|
|||
$(call gb_LinkTarget_get_dep_target,$(1)) : LIBRARY_X64 :=
|
||||
$(call gb_LinkTarget_get_dep_target,$(1)) : EXTRAOBJECTLISTS :=
|
||||
$(call gb_LinkTarget_get_dep_target,$(1)) : WARNINGS_NOT_ERRORS :=
|
||||
$(call gb_LinkTarget_get_dep_target,$(1)) : $(eval CXX_SUFFIX := cxx)
|
||||
endif
|
||||
|
||||
endef
|
||||
|
@ -851,10 +853,11 @@ define gb_LinkTarget_add_generated_c_object
|
|||
$(call gb_LinkTarget_get_target,$(1)) : GENCOBJECTS += $(2)
|
||||
$(call gb_LinkTarget_get_clean_target,$(1)) : GENCOBJECTS += $(2)
|
||||
|
||||
# Make just needs to know gb_GenCObject_get_source is a real target.
|
||||
# Then it can use implicit rule for gb_GenCObject_get_target.
|
||||
$(call gb_GenCObject_get_source,$(2)) : | $(gb_Helper_MISCDUMMY)
|
||||
$(call gb_LinkTarget_get_target,$(1)) : $(call gb_GenCObject_get_target,$(2))
|
||||
$(call gb_GenCObject_get_target,$(2)) : $(call gb_GenCObject_get_source,$(2))
|
||||
# Often gb_GenCObject_get_source does not have its own rule and is only a byproduct.
|
||||
# That's why we need this order-only dependency on gb_Helper_MISCDUMMY
|
||||
$(call gb_GenCObject_get_source,$(2)) : | $(gb_Helper_MISCDUMMY)
|
||||
$(call gb_GenCObject_get_target,$(2)) : | $(call gb_LinkTarget_get_headers_target,$(1))
|
||||
$(call gb_GenCObject_get_target,$(2)) : T_CFLAGS += $(call gb_LinkTarget__get_cflags,$(4)) $(3)
|
||||
$(call gb_GenCObject_get_target,$(2)) : \
|
||||
|
@ -871,10 +874,11 @@ define gb_LinkTarget_add_generated_cxx_object
|
|||
$(call gb_LinkTarget_get_target,$(1)) : GENCXXOBJECTS += $(2)
|
||||
$(call gb_LinkTarget_get_clean_target,$(1)) : GENCXXOBJECTS += $(2)
|
||||
|
||||
# Make just needs to know gb_GenCxxObject_get_source is a real target.
|
||||
# Then it can use implicit rule for gb_GenCxxObject_get_target.
|
||||
$(call gb_GenCxxObject_get_source,$(2)) : | $(gb_Helper_MISCDUMMY)
|
||||
$(call gb_LinkTarget_get_target,$(1)) : $(call gb_GenCxxObject_get_target,$(2))
|
||||
$(call gb_GenCxxObject_get_target,$(2)) : $(call gb_GenCxxObject_get_source,$(2))
|
||||
# Often gb_GenCxxObject_get_source does not have its own rule and is only a byproduct.
|
||||
# That's why we need this order-only dependency on gb_Helper_MISCDUMMY
|
||||
$(call gb_GenCxxObject_get_source,$(2)) : | $(gb_Helper_MISCDUMMY)
|
||||
$(call gb_GenCxxObject_get_target,$(2)) : | $(call gb_LinkTarget_get_headers_target,$(1))
|
||||
$(call gb_GenCxxObject_get_target,$(2)) : T_CXXFLAGS += $(3)
|
||||
$(call gb_GenCxxObject_get_target,$(2)) : \
|
||||
|
@ -1120,4 +1124,17 @@ endif
|
|||
|
||||
endef
|
||||
|
||||
# Set suffix of C++ files, if different from 'cxx'
|
||||
#
|
||||
# This is useful for external libraries.
|
||||
#
|
||||
# gb_LinkTarget_set_cxx_suffix linktarget used-suffix
|
||||
define gb_LinkTarget_set_cxx_suffix
|
||||
$(call gb_LinkTarget_get_target,$(1)) : $(eval CXX_SUFFIX := $(2))
|
||||
ifeq ($(gb_FULLDEPS),$(true))
|
||||
$(call gb_LinkTarget_get_dep_target,$(1)) : $(eval CXX_SUFFIX := $(2))
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
# vim: set noet sw=4:
|
||||
|
|
|
@ -127,6 +127,7 @@ $(eval $(foreach method,\
|
|||
use_unpacked \
|
||||
add_sdi_headers \
|
||||
set_warnings_not_errors \
|
||||
set_cxx_suffix \
|
||||
,\
|
||||
$(call gb_StaticLibrary_forward_to_Linktarget,$(method))\
|
||||
))
|
||||
|
|
|
@ -132,11 +132,6 @@ $(call gb_Helper_abbreviate_dirs,\
|
|||
done && \
|
||||
) \
|
||||
$(if $(UNPACKED_FIX_EOL),$(gb_UnpackedTarball_CONVERTCOMMAND) dos $(UNPACKED_FIX_EOL) &&) \
|
||||
$(if $(UNPACKED_CXX_SUFFIX),\
|
||||
for c in `find $(3) -type f -name "*.$(UNPACKED_CXX_SUFFIX)"`; do \
|
||||
mv "$$c" "$${c%.$(UNPACKED_CXX_SUFFIX)}.cxx" || exit 1;\
|
||||
done && \
|
||||
) \
|
||||
$(if $(UNPACKED_FILES),\
|
||||
mkdir -p $(sort $(dir $(UNPACKED_DESTFILES))) && \
|
||||
$(call gb_UnpackedTarball__copy_files,$(UNPACKED_FILES),$(UNPACKED_DESTFILES)) && \
|
||||
|
@ -174,7 +169,6 @@ endef
|
|||
|
||||
# Initialize unpacked tarball
|
||||
define gb_UnpackedTarball_UnpackedTarball_internal
|
||||
$(call gb_UnpackedTarball_get_target,$(1)) : UNPACKED_CXX_SUFFIX :=
|
||||
$(call gb_UnpackedTarball_get_target,$(1)) : UNPACKED_DESTFILES :=
|
||||
$(call gb_UnpackedTarball_get_target,$(1)) : UNPACKED_FILES :=
|
||||
$(call gb_UnpackedTarball_get_target,$(1)) : UNPACKED_FIX_EOL :=
|
||||
|
@ -209,19 +203,6 @@ $(call gb_UnpackedTarball_get_target,$(1)) : UNPACKED_FIX_EOL += $(addprefix $(c
|
|||
|
||||
endef
|
||||
|
||||
# Set suffix of C++ files, if different from 'cxx'
|
||||
#
|
||||
# All files with that extension will be renamed to .cxx . This is because
|
||||
# LinkTarget requires .cxx extension for C++ files.
|
||||
#
|
||||
# This is done after applying patches.
|
||||
#
|
||||
# gb_UnpackedTarball_fix_cxx_suffix unpacked used-suffix
|
||||
define gb_UnpackedTarball_fix_cxx_suffix
|
||||
$(call gb_UnpackedTarball_get_target,$(1)) : UNPACKED_CXX_SUFFIX := $(2)
|
||||
|
||||
endef
|
||||
|
||||
# Set tarball name
|
||||
#
|
||||
# gb_UnpackedTarball_set_tarball unpacked tarball-name
|
||||
|
|
Loading…
Reference in a new issue