aboutsummaryrefslogtreecommitdiffstats
path: root/lib/megaco/src/rules.mk
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2009-11-20 14:54:40 +0000
committerErlang/OTP <[email protected]>2009-11-20 14:54:40 +0000
commit84adefa331c4159d432d22840663c38f155cd4c1 (patch)
treebff9a9c66adda4df2106dfd0e5c053ab182a12bd /lib/megaco/src/rules.mk
downloadotp-84adefa331c4159d432d22840663c38f155cd4c1.tar.gz
otp-84adefa331c4159d432d22840663c38f155cd4c1.tar.bz2
otp-84adefa331c4159d432d22840663c38f155cd4c1.zip
The R13B03 release.OTP_R13B03
Diffstat (limited to 'lib/megaco/src/rules.mk')
-rw-r--r--lib/megaco/src/rules.mk100
1 files changed, 100 insertions, 0 deletions
diff --git a/lib/megaco/src/rules.mk b/lib/megaco/src/rules.mk
new file mode 100644
index 0000000000..20fbed2a76
--- /dev/null
+++ b/lib/megaco/src/rules.mk
@@ -0,0 +1,100 @@
+#-*-makefile-*- ; force emacs to enter makefile-mode
+
+# %CopyrightBegin%
+#
+# Copyright Ericsson AB 1999-2009. All Rights Reserved.
+#
+# The contents of this file are subject to the Erlang Public License,
+# Version 1.1, (the "License"); you may not use this file except in
+# compliance with the License. You should have received a copy of the
+# Erlang Public License along with this software. If not, it can be
+# retrieved online at http://www.erlang.org/.
+#
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+# the License for the specific language governing rights and limitations
+# under the License.
+#
+# %CopyrightEnd%
+
+.SUFFIXES: .erl .jam .beam .yrl .hrl .sgml .html .so .c .flex .flex.src
+
+
+CC = gcc
+CFLAGS = -g -O2 -funroll-loops -Wall -fPIC
+FLEX = flex
+PERL = perl
+
+# ----------------------------------------------------
+# Erlang language section
+# ----------------------------------------------------
+EMULATOR = beam
+ifeq ($(findstring vxworks,$(TARGET)),vxworks)
+# VxWorks jam object files should be compressed
+ERL_COMPILE_FLAGS += +compressed
+endif
+ERLC_WFLAGS = -W
+ERLC = erlc $(ERLC_WFLAGS) $(ERLC_FLAGS)
+ERL.beam = erl.beam -boot start_clean
+ERL.jam = erl -boot start_clean
+ERL = $(ERL.$(EMULATOR))
+
+ifndef EBIN
+EBIN = ../ebin
+endif
+
+ifndef ESRC
+ESRC = .
+endif
+
+$(EBIN)/%.jam: $(ESRC)/%.erl
+ $(ERLC) -bjam $(ERL_COMPILE_FLAGS) -o$(EBIN) $<
+
+$(EBIN)/%.beam: $(ESRC)/%.erl
+ $(ERLC) -bbeam $(ERL_COMPILE_FLAGS) -o$(EBIN) $<
+
+.erl.jam:
+ $(ERLC) -bjam $(ERL_COMPILE_FLAGS) -o$(dir $@) $<
+
+.erl.beam:
+ $(ERLC) -bbeam $(ERL_COMPILE_FLAGS) -o$(dir $@) $<
+
+#
+# When .erl files are automatically created GNU make removes them if
+# they were the result of a chain of implicit rules. To prevent this
+# we say that all .erl files are "precious".
+#
+.PRECIOUS: %.erl
+
+## Uncomment these lines and add .idl to suffixes above to have erlc
+## eat IDL files
+##.idl.erl:
+## $(ERLC) $(IDL_FLAGS) $<
+
+.yrl.erl:
+ $(ERLC) $(YRL_FLAGS) $<
+
+.xrl.erl:
+ $(ERLC) $(XRL_FLAGS) $<
+
+## generating app files
+
+$(EBIN)/%.app: $(ESRC)/%.app.src $(VSN_FILE)
+ sed -e 's;%VSN%;$(VSN);' $< > $@
+
+$(EBIN)/%.appup: $(ESRC)/%.appup.src $(VSN_FILE)
+ sed -e 's;%VSN%;$(VSN);' $< > $@
+
+
+.c.so:
+ $(CC) $(CFLAGS) -fpic -shared -o $*.so $< -lfl
+
+
+# ----------------------------------------------------
+# Command macros
+# ----------------------------------------------------
+INSTALL = /usr/ucb/install -c
+INSTALL_DIR = /usr/ucb/install -c -d
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_DATA = ${INSTALL} -m 644
+