1#
2# %CopyrightBegin%
3#
4# Copyright Ericsson AB 2004-2017. 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#
20include $(ERL_TOP)/make/target.mk
21include $(ERL_TOP)/make/$(TARGET)/otp.mk
22
23# ----------------------------------------------------
24# Common Macros
25# ----------------------------------------------------
26
27include ../vsn.mk
28VSN = $(XMERL_VSN)
29
30RM = rm -f
31
32# ----------------------------------------------------
33# Target Specs
34# ----------------------------------------------------
35
36HRL_DIR= $(ERL_TOP)/lib/xmerl/include/
37HRL_MODULES= $(HRL_DIR)xmerl $(HRL_DIR)xmerl_xsd
38HRL_FILES= $(HRL_MODULES:%=%.hrl)
39
40
41MODULES= \
42	xmerl_test \
43	xmerl_app_test \
44	xmerl_appup_test \
45	xmerl_test_lib \
46	xmerl_xsd_lib
47
48ERL_FILES= $(MODULES:%=%.erl)
49
50SUITE_FILES= \
51	xmerl_SUITE.erl \
52	xmerl_std_SUITE.erl \
53	xmerl_sax_SUITE.erl \
54	xmerl_sax_std_SUITE.erl \
55	xmerl_xsd_SUITE.erl \
56	xmerl_xsd_MS2002-01-16_SUITE.erl \
57	xmerl_xsd_NIST2002-01-16_SUITE.erl \
58	xmerl_xsd_Sun2002-01-16_SUITE.erl \
59        xmerl_sax_stream_SUITE.erl
60
61XML_FILES= \
62	testcases.dtd \
63	xmlconformance.msxsl \
64	xmlconformance.xsl
65
66
67TARGET_FILES= $(MODULES:%=%.$(EMULATOR))
68
69
70INSTALL_PROGS= $(TARGET_FILES)
71
72ifndef XMERL_PRESERV
73XMERL_PRESERV_TEST_DIRS=
74else
75XMERL_PRESERV_TEST_DIRS= -Ddont_rm_test_dirs
76endif
77
78# ----------------------------------------------------
79# Release directory specification
80# ----------------------------------------------------
81
82RELSYSDIR = $(RELEASE_PATH)/xmerl_test
83
84# ----------------------------------------------------
85# FLAGS
86# ----------------------------------------------------
87
88ERL_COMPILE_FLAGS +=
89
90
91# ----------------------------------------------------
92# Targets
93# ----------------------------------------------------
94
95tests debug opt:  xmerl_test.erl
96
97info:
98	@echo "HRL_FILES: $(HRL_FILES)"
99
100clean:
101	$(RM) *.beam
102	$(RM) xmerl_test.erl
103	$(RM) core *~
104
105xmerl_test.erl: ../doc/examples/xmerl_test.erl
106	cp $< $@
107	chmod u+w $@
108
109
110# ----------------------------------------------------
111# Release Target
112# ----------------------------------------------------
113include $(ERL_TOP)/make/otp_release_targets.mk
114
115release_spec: opt
116
117release_tests_spec: opt
118	$(INSTALL_DIR) "$(RELSYSDIR)"
119	$(INSTALL_DATA)  $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)"
120	$(INSTALL_DATA)  $(SUITE_FILES) "$(RELSYSDIR)"
121	$(INSTALL_DATA) xmerl.spec xmerl.cover "$(RELSYSDIR)"
122	cp $(XML_FILES) "$(RELSYSDIR)"
123	@tar cfh - xmerl_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
124	@tar cfh - xmerl_std_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
125	@tar cfh - xmerl_sax_std_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
126	@tar cfh - xmerl_xsd_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
127	@tar cfh - xmerl_xsd_MS2002-01-16_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
128	@tar cfh - xmerl_xsd_NIST2002-01-16_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
129	@tar cfh - xmerl_xsd_Sun2002-01-16_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
130	@tar cfh - xmerl_sax_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
131	@tar cfh - xmerl_sax_stream_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
132	chmod -R u+w "$(RELSYSDIR)"
133