1#
2# %CopyrightBegin%
3#
4# Copyright Ericsson AB 1997-2016. All Rights Reserved.
5#
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10#     http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#
18# %CopyrightEnd%
19#
20#
21include $(ERL_TOP)/make/target.mk
22include $(ERL_TOP)/make/$(TARGET)/otp.mk
23
24#
25# Macros
26#
27
28SUB_DIRECTORIES = src doc/src c_src
29
30static_lib: SUB_DIRECTORIES = c_src
31
32
33include vsn.mk
34VSN = $(ASN1_VSN)
35
36DIR_NAME = asn1-$(VSN)
37
38ifndef APP_RELEASE_DIR
39  APP_RELEASE_DIR = /tmp
40endif
41
42ifndef APP_TAR_FILE
43  APP_TAR_FILE = $(APP_RELEASE_DIR)/$(DIR_NAME).tgz
44endif
45
46APP_DIR = $(APP_RELEASE_DIR)/$(DIR_NAME)
47
48
49SPECIAL_TARGETS =
50
51#
52# Default Subdir Targets
53#
54include $(ERL_TOP)/make/otp_subdir.mk
55
56
57.PHONY: version
58
59version:
60	@echo "$(VSN)"
61
62# ----------------------------------------------------
63# Application (source) release targets
64# ----------------------------------------------------
65app_release: app_doc tar
66
67app_doc:
68	cd doc/src; $(MAKE) html man
69
70app_dir: $(APP_DIR)
71
72$(APP_DIR):
73	cat TAR.exclude > TAR.exclude2; \
74        echo "asn1/TAR.exclude2" >> TAR.exclude2; \
75        echo "asn1/priv/lib/$(TARGET)" >> TAR.exclude2; \
76        echo "asn1/c_src/$(TARGET)" >> TAR.exclude2
77	(cd ..; find asn1 -name 'findmerge.*' >> asn1/TAR.exclude2)
78	(cd ..; find asn1 -name '*.contrib*' >> asn1/TAR.exclude2)
79	(cd ..; find asn1 -name '*.keep*' >> asn1/TAR.exclude2)
80	(cd ..; find asn1 -name '*~' >> asn1/TAR.exclude2)
81	(cd ..; find asn1 -name 'erl_crash.dump' >> asn1/TAR.exclude2)
82	(cd ..; find asn1 -name '*.log' >> asn1/TAR.exclude2)
83	(cd ..; find asn1 -name 'core' >> asn1/TAR.exclude2)
84	(cd ..; find asn1 -name '.cmake.state' >> asn1/TAR.exclude2)
85	mkdir $(APP_DIR); \
86        (cd ..; tar cfX - asn1/TAR.exclude2 asn1) | \
87        (cd $(APP_DIR); tar xf -); \
88        mv $(APP_DIR)/asn1/* $(APP_DIR)/; \
89        rmdir $(APP_DIR)/asn1
90	mkdir $(APP_DIR)/doc; \
91	(cd doc; tar cf - man3 html) | (cd $(APP_DIR)/doc; tar xf -)
92
93tar: $(APP_TAR_FILE)
94
95$(APP_TAR_FILE): $(APP_DIR)
96	(cd $(APP_RELEASE_DIR); gtar zcf $(APP_TAR_FILE) $(DIR_NAME))
97
98
99include $(ERL_TOP)/make/app_targets.mk
100