~clint-fewbar/ubuntu/precise/erlang/merge-15b

« back to all changes in this revision

Viewing changes to lib/diameter/src/Makefile

  • Committer: Package Import Robot
  • Author(s): Sergei Golovan
  • Date: 2011-12-15 19:20:10 UTC
  • mfrom: (1.1.18) (3.5.15 sid)
  • mto: (3.5.16 sid)
  • mto: This revision was merged to the branch mainline in revision 33.
  • Revision ID: package-import@ubuntu.com-20111215192010-jnxcfe3tbrpp0big
Tags: 1:15.b-dfsg-1
* New upstream release.
* Upload to experimental because this release breaks external drivers
  API along with ABI, so several applications are to be fixed.
* Removed SSL patch because the old SSL implementation is removed from
  the upstream distribution.
* Removed never used patch which added native code to erlang beam files.
* Removed the erlang-docbuilder binary package because the docbuilder
  application was dropped by upstream.
* Documented dropping ${erlang-docbuilder:Depends} substvar in
  erlang-depends(1) manpage.
* Made erlang-base and erlang-base-hipe provide virtual package
  erlang-abi-15.b (the number means the first erlang version, which
  provides current ABI).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
2
# %CopyrightBegin%
 
3
 
4
# Copyright Ericsson AB 2010-2011. All Rights Reserved.
 
5
 
6
# The contents of this file are subject to the Erlang Public License,
 
7
# Version 1.1, (the "License"); you may not use this file except in
 
8
# compliance with the License. You should have received a copy of the
 
9
# Erlang Public License along with this software. If not, it can be
 
10
# retrieved online at http://www.erlang.org/.
 
11
 
12
# Software distributed under the License is distributed on an "AS IS"
 
13
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
14
# the License for the specific language governing rights and limitations
 
15
# under the License.
 
16
 
17
# %CopyrightEnd%
 
18
 
 
19
ifeq ($(ERL_TOP),)
 
20
include $(DIAMETER_TOP)/make/target.mk
 
21
include $(DIAMETER_TOP)/make/$(TARGET)/rules.mk
 
22
else
 
23
include $(ERL_TOP)/make/target.mk
 
24
include $(ERL_TOP)/make/$(TARGET)/otp.mk
 
25
endif
 
26
 
 
27
# ----------------------------------------------------
 
28
# Application version
 
29
# ----------------------------------------------------
 
30
 
 
31
include ../vsn.mk
 
32
 
 
33
VSN = $(DIAMETER_VSN)
 
34
 
 
35
# ----------------------------------------------------
 
36
# Release directory specification
 
37
# ----------------------------------------------------
 
38
 
 
39
RELSYSDIR = $(RELEASE_PATH)/lib/diameter-$(VSN)
 
40
 
 
41
# Where to put/find things.
 
42
EBIN   = ../ebin
 
43
INCDIR = ../include
 
44
 
 
45
# Dumbed down to make 3.80. In 3.81 and later it's just $(realpath $(EBIN)).
 
46
ABS_EBIN := $(shell cd $(EBIN) && pwd)
 
47
 
 
48
# Where make should look for dependencies.
 
49
VPATH = .:base:compiler:transport:gen
 
50
 
 
51
# ----------------------------------------------------
 
52
# Target specs
 
53
# ----------------------------------------------------
 
54
 
 
55
include modules.mk
 
56
 
 
57
# Modules generated from dictionary specifications.
 
58
DICT_MODULES = $(DICTS:%=gen/diameter_gen_%)
 
59
DICT_ERLS    = $(DICT_MODULES:%=%.erl)
 
60
DICT_HRLS    = $(DICT_MODULES:%=%.hrl)
 
61
 
 
62
# Modules to build before compiling dictionaries.
 
63
COMPILER_MODULES = $(notdir $(filter compiler/%, $(CT_MODULES))) \
 
64
                   $(DICT_YRL)
 
65
 
 
66
# All handwritten modules from which a depend.mk is generated.
 
67
MODULES = \
 
68
        $(RT_MODULES) \
 
69
        $(CT_MODULES)
 
70
 
 
71
# Modules whose names are inserted into the app file.
 
72
APP_MODULES = \
 
73
        $(RT_MODULES) \
 
74
        $(DICT_MODULES)
 
75
 
 
76
# Modules for which to build beams.
 
77
TARGET_MODULES = \
 
78
        $(APP_MODULES) \
 
79
        $(CT_MODULES) \
 
80
        $(DICT_YRL:%=gen/%)
 
81
 
 
82
# What to build for the 'opt' target.
 
83
TARGET_FILES = \
 
84
        $(patsubst %, $(EBIN)/%.$(EMULATOR), $(notdir $(TARGET_MODULES))) \
 
85
        $(APP_TARGET) \
 
86
        $(APPUP_TARGET)
 
87
 
 
88
# Subdirectories of src to release modules into.
 
89
TARGET_DIRS = $(sort $(dir $(TARGET_MODULES)))
 
90
 
 
91
APP_FILE   = diameter.app
 
92
APP_SRC    = $(APP_FILE).src
 
93
APP_TARGET = $(EBIN)/$(APP_FILE)
 
94
 
 
95
APPUP_FILE   = diameter.appup
 
96
APPUP_SRC    = $(APPUP_FILE).src
 
97
APPUP_TARGET = $(EBIN)/$(APPUP_FILE)
 
98
 
 
99
# ----------------------------------------------------
 
100
# Flags
 
101
# ----------------------------------------------------
 
102
 
 
103
ifeq ($(TYPE),debug)
 
104
ERL_COMPILE_FLAGS += -Ddebug
 
105
endif
 
106
 
 
107
ERL_COMPILE_FLAGS += \
 
108
        +'{parse_transform,sys_pre_attributes}' \
 
109
        +'{attribute,insert,app_vsn,$(APP_VSN)}' \
 
110
        +warn_export_vars \
 
111
        +warn_unused_vars \
 
112
        -pa $(ABS_EBIN) \
 
113
        -I $(INCDIR) \
 
114
        -I gen
 
115
# -pa is to be able to include_lib from the include directory: the
 
116
# path must contain the application name.
 
117
 
 
118
# ----------------------------------------------------
 
119
# Targets
 
120
# ----------------------------------------------------
 
121
 
 
122
# erl/hrl from dictionary file.
 
123
gen/diameter_gen_%.erl gen/diameter_gen_%.hrl: dict/%.dia
 
124
        ../bin/diameterc -o gen -i $(EBIN) $<
 
125
 
 
126
opt: $(TARGET_FILES)
 
127
 
 
128
debug:
 
129
        @$(MAKE) TYPE=debug opt
 
130
 
 
131
# The dictionary parser.
 
132
gen/$(DICT_YRL).erl: compiler/$(DICT_YRL).yrl
 
133
        $(ERLC) -Werror -o $(@D) $<
 
134
 
 
135
# Generate the app file.
 
136
$(APP_TARGET): $(APP_SRC) ../vsn.mk modules.mk
 
137
        M=`echo $(notdir $(APP_MODULES)) | tr ' ' ,`; \
 
138
        sed -e 's;%VSN%;$(VSN);' \
 
139
            -e "s;%MODULES%;$$M;" \
 
140
          $< > $@
 
141
 
 
142
$(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
 
143
        sed -e 's;%VSN%;$(VSN);' $< > $@
 
144
 
 
145
app:  $(APP_TARGET) $(APPUP_TARGET)
 
146
dict: $(DICT_ERLS)
 
147
 
 
148
docs:
 
149
 
 
150
list = echo $(1):; echo $($(1)) | tr ' ' '\n' | sort | sed 's@^@  @'
 
151
 
 
152
info:
 
153
        @echo ========================================
 
154
        @$(call list,DICTS)
 
155
        @echo
 
156
        @$(call list,DICT_YRL)
 
157
        @echo
 
158
        @$(call list,RT_MODULES)
 
159
        @echo
 
160
        @$(call list,CT_MODULES)
 
161
        @echo
 
162
        @$(call list,TARGET_MODULES)
 
163
        @echo
 
164
        @$(call list,TARGET_DIRS)
 
165
        @echo
 
166
        @$(call list,EXTERNAL_HRLS)
 
167
        @echo
 
168
        @$(call list,INTERNAL_HRLS)
 
169
        @echo
 
170
        @$(call list,EXAMPLES)
 
171
        @echo
 
172
        @$(call list,BINS)
 
173
        @echo ========================================
 
174
 
 
175
clean:
 
176
        rm -f $(TARGET_FILES) gen/*
 
177
        rm -f depend.mk
 
178
 
 
179
# ----------------------------------------------------
 
180
# Release targets
 
181
# ----------------------------------------------------
 
182
 
 
183
ifeq ($(ERL_TOP),)
 
184
include $(DIAMETER_TOP)/make/release_targets.mk
 
185
else
 
186
include $(ERL_TOP)/make/otp_release_targets.mk
 
187
endif
 
188
 
 
189
# Can't $(INSTALL_DIR) more than one directory at a time on Solaris.
 
190
 
 
191
release_spec: opt
 
192
        for d in bin ebin examples include src/dict $(TARGET_DIRS:%/=src/%); do \
 
193
            $(INSTALL_DIR) $(RELSYSDIR)/$$d; \
 
194
        done
 
195
        $(INSTALL_SCRIPT) $(BINS:%=../bin/%) $(RELSYSDIR)/bin
 
196
        $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
 
197
        $(INSTALL_DATA) $(EXAMPLES:%=../examples/%) $(RELSYSDIR)/examples
 
198
        $(INSTALL_DATA) $(EXTERNAL_HRLS:%=../include/%) $(DICT_HRLS) \
 
199
                        $(RELSYSDIR)/include
 
200
        $(INSTALL_DATA) $(DICTS:%=dict/%.dia) $(RELSYSDIR)/src/dict
 
201
        $(MAKE) $(TARGET_DIRS:%/=release_src_%)
 
202
 
 
203
$(TARGET_DIRS:%/=release_src_%): release_src_%:
 
204
        $(INSTALL_DATA) $(filter $*/%, $(TARGET_MODULES:%=%.erl) \
 
205
                                       $(INTERNAL_HRLS)) \
 
206
                        $(filter $*/%, compiler/$(DICT_YRL).yrl) \
 
207
                        $(RELSYSDIR)/src/$*
 
208
 
 
209
release_docs_spec:
 
210
 
 
211
# ----------------------------------------------------
 
212
# Dependencies
 
213
# ----------------------------------------------------
 
214
 
 
215
gen/diameter_gen_base_accounting.erl gen/diameter_gen_relay.erl \
 
216
gen/diameter_gen_base_accounting.hrl gen/diameter_gen_relay.hrl: \
 
217
        $(EBIN)/diameter_gen_base_rfc3588.$(EMULATOR)
 
218
 
 
219
gen/diameter_gen_base_rfc3588.erl gen/diameter_gen_base_rfc3588.hrl: \
 
220
        $(COMPILER_MODULES:%=$(EBIN)/%.$(EMULATOR))
 
221
 
 
222
$(DICT_MODULES:gen/%=$(EBIN)/%.$(EMULATOR)): \
 
223
        $(INCDIR)/diameter.hrl \
 
224
        $(INCDIR)/diameter_gen.hrl
 
225
 
 
226
depend: depend.mk
 
227
 
 
228
# Generate dependencies makefile.
 
229
depend.mk: depend.sed $(MODULES:%=%.erl) Makefile
 
230
        (for f in $(MODULES); do \
 
231
             (echo $$f; cat $$f.erl) | sed -f $<; \
 
232
         done) \
 
233
        > $@
 
234
 
 
235
-include depend.mk
 
236
 
 
237
.PHONY: app clean depend dict info release_subdir
 
238
.PHONY: debug opt release_docs_spec release_spec
 
239
.PHONY: $(TARGET_DIRS:%/=%) $(TARGET_DIRS:%/=release_src_%)
 
240
 
 
241
# Keep intermediate files.
 
242
.SECONDARY: $(DICT_ERLS) $(DICT_HRLS) gen/$(DICT_YRL:%=%.erl)
 
243
 
 
244
# ----------------------------------------------------
 
245
# Targets using secondary expansion (make >= 3.81)
 
246
# ----------------------------------------------------
 
247
 
 
248
.SECONDEXPANSION:
 
249
 
 
250
# Make beams from a subdirectory.
 
251
$(TARGET_DIRS:%/=%): \
 
252
  $$(patsubst $$@/%, \
 
253
              $(EBIN)/%.$(EMULATOR), \
 
254
              $$(filter $$@/%, $(TARGET_MODULES) compiler/$(DICT_YRL)))