1
#-*-makefile-*- ; force emacs to enter makefile-mode
2
# ----------------------------------------------------
5
# Copyright Ericsson AB 2009-2011. All Rights Reserved.
7
# The contents of this file are subject to the Erlang Public License,
8
# Version 1.1, (the "License"); you may not use this file except in
9
# compliance with the License. You should have received a copy of the
10
# Erlang Public License along with this software. If not, it can be
11
# retrieved online at http://www.erlang.org/.
13
# Software distributed under the License is distributed on an "AS IS"
14
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
15
# the License for the specific language governing rights and limitations
20
.SUFFIXES: .erl .beam .yrl .hrl .xml .xmlsrc .html \
21
.3 .1 .pdf .fo .el .elc
23
# ----------------------------------------------------
25
# ----------------------------------------------------
26
DEFAULT_TARGETS = opt debug release release_docs clean docs
29
# Slash separated list of return values from $(origin VAR)
30
# that are untrusted - set default in this file instead.
31
# The list is not space separated since some return values
32
# contain space, and we want to use $(findstring ...) to
34
DUBIOUS_ORIGINS = /undefined/environment/
37
# # ----------------------------------------------------
39
# # ----------------------------------------------------
41
# ifneq ($(OVERRIDE_TARGET),)
42
# ifneq ($(TARGET), $(OVERRIDE_TARGET))
43
# $(warning overriding $$(TARGET) = \
46
# $$(OVERRIDE_TARGET) = \
47
# "$(OVERRIDE_TARGET)")
48
# override TARGET := $(OVERRIDE_TARGET)
53
# ----------------------------------------------------
55
# ----------------------------------------------------
58
INSTALL_DIR = @INSTALL_DIR@
59
INSTALL_PROGRAM = @INSTALL_PROGRAM@
60
INSTALL_SCRIPT = @INSTALL_SCRIPT@
61
INSTALL_DATA = @INSTALL_DATA@
64
# ----------------------------------------------------
65
# Erlang language section
66
# ----------------------------------------------------
67
ERL_ROOT_DIR = @ERLANG_ROOT_DIR@
68
ERL_LIB_DIR = @ERLANG_LIB_DIR@
69
DOCGEN_DIR = @ERLANG_LIB_DIR_erl_docgen@
70
TEST_SERVER_DIR = @ERLANG_LIB_VER_test_server@
72
ERL_COMPILE_FLAGS += +debug_info
74
ERLC = $(ERL_ROOT_DIR)/bin/erlc $(ERLC_WFLAGS) $(ERLC_FLAGS)
75
ERL = $(ERL_ROOT_DIR)/bin/erl -boot start_clean
76
#ERLC = @ERLC@ $(ERLC_WFLAGS) $(ERLC_FLAGS)
77
#ERL = @ERL@ -boot start_clean
79
ifneq (,$(findstring $(origin EBIN),$(DUBIOUS_ORIGINS)))
83
# Generated (non ebin) files...
84
ifneq (,$(findstring $(origin EGEN),$(DUBIOUS_ORIGINS)))
88
ifneq (,$(findstring $(origin ESRC),$(DUBIOUS_ORIGINS)))
92
$(EBIN)/%.beam: $(EGEN)/%.erl
93
$(ERLC) $(ERL_COMPILE_FLAGS) -o$(EBIN) $<
95
$(EBIN)/%.beam: $(ESRC)/%.erl
96
$(ERLC) $(ERL_COMPILE_FLAGS) -o$(EBIN) $<
99
$(ERLC) $(ERL_COMPILE_FLAGS) -o$(dir $@) $<
103
# When .erl files are automatically created GNU make removes them if
104
# they were the result of a chain of implicit rules. To prevent this
105
# we say that all .erl files are "precious".
107
.PRECIOUS: %.erl %.fo
110
# ----------------------------------------------------
111
# Documentation section
112
# ----------------------------------------------------
115
# TOPDOCDIR=../../../../doc
121
HTMLDIR = $(DOCDIR)/html
123
MAN1DIR = $(DOCDIR)/man1
124
MAN2DIR = $(DOCDIR)/man2
125
MAN3DIR = $(DOCDIR)/man3
126
MAN4DIR = $(DOCDIR)/man4
127
MAN6DIR = $(DOCDIR)/man6
128
MAN9DIR = $(DOCDIR)/man9
130
# HTML & GIF files that always are generated and must be delivered
131
XML_COLL_FILES = $(XML_APPLICATION_FILES) $(XML_PART_FILES)
132
DEFAULT_HTML_FILES = \
133
$(XML_COLL_FILES:%.xml=$(HTMLDIR)/%_frame.html) \
134
$(XML_COLL_FILES:%.xml=$(HTMLDIR)/%_first.html) \
135
$(XML_COLL_FILES:%.xml=$(HTMLDIR)/%_term.html) \
136
$(XML_COLL_FILES:%.xml=$(HTMLDIR)/%_cite.html) \
137
$(XML_APPLICATION_FILES:%.xml=$(HTMLDIR)/%_index.html) \
138
$(XML_APPLICATION_FILES:%.xml=$(HTMLDIR)/%.kwc) \
139
$(HTMLDIR)/index.html
141
DEFAULT_GIF_FILES = $(HTMLDIR)/min_head.gif
146
XSLTPROC = @XSLTPROC@
151
$(MAN1DIR)/%.1:: %.xml
152
date=`date +"%B %e %Y"`; \
153
xsltproc --output "$@" --stringparam company "Ericsson AB" --stringparam docgen "$(DOCGEN)" --stringparam gendate "$$date" --stringparam appname "$(APPLICATION)" --stringparam appver "$(VSN)" --xinclude -path $(DOCGEN)/priv/docbuilder_dtd -path $(DOCGEN)/priv/dtd_man_entities $(DOCGEN)/priv/xsl/db_man.xsl $<
156
$(MAN2DIR)/%.2:: %.xml
157
date=`date +"%B %e %Y"`; \
158
xsltproc --output "$@" --stringparam company "Ericsson AB" --stringparam docgen "$(DOCGEN)" --stringparam gendate "$$date" --stringparam appname "$(APPLICATION)" --stringparam appver "$(VSN)" --xinclude -path $(DOCGEN)/priv/docbuilder_dtd -path $(DOCGEN)/priv/dtd_man_entities $(DOCGEN)/priv/xsl/db_man.xsl $<
161
$(MAN3DIR)/%.3:: %.xml
162
date=`date +"%B %e %Y"`; \
163
xsltproc --output "$@" --stringparam company "Ericsson AB" --stringparam docgen "$(DOCGEN)" --stringparam gendate "$$date" --stringparam appname "$(APPLICATION)" --stringparam appver "$(VSN)" --xinclude -path $(DOCGEN)/priv/docbuilder_dtd -path $(DOCGEN)/priv/dtd_man_entities $(DOCGEN)/priv/xsl/db_man.xsl $<
165
# left for compatibility
166
$(MAN4DIR)/%.4:: %.xml
167
date=`date +"%B %e %Y"`; \
168
xsltproc --output "$@" --stringparam company "Ericsson AB" --stringparam docgen "$(DOCGEN)" --stringparam gendate "$$date" --stringparam appname "$(APPLICATION)" --stringparam appver "$(VSN)" --xinclude -path $(DOCGEN)/priv/docbuilder_dtd -path $(DOCGEN)/priv/dtd_man_entities $(DOCGEN)/priv/xsl/db_man.xsl $<
170
$(MAN4DIR)/%.5:: %.xml
171
date=`date +"%B %e %Y"`; \
172
xsltproc --output "$@" --stringparam company "Ericsson AB" --stringparam docgen "$(DOCGEN)" --stringparam gendate "$$date" --stringparam appname "$(APPLICATION)" --stringparam appver "$(VSN)" --xinclude -path $(DOCGEN)/priv/docbuilder_dtd -path $(DOCGEN)/priv/dtd_man_entities $(DOCGEN)/priv/xsl/db_man.xsl $<
174
# left for compatibility
175
$(MAN6DIR)/%.6:: %_app.xml
176
date=`date +"%B %e %Y"`; \
177
xsltproc --output "$@" --stringparam company "Ericsson AB" --stringparam docgen "$(DOCGEN)" --stringparam gendate "$$date" --stringparam appname "$(APPLICATION)" --stringparam appver "$(VSN)" --xinclude -path $(DOCGEN)/priv/docbuilder_dtd -path $(DOCGEN)/priv/dtd_man_entities $(DOCGEN)/priv/xsl/db_man.xsl $<
179
$(MAN6DIR)/%.7:: %_app.xml
180
date=`date +"%B %e %Y"`; \
181
xsltproc --output "$@" --stringparam company "Ericsson AB" --stringparam docgen "$(DOCGEN)" --stringparam gendate "$$date" --stringparam appname "$(APPLICATION)" --stringparam appver "$(VSN)" --xinclude -path $(DOCGEN)/priv/docbuilder_dtd -path $(DOCGEN)/priv/dtd_man_entities $(DOCGEN)/priv/xsl/db_man.xsl $<
183
$(MAN9DIR)/%.9:: %.xml
184
date=`date +"%B %e %Y"`; \
185
xsltproc --output "$@" --stringparam company "Ericsson AB" --stringparam docgen "$(DOCGEN)" --stringparam gendate "$$date" --stringparam appname "$(APPLICATION)" --stringparam appver "$(VSN)" --xinclude -path $(DOCGEN)/priv/docbuilder_dtd -path $(DOCGEN)/priv/dtd_man_entities $(DOCGEN)/priv/xsl/db_man.xsl $<
189
escript $(DOCGEN)/priv/bin/codeline_preprocessing.escript $< $@
192
$(FOP) -fo $< -pdf $@