Fix linking on Windows
[LibreOffice.git] / solenv / gbuild / Package.mk
blob742075750603f165180762b66fa0d2efe2f7a544
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
2 #*************************************************************************
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 #
6 # Copyright 2000, 2011 Oracle and/or its affiliates.
8 # OpenOffice.org - a multi-platform office productivity suite
10 # This file is part of OpenOffice.org.
12 # OpenOffice.org is free software: you can redistribute it and/or modify
13 # it under the terms of the GNU Lesser General Public License version 3
14 # only, as published by the Free Software Foundation.
16 # OpenOffice.org is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU Lesser General Public License version 3 for more details
20 # (a copy is included in the LICENSE file that accompanied this code).
22 # You should have received a copy of the GNU Lesser General Public License
23 # version 3 along with OpenOffice.org. If not, see
24 # <http://www.openoffice.org/license.html>
25 # for a copy of the LGPLv3 License.
27 #*************************************************************************
30 # PackagePart class
32 $(foreach destination,$(call gb_PackagePart_get_destinations), $(destination)/%) :
33 $(call gb_Deliver_deliver,$<,$@)
35 define gb_PackagePart_PackagePart
36 $(OUTDIR)/$(1) : $(2)
37 $(2) :| $(3)
38 $(call gb_Deliver_add_deliverable,$(OUTDIR)/$(1),$(2),$(3))
39 endef
42 # Package class
44 .PHONY : $(call gb_Package_get_clean_target,%)
45 $(call gb_Package_get_clean_target,%) :
46 $(call gb_Output_announce,$*,$(false),PKG,2)
47 RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,$(FILES)) \
48 && cat $${RESPONSEFILE} | xargs rm -f \
49 && rm -f $${RESPONSEFILE}
51 $(call gb_Package_get_preparation_target,%) :
52 mkdir -p $(dir $@) && touch $@
54 $(call gb_Package_get_target,%) :
55 $(call gb_Output_announce,$*,$(true),PKG,2)
56 mkdir -p $(dir $@) && touch $@
59 define gb_Package_Package
60 gb_Package_SOURCEDIR_$(1) := $(2)
61 $(call gb_Package_get_clean_target,$(1)) : FILES := $(call gb_Package_get_target,$(1)) $(call gb_Package_get_preparation_target,$(1))
62 $$(eval $$(call gb_Module_register_target,$(call gb_Package_get_target,$(1)),$(call gb_Package_get_clean_target,$(1))))
63 $(call gb_Package_get_target,$(1)) : $(call gb_Package_get_preparation_target,$(1))
65 endef
67 define gb_Package_add_file
68 $(call gb_Package_get_target,$(1)) : $(OUTDIR)/$(2)
69 $(call gb_Package_get_clean_target,$(1)) : FILES += $(OUTDIR)/$(2)
70 $(call gb_PackagePart_PackagePart,$(2),$$(gb_Package_SOURCEDIR_$(1))/$(3),$(call gb_Package_get_preparation_target,$(1)))
72 endef
74 define gb_Package_add_customtarget
75 $(call gb_Package_get_preparation_target,$(1)) : $(call gb_CustomTarget_get_target,$(2))
76 $(call gb_Package_get_clean_target,$(1)) : $(call gb_CustomTarget_get_clean_target,$(2))
77 $(eval $(call gb_CustomTarget_CustomTarget,$(2)))
79 endef
81 # vim: set noet sw=4: