blob: 1d16e2c83fadea7fffc901b02298f9172b647133 [file] [log] [blame]
Christopher Piro094823a2007-07-18 00:26:12 +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)
David Reiss0c90f6f2008-02-06 22:18:40 +000020# ERLANG_OTP is target root for Erlang code
Christopher Piro094823a2007-07-18 00:26:12 +000021# - see sasl/systools reference manual page; grep "TEST"
22
David Reiss0c90f6f2008-02-06 22:18:40 +000023# OS_TYPE is FreeBSD, NetBSD, OpenBSD, Linux, SCO_SV, SunOS.
Christopher Piro094823a2007-07-18 00:26:12 +000024OS_TYPE=${shell uname}
25
26# MHOST is the host where this Makefile runs.
27MHOST=${shell hostname -s}
28ERL_COMPILE_FLAGS+=-W0
29
30# The location of the erlang runtime system.
31ifndef ERL_RUN_TOP
32ERL_RUN_TOP=/usr/local/lib/erlang
33endif
34
35
36# Edit to reflect local environment.
37# ifeq (${OS_TYPE},Linux)
38# ERL_RUN_TOP=/usr/local/lib/erlang
David Reiss0c90f6f2008-02-06 22:18:40 +000039# Note* ERL_RUN_TOP can be determined by starting an
Christopher Piro094823a2007-07-18 00:26:12 +000040# erlang shell and typing code:root_dir().
41# ERL_TOP=a symbolic link to the actual source top, which changes from version to version
David Reiss0c90f6f2008-02-06 22:18:40 +000042# Note* ERL_TOP is the directory where the erlang
43# source files reside. Make sure to run ./configure there.
Christopher Piro094823a2007-07-18 00:26:12 +000044# TARGET=i686-pc-linux-gnu
45# Note* Target can be found in $ERL_TOP/erts
46# endif
47
48# See above for directions.
49ifeq (${OS_TYPE},Linux)
50ERL_TOP=/opt/OTP_SRC
51TARGET=i686-pc-linux-gnu
52endif
53
54ERLANG_OTP=/usr/local/erlang/otp
55VAR_OTP=/var/otp
56
57
58# Aliases for common binaries
59# Note - CFLAGS is modified in erlang.conf
60
61
62################################
63# SunOS
64################################
65ifeq (${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
David Reiss0c90f6f2008-02-06 22:18:40 +000075CFLAGS+=-Wall -pedantic -ansi -O
Christopher Piro094823a2007-07-18 00:26:12 +000076CORE=*.core
77endif
78
79
80################################
81# FreeBSD
82################################
83ifeq (${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
116CFLAGS+=-Wall -pedantic -ansi -O -DFREEBSD
117CORE=*.core
118endif
119
120################################
121# OpenBSD
122################################
123ifeq (${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
143CFLAGS+=-Wall -pedantic -ansi -O -DOPENBSD
144CORE=*.core
145endif
146