1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24# this is an optional extension to gbuild
25# it depends on scripts outside the gbuild directory
26# nothing in the gbuild core should ever depend on it
27
28.PHONY : packmodule cleanpackmodule
29
30define gb_PackModule_setpackmodulecommand
31ifeq ($$(words $(gb_Module_ALLMODULES)),1)
32$$(eval $$(call gb_Output_announce,$$(strip $$(gb_Module_ALLMODULES)),$$(true),ZIP,5))
33packmodule : COMMAND := $$(SOLARENV)/bin/packmodule $$(OUTDIR) $$(strip $$(gb_Module_ALLMODULES))
34else
35$$(eval $$(call gb_Output_announce,more than one module - creating no zipped package,$$(true),ZIP,5))
36packmodule : COMMAND := true
37endif
38endef
39
40packmodule : allandcheck deliverlog
41	$(eval $(call gb_PackModule_setpackmodulecommand))
42	$(COMMAND)
43
44define gb_PackModule_setcleanpackmodulecommand
45ifeq ($$(words $(gb_Module_ALLMODULES)),1)
46$$(eval $$(call gb_Output_announce,$$(strip $$(gb_Module_ALLMODULES)),$$(false),ZIP,5))
47cleanpackmodule : COMMAND := rm -f $$(OUTDIR)/zip/$$(strip $$(gb_Module_ALLMODULES)).zip
48else
49$$(eval $$(call gb_Output_announce,more than one module - deleting no zipped package,$$(false),ZIP,5))
50cleanpackmodule : COMMAND := true
51endif
52endef
53
54cleanpackmodule : clean
55	$(eval $(call gb_PackModule_setcleanpackmodulecommand))
56	$(COMMAND)
57
58# vim: set noet ts=4 sw=4:
59