1#
2# %CopyrightBegin%
3#
4# Copyright Ericsson AB 2001-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
21ifndef EBIN
22EBIN = ../ebin
23endif
24
25ifndef DOCS
26DOCS = ../doc
27endif
28
29include $(ERL_TOP)/make/target.mk
30include $(ERL_TOP)/make/$(TARGET)/otp.mk
31
32# ----------------------------------------------------
33# Application version
34# ----------------------------------------------------
35include ../vsn.mk
36VSN=$(HIPE_VSN)
37
38# ----------------------------------------------------
39# Release directory specification
40# ----------------------------------------------------
41RELSYSDIR = $(RELEASE_PATH)/lib/hipe-$(VSN)
42
43# ----------------------------------------------------
44# Target Specs
45# ----------------------------------------------------
46MODULES = hipe_spillmin hipe_spillmin_color hipe_spillmin_scan \
47	hipe_bb_weights
48
49HRL_FILES=
50ERL_FILES= $(MODULES:%=%.erl)
51TARGET_FILES= $(MODULES:%=$(EBIN)/%.$(EMULATOR))
52DOC_FILES= $(MODULES:%=$(DOCS)/%.html)
53
54# APP_FILE=
55# APP_SRC= $(APP_FILE).src
56# APP_TARGET= $(EBIN)/$(APP_FILE)
57#
58# APPUP_FILE=
59# APPUP_SRC= $(APPUP_FILE).src
60# APPUP_TARGET= $(EBIN)/$(APPUP_FILE)
61
62# ----------------------------------------------------
63# FLAGS
64# ----------------------------------------------------
65
66include ../native.mk
67
68ERL_COMPILE_FLAGS += -Werror +warn_export_vars +warn_missing_spec # +warn_untyped_record
69
70# ----------------------------------------------------
71# Targets
72# ----------------------------------------------------
73
74debug opt: $(TARGET_FILES)
75
76docs:
77
78# Moved docs target to edocs so the standard docs rule work properly.
79edocs: $(DOC_FILES)
80
81clean:
82	rm -f $(TARGET_FILES)
83	rm -f core
84
85distclean: clean
86realclean: clean
87
88$(DOCS)/%.html:%.erl
89	erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop
90
91# ----------------------------------------------------
92# Special Build Targets
93# ----------------------------------------------------
94
95
96# ----------------------------------------------------
97# Release Target
98# ----------------------------------------------------
99include $(ERL_TOP)/make/otp_release_targets.mk
100
101release_spec: opt
102	$(INSTALL_DIR) "$(RELSYSDIR)/ebin"
103	$(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
104
105release_docs_spec:
106
107$(EBIN)/hipe_spillmin.beam: ../main/hipe.hrl ../flow/cfg.hrl
108$(EBIN)/hipe_spillmin_color.beam: ../main/hipe.hrl ../flow/cfg.hrl
109$(EBIN)/hipe_spillmin_scan.beam: ../main/hipe.hrl ../flow/cfg.hrl
110