xref: /trunk/main/solenv/gbuild/extensions/post_PackModule.mk (revision 3562d4444a8a7e945006ebf04b89c574cbbe70dc)
17871dc3eSAndrew Rist#**************************************************************
2cdf0e10cSrcweir#
37871dc3eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
47871dc3eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
57871dc3eSAndrew Rist#  distributed with this work for additional information
67871dc3eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
77871dc3eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
87871dc3eSAndrew Rist#  "License"); you may not use this file except in compliance
97871dc3eSAndrew Rist#  with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir#
117871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir#
137871dc3eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
147871dc3eSAndrew Rist#  software distributed under the License is distributed on an
157871dc3eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
167871dc3eSAndrew Rist#  KIND, either express or implied.  See the License for the
177871dc3eSAndrew Rist#  specific language governing permissions and limitations
187871dc3eSAndrew Rist#  under the License.
19cdf0e10cSrcweir#
207871dc3eSAndrew Rist#**************************************************************
217871dc3eSAndrew Rist
227871dc3eSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir# this is an optional extension to gbuild
25cdf0e10cSrcweir# it depends on scripts outside the gbuild directory
26cdf0e10cSrcweir# nothing in the gbuild core should ever depend on it
27cdf0e10cSrcweir
28cdf0e10cSrcweir.PHONY : packmodule cleanpackmodule
29cdf0e10cSrcweir
30cdf0e10cSrcweirdefine gb_PackModule_setpackmodulecommand
31cdf0e10cSrcweirifeq ($$(words $(gb_Module_ALLMODULES)),1)
32cdf0e10cSrcweir$$(eval $$(call gb_Output_announce,$$(strip $$(gb_Module_ALLMODULES)),$$(true),ZIP,5))
33cdf0e10cSrcweirpackmodule : COMMAND := $$(SOLARENV)/bin/packmodule $$(OUTDIR) $$(strip $$(gb_Module_ALLMODULES))
34cdf0e10cSrcweirelse
35cdf0e10cSrcweir$$(eval $$(call gb_Output_announce,more than one module - creating no zipped package,$$(true),ZIP,5))
36cdf0e10cSrcweirpackmodule : COMMAND := true
37cdf0e10cSrcweirendif
38cdf0e10cSrcweirendef
39cdf0e10cSrcweir
40cdf0e10cSrcweirpackmodule : allandcheck deliverlog
41cdf0e10cSrcweir    $(eval $(call gb_PackModule_setpackmodulecommand))
42cdf0e10cSrcweir    $(COMMAND)
43cdf0e10cSrcweir
44cdf0e10cSrcweirdefine gb_PackModule_setcleanpackmodulecommand
45cdf0e10cSrcweirifeq ($$(words $(gb_Module_ALLMODULES)),1)
46cdf0e10cSrcweir$$(eval $$(call gb_Output_announce,$$(strip $$(gb_Module_ALLMODULES)),$$(false),ZIP,5))
47cdf0e10cSrcweircleanpackmodule : COMMAND := rm -f $$(OUTDIR)/zip/$$(strip $$(gb_Module_ALLMODULES)).zip
48cdf0e10cSrcweirelse
49cdf0e10cSrcweir$$(eval $$(call gb_Output_announce,more than one module - deleting no zipped package,$$(false),ZIP,5))
50cdf0e10cSrcweircleanpackmodule : COMMAND := true
51cdf0e10cSrcweirendif
52cdf0e10cSrcweirendef
53cdf0e10cSrcweir
54cdf0e10cSrcweircleanpackmodule : clean
55cdf0e10cSrcweir    $(eval $(call gb_PackModule_setcleanpackmodulecommand))
56cdf0e10cSrcweir    $(COMMAND)
57cdf0e10cSrcweir
58*3562d444Smseidel# vim: set noet sw=4 ts=4:
59