| 30 |
ashish |
1 |
# +----------------------------------------------------------------------+
|
|
|
2 |
# $Id: otp.mk,v 1.4 2004/07/01 14:57:10 tfee Exp $
|
|
|
3 |
# +----------------------------------------------------------------------+
|
|
|
4 |
|
|
|
5 |
# otp.mk
|
|
|
6 |
# - to be included in all OTP Makefiles
|
|
|
7 |
# installed to /usr/local/include/erlang/otp.mk
|
|
|
8 |
|
|
|
9 |
# gmake looks in /usr/local/include - that's hard-coded
|
|
|
10 |
# users of this file will use
|
|
|
11 |
# include erlang/top.mk
|
|
|
12 |
|
|
|
13 |
# most interface files will be installed to $ERL_RUN_TOP/app-vsn/include/*.hrl
|
|
|
14 |
|
|
|
15 |
# group owner for library/include directories
|
|
|
16 |
ERLANGDEV_GROUP=erlangdev
|
|
|
17 |
|
|
|
18 |
# ERL_TOP is root of Erlang source tree
|
|
|
19 |
# ERL_RUN_TOP is root of Erlang target tree (some Ericsson Makefiles use $ROOT)
|
|
|
20 |
# ERLANG_OTP is target root for Erlang code
|
|
|
21 |
# - see sasl/systools reference manual page; grep "TEST"
|
|
|
22 |
|
|
|
23 |
# OS_TYPE is FreeBSD, NetBSD, OpenBSD, Linux, SCO_SV, SunOS.
|
|
|
24 |
OS_TYPE=${shell uname}
|
|
|
25 |
|
|
|
26 |
# MHOST is the host where this Makefile runs.
|
|
|
27 |
MHOST=${shell hostname -s}
|
|
|
28 |
ERL_COMPILE_FLAGS+=-W0
|
|
|
29 |
|
|
|
30 |
# The location of the erlang runtime system.
|
|
|
31 |
ifndef ERL_RUN_TOP
|
|
|
32 |
ERL_RUN_TOP=/usr/local/lib/erlang
|
|
|
33 |
endif
|
|
|
34 |
|
|
|
35 |
|
|
|
36 |
# Edit to reflect local environment.
|
|
|
37 |
# ifeq (${OS_TYPE},Linux)
|
|
|
38 |
# ERL_RUN_TOP=/usr/local/lib/erlang
|
|
|
39 |
# Note* ERL_RUN_TOP can be determined by starting an
|
|
|
40 |
# erlang shell and typing code:root_dir().
|
|
|
41 |
# ERL_TOP=a symbolic link to the actual source top, which changes from version to version
|
|
|
42 |
# Note* ERL_TOP is the directory where the erlang
|
|
|
43 |
# source files reside. Make sure to run ./configure there.
|
|
|
44 |
# TARGET=i686-pc-linux-gnu
|
|
|
45 |
# Note* Target can be found in $ERL_TOP/erts
|
|
|
46 |
# endif
|
|
|
47 |
|
|
|
48 |
# See above for directions.
|
|
|
49 |
ifeq (${OS_TYPE},Linux)
|
|
|
50 |
ERL_TOP=/opt/OTP_SRC
|
|
|
51 |
TARGET=i686-pc-linux-gnu
|
|
|
52 |
endif
|
|
|
53 |
|
|
|
54 |
ERLANG_OTP=/usr/local/erlang/otp
|
|
|
55 |
VAR_OTP=/var/otp
|
|
|
56 |
|
|
|
57 |
|
|
|
58 |
# Aliases for common binaries
|
|
|
59 |
# Note - CFLAGS is modified in erlang.conf
|
|
|
60 |
|
|
|
61 |
|
|
|
62 |
################################
|
|
|
63 |
# SunOS
|
|
|
64 |
################################
|
|
|
65 |
ifeq (${OS_TYPE},SunOS)
|
|
|
66 |
|
|
|
67 |
CC=gcc
|
|
|
68 |
CXX=g++
|
|
|
69 |
AR=/usr/ccs/bin/ar
|
|
|
70 |
ARFLAGS=-rv
|
|
|
71 |
CXXFLAGS+=${CFLAGS} -I/usr/include/g++
|
|
|
72 |
LD=/usr/ccs/bin/ld
|
|
|
73 |
RANLIB=/usr/ccs/bin/ranlib
|
|
|
74 |
|
|
|
75 |
CFLAGS+=-Wall -pedantic -ansi -O
|
|
|
76 |
CORE=*.core
|
|
|
77 |
endif
|
|
|
78 |
|
|
|
79 |
|
|
|
80 |
################################
|
|
|
81 |
# FreeBSD
|
|
|
82 |
################################
|
|
|
83 |
ifeq (${OS_TYPE},FreeBSD)
|
|
|
84 |
|
|
|
85 |
ifdef LINUXBIN
|
|
|
86 |
COMPAT_LINUX=/compat/linux
|
|
|
87 |
CC=${COMPAT_LINUX}/usr/bin/gcc
|
|
|
88 |
CXX=${COMPAT_LINUX}/usr/bin/g++
|
|
|
89 |
AR=${COMPAT_LINUX}/usr/bin/ar
|
|
|
90 |
ARFLAGS=-rv
|
|
|
91 |
CXXFLAGS+=-fhandle-exceptions ${CFLAGS} -I${COMPAT_LINUX}/usr/include/g++
|
|
|
92 |
LD=${COMPAT_LINUX}/usr/bin/ld
|
|
|
93 |
RANLIB=${COMPAT_LINUX}/usr/bin/ranlib
|
|
|
94 |
BRANDELF=brandelf -t Linux
|
|
|
95 |
else
|
|
|
96 |
CC=gcc
|
|
|
97 |
CXX=g++
|
|
|
98 |
AR=/usr/bin/ar
|
|
|
99 |
ARFLAGS=-rv
|
|
|
100 |
CXXFLAGS+=-fhandle-exceptions ${CFLAGS} -I/usr/include/g++
|
|
|
101 |
LD=/usr/bin/ld
|
|
|
102 |
RANLIB=/usr/bin/ranlib
|
|
|
103 |
BRANDELF=@true
|
|
|
104 |
|
|
|
105 |
ifdef USES_PTHREADS
|
|
|
106 |
CFLAGS+=-D_THREAD_SAFE
|
|
|
107 |
LDFLAGS+=-lc_r
|
|
|
108 |
|
|
|
109 |
# -pthread flag for 3.0+
|
|
|
110 |
ifneq (${shell uname -r | cut -d. -f1},2)
|
|
|
111 |
CFLAGS+=-pthread
|
|
|
112 |
endif
|
|
|
113 |
endif
|
|
|
114 |
endif
|
|
|
115 |
|
|
|
116 |
CFLAGS+=-Wall -pedantic -ansi -O -DFREEBSD
|
|
|
117 |
CORE=*.core
|
|
|
118 |
endif
|
|
|
119 |
|
|
|
120 |
################################
|
|
|
121 |
# OpenBSD
|
|
|
122 |
################################
|
|
|
123 |
ifeq (${OS_TYPE},OpenBSD)
|
|
|
124 |
|
|
|
125 |
CC=gcc
|
|
|
126 |
CXX=g++
|
|
|
127 |
AR=/usr/bin/ar
|
|
|
128 |
ARFLAGS=-rv
|
|
|
129 |
CXXFLAGS+=${CFLAGS} -I/usr/include/g++
|
|
|
130 |
LD=/usr/bin/ld
|
|
|
131 |
RANLIB=/usr/bin/ranlib
|
|
|
132 |
|
|
|
133 |
ifdef USES_PTHREADS
|
|
|
134 |
CFLAGS+=-D_THREAD_SAFE
|
|
|
135 |
LDFLAGS+=-lc_r
|
|
|
136 |
|
|
|
137 |
# -pthread flag for 3.0+
|
|
|
138 |
ifneq (${shell uname -r | cut -d. -f1},2)
|
|
|
139 |
CFLAGS+=-pthread
|
|
|
140 |
endif
|
|
|
141 |
endif
|
|
|
142 |
|
|
|
143 |
CFLAGS+=-Wall -pedantic -ansi -O -DOPENBSD
|
|
|
144 |
CORE=*.core
|
|
|
145 |
endif
|
|
|
146 |
|