1 # -*- Mode: makefile -*-
3 # ***** BEGIN LICENSE BLOCK *****
4 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 # The contents of this file are subject to the Mozilla Public License Version
7 # 1.1 (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
9 # http://www.mozilla.org/MPL/
11 # Software distributed under the License is distributed on an "AS IS" basis,
12 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 # for the specific language governing rights and limitations under the
16 # The Original Code is Mozilla Communicator client code, released
19 # The Initial Developer of the Original Code is
20 # Netscape Communications Corporation.
21 # Portions created by the Initial Developer are Copyright (C) 1998-1999
22 # the Initial Developer. All Rights Reserved.
26 # Alternatively, the contents of this file may be used under the terms of
27 # either of the GNU General Public License Version 2 or later (the "GPL"),
28 # or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 # in which case the provisions of the GPL or the LGPL are applicable instead
30 # of those above. If you wish to allow use of your version of this file only
31 # under the terms of either the GPL or the LGPL, and not to allow others to
32 # use your version of this file under the terms of the MPL, indicate your
33 # decision by deleting the provisions above and replace them with the notice
34 # and other provisions required by the GPL or the LGPL. If you do not delete
35 # the provisions above, a recipient may use your version of this file under
36 # the terms of any one of the MPL, the GPL or the LGPL.
38 # ***** END LICENSE BLOCK *****
43 DIST = $(DEPTH)/../../dist
46 # Set os+release dependent make variables
47 OS_ARCH := $(subst /,_,$(shell uname -s | sed /\ /s//_/))
49 # Attempt to differentiate between SunOS 5.4 and x86 5.4
50 OS_CPUARCH := $(shell uname -m)
51 ifeq ($(OS_CPUARCH),i86pc)
52 OS_RELEASE := $(shell uname -r)_$(OS_CPUARCH)
55 OS_RELEASE := $(shell uname -v).$(shell uname -r)
57 OS_RELEASE := $(shell uname -r)
60 ifeq ($(OS_ARCH),IRIX64)
64 # Handle output from win32 unames other than Netscape's version
65 ifeq (,$(filter-out Windows_95 Windows_98 CYGWIN_95-4.0 CYGWIN_98-4.10, $(OS_ARCH)))
68 ifeq ($(OS_ARCH),WIN95)
72 ifeq ($(OS_ARCH), Windows_NT)
74 OS_MINOR_RELEASE := $(shell uname -v)
75 ifeq ($(OS_MINOR_RELEASE),00)
78 OS_RELEASE := $(OS_RELEASE).$(OS_MINOR_RELEASE)
80 ifeq (CYGWIN_NT,$(findstring CYGWIN_NT,$(OS_ARCH)))
81 OS_RELEASE := $(patsubst CYGWIN_NT-%,%,$(OS_ARCH))
84 ifeq ($(OS_ARCH), CYGWIN32_NT)
87 ifeq (MINGW32_NT,$(findstring MINGW32_NT,$(OS_ARCH)))
88 OS_RELEASE := $(patsubst MINGW32_NT-%,%,$(OS_ARCH))
92 # Virtually all Linux versions are identical.
93 # Any distinctions are handled in linux.h
94 ifeq ($(OS_ARCH),Linux)
95 OS_CONFIG := Linux_All
97 ifeq ($(OS_ARCH),dgux)
100 ifeq ($(OS_ARCH),Darwin)
103 ifeq ($(OS_ARCH),Darwin64)
104 OS_CONFIG := Darwin64
106 OS_CONFIG := $(OS_ARCH)$(OS_OBJTYPE)$(OS_RELEASE)
115 ifeq ($(OS_ARCH), WINNT)
119 INSTALL = $(DIST)/bin/nsinstall
126 INTERP_OPTIMIZER = -O2 -GL
127 BUILTINS_OPTIMIZER = -O2 -GL
130 OPTIMIZER = -Os -fno-exceptions -fno-rtti -fstrict-aliasing -Wstrict-aliasing=3
131 BUILTINS_OPTIMIZER = -O9 -fno-exceptions -fno-rtti -fstrict-aliasing
132 INTERP_OPTIMIZER = -O3 -fno-exceptions -fno-rtti -fstrict-aliasing
134 DEFINES += -UDEBUG -DNDEBUG -UDEBUG_$(USER)
139 INTERP_OPTIMIZER = -Zi
140 BUILTINS_OPTIMIZER = $(INTERP_OPTIMIZER)
142 OPTIMIZER = -g3 -fstrict-aliasing -fno-exceptions -fno-rtti -Wstrict-aliasing=3
143 INTERP_OPTIMIZER = -g3 -fstrict-aliasing -fno-exceptions -fno-rtti
144 BUILTINS_OPTIMIZER = $(INTERP_OPTIMIZER)
146 DEFINES += -DDEBUG -DDEBUG_$(USER)
154 include $(DEPTH)/ref-config/$(OS_CONFIG).mk
164 ifndef HOST_BIN_SUFFIX
165 ifeq ($(OS_ARCH),WINNT)
166 HOST_BIN_SUFFIX = .exe
172 # Name of the binary code directories
174 # prepend $(DEPTH) to the root unless it is an absolute path
175 OBJDIR = $(if $(filter /%,$(OBJROOT)),$(OBJROOT),$(DEPTH)/$(OBJROOT))
178 OBJDIR = $(OS_CONFIG)$(OBJDIR_TAG).$(if $(BUILD_IDG),OBJD,OBJ)
180 OBJDIR = $(DEPTH)/$(OS_CONFIG)$(OBJDIR_TAG).$(if $(BUILD_IDG),OBJD,OBJ)
190 ifeq ($(CPU_ARCH), x86_64)