From bd51ff439c6cecaefbd67c0871106a9bfdb13935 Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Fri, 30 Mar 2012 12:40:06 +0200 Subject: clucene: use CustomTarget makefile --- clucene/CustomTarget_source.mk | 81 ++++++++++++++++++++++++++++++++++++++++++ clucene/Library_clucene.mk | 6 ---- clucene/Module_clucene.mk | 1 + clucene/Package_source.mk | 20 ++--------- clucene/source/Makefile | 75 -------------------------------------- 5 files changed, 84 insertions(+), 99 deletions(-) create mode 100644 clucene/CustomTarget_source.mk delete mode 100644 clucene/source/Makefile (limited to 'clucene') diff --git a/clucene/CustomTarget_source.mk b/clucene/CustomTarget_source.mk new file mode 100644 index 000000000000..f36f997d3957 --- /dev/null +++ b/clucene/CustomTarget_source.mk @@ -0,0 +1,81 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# Major Contributor(s): +# Copyright (C) 2012 Red Hat, Inc., Caolán McNamara +# (initial developer) +# Copyright (C) 2012 Red Hat, Inc., David Tardon +# +# All Rights Reserved. +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. + +$(eval $(call gb_CustomTarget_CustomTarget,clucene/source,new_style)) + +CLSO := $(call gb_CustomTarget_get_workdir,clucene/source) + +$(call gb_CustomTarget_get_target,clucene/source) : $(CLSO)/done + +# FIXME: do not hardcode the path here +ifeq ($(OS_FOR_BUILD),WNT) +cl_FIXED_TARFILE_LOCATION := $(shell cygpath -u $(TARFILE_LOCATION))/48d647fbd8ef8889e5a7f422c1bfda94-clucene-core-2.3.3.4.tar.gz +else +cl_FIXED_TARFILE_LOCATION := $(TARFILE_LOCATION)/48d647fbd8ef8889e5a7f422c1bfda94-clucene-core-2.3.3.4.tar.gz +endif + +ifeq ($(OS),WNT) +_CLUCENE_CONFIG_H := $(SRCDIR)/clucene/configs/_clucene-config-MSVC.h +ifeq ($(COM),MSC) +CLUCENE_CONFIG_H := $(SRCDIR)/clucene/configs/clucene-config-MSVC.h +else +CLUCENE_CONFIG_H := $(SRCDIR)/clucene/configs/clucene-config-MINGW.h +endif +else +CLUCENE_CONFIG_H := $(SRCDIR)/clucene/configs/clucene-config-generic.h +ifeq ($(OS),LINUX) +_CLUCENE_CONFIG_H := $(SRCDIR)/clucene/configs/_clucene-config-LINUX.h +else +_CLUCENE_CONFIG_H := $(SRCDIR)/clucene/configs/_clucene-config-generic.h +endif +endif + +$(CLSO)/done : $(cl_FIXED_TARFILE_LOCATION) \ + $(_CLUCENE_CONFIG_H) $(CLUCENE_CONFIG_H) + $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),TAR,1) + $(call gb_Helper_abbreviate_dirs_native, \ + mkdir -p $(dir $@) && cd $(dir $@) && \ + $(GNUTAR) -x -z $(STRIP_COMPONENTS)=1 -f $< && \ + $(GNUPATCH) -p0 < $(SRCDIR)/clucene/patches/clucene-internal-zlib.patch && \ + $(GNUPATCH) -p0 < $(SRCDIR)/clucene/patches/clucene-warnings.patch && \ + $(GNUPATCH) -p0 < $(SRCDIR)/clucene/patches/clucene-gcc-atomics.patch && \ + $(GNUPATCH) -p0 < $(SRCDIR)/clucene/patches/clucene-debug.patch && \ + $(GNUPATCH) -p0 < $(SRCDIR)/clucene/patches/clucene-narrowing-conversions.patch && \ + for i in `find $(CLSO)/ -name "*.cpp"`; do mv $$i $${i%%cpp}cxx; done) + #FIXME ?, our rules expect .cxx +ifneq ($(OS),WNT) + #dirent.h is a problem, move it around + mkdir -p $(CLSO)/inc/internal/CLucene/util + mv $(CLSO)/src/shared/CLucene/util/dirent.h $(CLSO)/inc/internal/CLucene/util +endif + #To generate these, run cmake for each sufficiently different platform, customize and stick into configs + cp $(CLUCENE_CONFIG_H) $(CLSO)/src/shared/CLucene/clucene-config.h + cp $(_CLUCENE_CONFIG_H) $(CLSO)/src/shared/CLucene/_clucene-config.h + touch $@ + +# vim: set noet sw=4 ts=4: diff --git a/clucene/Library_clucene.mk b/clucene/Library_clucene.mk index 2fe7c5f6d93e..2cc9520a9175 100644 --- a/clucene/Library_clucene.mk +++ b/clucene/Library_clucene.mk @@ -48,12 +48,6 @@ $(eval $(call gb_Library_add_defs,clucene,\ $(LFS_CFLAGS) \ )) -ifeq ($(SYSTEM_ZLIB),YES) -$(eval $(call gb_Library_add_defs,clucene,\ - -DSYSTEM_ZLIB \ -)) -endif - # clucene does not depend on sal nor needs uwinapi here $(eval $(call gb_Library_add_linked_libs,clucene,\ $(filter-out uwinapi,$(gb_STDLIBS)) \ diff --git a/clucene/Module_clucene.mk b/clucene/Module_clucene.mk index 0eb79920c860..2a72ef826cd3 100644 --- a/clucene/Module_clucene.mk +++ b/clucene/Module_clucene.mk @@ -28,6 +28,7 @@ $(eval $(call gb_Module_Module,clucene)) $(eval $(call gb_Module_add_targets,clucene,\ + CustomTarget_source \ Library_clucene \ Package_source \ )) diff --git a/clucene/Package_source.mk b/clucene/Package_source.mk index c1bf7817e5a4..f6ebe3ebb3d7 100644 --- a/clucene/Package_source.mk +++ b/clucene/Package_source.mk @@ -26,25 +26,9 @@ # in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable # instead of those above. -$(eval $(call gb_Package_Package,clucene_source,$(WORKDIR)/CustomTarget/clucene/source)) +$(eval $(call gb_Package_Package,clucene_source,$(call gb_CustomTarget_get_workdir,clucene/source))) -$(eval $(call gb_Package_add_customtarget,clucene_source,clucene/source)) - -$(eval $(call gb_CustomTarget_add_dependencies,clucene/source,\ - clucene/configs/_clucene-config-generic.h \ - clucene/configs/clucene-config-generic.h \ -)) - -ifeq ($(OS_FOR_BUILD),WNT) -FIXED_TARFILE_LOCATION=$(shell cygpath -u $(TARFILE_LOCATION)) -else -FIXED_TARFILE_LOCATION=$(TARFILE_LOCATION) -endif - -# FIXME: do not hardcode the path here -$(eval $(call gb_CustomTarget_add_outdir_dependencies,clucene/source,\ - $(FIXED_TARFILE_LOCATION)/48d647fbd8ef8889e5a7f422c1bfda94-clucene-core-2.3.3.4.tar.gz \ -)) +$(call gb_Package_get_preparation_target,clucene_source) : $(call gb_CustomTarget_get_target,clucene/source) $(eval $(call gb_Package_add_file,clucene_source,inc/CLucene.h,src/core/CLucene.h)) $(eval $(call gb_Package_add_file,clucene_source,inc/CLucene/clucene-config.h,src/shared/CLucene/clucene-config.h)) diff --git a/clucene/source/Makefile b/clucene/source/Makefile deleted file mode 100644 index 500c3b92d9b9..000000000000 --- a/clucene/source/Makefile +++ /dev/null @@ -1,75 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# Version: MPL 1.1 / GPLv3+ / LGPLv3+ -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License or as specified alternatively below. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# Major Contributor(s): -# Copyright (C) 2012 Red Hat, Inc., Caolán McNamara -# (initial developer) -# Copyright (C) 2012 Red Hat, Inc., David Tardon -# -# All Rights Reserved. -# -# For minor contributions see the git repository. -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 3 or later (the "GPLv3+"), or -# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), -# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable -# instead of those above. - -gb_PARTIALBUILD := T -include $(GBUILDDIR)/gbuild_simple.mk - -ifeq ($(OS_FOR_BUILD),WNT) -FIXED_TARFILE_LOCATION=$(shell cygpath -u $(TARFILE_LOCATION)) -else -FIXED_TARFILE_LOCATION=$(TARFILE_LOCATION) -endif - -done : - mkdir -p $(dir $@) - # FIXME: do not hardcode the path here - $(GNUTAR) -x -z $(STRIP_COMPONENTS)=1 -f $(FIXED_TARFILE_LOCATION)/48d647fbd8ef8889e5a7f422c1bfda94-clucene-core-2.3.3.4.tar.gz - $(GNUPATCH) -p0 < $(SRCDIR)/clucene/patches/clucene-internal-zlib.patch - $(GNUPATCH) -p0 < $(SRCDIR)/clucene/patches/clucene-warnings.patch - $(GNUPATCH) -p0 < $(SRCDIR)/clucene/patches/clucene-gcc-atomics.patch - $(GNUPATCH) -p0 < $(SRCDIR)/clucene/patches/clucene-debug.patch - $(GNUPATCH) -p0 < $(SRCDIR)/clucene/patches/clucene-narrowing-conversions.patch - #FIXME ?, our rules expect .cxx - for i in `find . -name "*.cpp"`; do mv $$i $${i%%cpp}cxx; done -ifneq ($(OS),WNT) - #dirent.h is a problem, move it around - mkdir -p inc/internal/CLucene/util - mv src/shared/CLucene/util/dirent.h inc/internal/CLucene/util -endif - #To generate these, run cmake for each sufficiently different platform, customize and stick into configs -ifeq ($(OS),WNT) - cp $(SRCDIR)/clucene/configs/_clucene-config-MSVC.h src/shared/CLucene/_clucene-config.h -ifeq ($(COM),MSC) - cp $(SRCDIR)/clucene/configs/clucene-config-MSVC.h src/shared/CLucene/clucene-config.h -else - cp $(SRCDIR)/clucene/configs/clucene-config-MINGW.h src/shared/CLucene/clucene-config.h -endif -else - cp $(SRCDIR)/clucene/configs/clucene-config-generic.h src/shared/CLucene/clucene-config.h -ifeq ($(OS),LINUX) - cp $(SRCDIR)/clucene/configs/_clucene-config-LINUX.h src/shared/CLucene/_clucene-config.h -else - cp $(SRCDIR)/clucene/configs/_clucene-config-generic.h src/shared/CLucene/_clucene-config.h -endif -endif - -.DEFAULT_GOAL := all -.PHONY : all -all : done - -# vim: set noet sw=4 ts=4: -- cgit