blob: 0e0381eca510a31145579da800918aa454c48721 [file] [log] [blame]
David Reiss77f6f7f2008-06-11 00:57:11 +00001# +----------------------------------------------------------------------+
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
16ERLANGDEV_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.
24OS_TYPE=${shell uname}
25
26# MHOST is the host where this Makefile runs.
27MHOST=${shell hostname -s}
David Reiss77f6f7f2008-06-11 00:57:11 +000028
29# The location of the erlang runtime system.
30ifndef ERL_RUN_TOP
31ERL_RUN_TOP=/usr/local/lib/erlang
32endif
33
34
35# Edit to reflect local environment.
36# ifeq (${OS_TYPE},Linux)
37# ERL_RUN_TOP=/usr/local/lib/erlang
38# Note* ERL_RUN_TOP can be determined by starting an
39# erlang shell and typing code:root_dir().
40# ERL_TOP=a symbolic link to the actual source top, which changes from version to version
41# Note* ERL_TOP is the directory where the erlang
42# source files reside. Make sure to run ./configure there.
43# TARGET=i686-pc-linux-gnu
44# Note* Target can be found in $ERL_TOP/erts
45# endif
46
47# See above for directions.
48ifeq (${OS_TYPE},Linux)
49ERL_TOP=/opt/OTP_SRC
50TARGET=i686-pc-linux-gnu
51endif
52
53ERLANG_OTP=/usr/local/erlang/otp
54VAR_OTP=/var/otp
55
56
57# Aliases for common binaries
58# Note - CFLAGS is modified in erlang.conf
59
60
61################################
62# SunOS
63################################
64ifeq (${OS_TYPE},SunOS)
65
66 CC=gcc
67 CXX=g++
68 AR=/usr/ccs/bin/ar
69 ARFLAGS=-rv
70 CXXFLAGS+=${CFLAGS} -I/usr/include/g++
71 LD=/usr/ccs/bin/ld
72 RANLIB=/usr/ccs/bin/ranlib
73
74CFLAGS+=-Wall -pedantic -ansi -O
75CORE=*.core
76endif
77
78
79################################
80# FreeBSD
81################################
82ifeq (${OS_TYPE},FreeBSD)
83
84 ifdef LINUXBIN
85 COMPAT_LINUX=/compat/linux
86 CC=${COMPAT_LINUX}/usr/bin/gcc
87 CXX=${COMPAT_LINUX}/usr/bin/g++
88 AR=${COMPAT_LINUX}/usr/bin/ar
89 ARFLAGS=-rv
90 CXXFLAGS+=-fhandle-exceptions ${CFLAGS} -I${COMPAT_LINUX}/usr/include/g++
91 LD=${COMPAT_LINUX}/usr/bin/ld
92 RANLIB=${COMPAT_LINUX}/usr/bin/ranlib
93 BRANDELF=brandelf -t Linux
94 else
95 CC=gcc
96 CXX=g++
97 AR=/usr/bin/ar
98 ARFLAGS=-rv
99 CXXFLAGS+=-fhandle-exceptions ${CFLAGS} -I/usr/include/g++
100 LD=/usr/bin/ld
101 RANLIB=/usr/bin/ranlib
102 BRANDELF=@true
103
104 ifdef USES_PTHREADS
105 CFLAGS+=-D_THREAD_SAFE
106 LDFLAGS+=-lc_r
107
108 # -pthread flag for 3.0+
109 ifneq (${shell uname -r | cut -d. -f1},2)
110 CFLAGS+=-pthread
111 endif
112 endif
113 endif
114
115CFLAGS+=-Wall -pedantic -ansi -O -DFREEBSD
116CORE=*.core
117endif
118
119################################
120# OpenBSD
121################################
122ifeq (${OS_TYPE},OpenBSD)
123
124 CC=gcc
125 CXX=g++
126 AR=/usr/bin/ar
127 ARFLAGS=-rv
128 CXXFLAGS+=${CFLAGS} -I/usr/include/g++
129 LD=/usr/bin/ld
130 RANLIB=/usr/bin/ranlib
131
132 ifdef USES_PTHREADS
133 CFLAGS+=-D_THREAD_SAFE
134 LDFLAGS+=-lc_r
135
136 # -pthread flag for 3.0+
137 ifneq (${shell uname -r | cut -d. -f1},2)
138 CFLAGS+=-pthread
139 endif
140 endif
141
142CFLAGS+=-Wall -pedantic -ansi -O -DOPENBSD
143CORE=*.core
144endif
145