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