4 # ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version. The Blender
10 # Foundation also sells licenses for use in proprietary software under
11 # the Blender License. See http://www.blender.org/BL/ for information
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software Foundation,
21 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
24 # All rights reserved.
26 # The Original Code is: all of this file.
28 # Contributor(s): none yet.
30 # ***** END GPL/BL DUAL LICENSE BLOCK *****
34 include nan_definitions.mk
36 CPPFLAGS ?= $(NAN_CPPFLAGS)
38 # common parts ---------------------------------------------------
40 # Uncomment next lines to enable integrated game engine
41 CFLAGS += -DGAMEBLENDER=1
42 CFLAGS += -DUSE_SUMO_SOLID
43 CCFLAGS += -DUSE_SUMO_SOLID
46 CFLAGS += $(NAN_DEBUG)
47 CCFLAGS += $(NAN_DEBUG)
50 REL_CFLAGS += -DNDEBUG
51 REL_CCFLAGS += -DNDEBUG
55 # Is the game engine getting you down? ---------------------------------
57 ifeq ($(NAN_NO_KETSJI), true)
58 CPPFLAGS += -DNO_KETSJI
61 # OS dependent parts ---------------------------------------------------
81 CFLAGS += -pipe -fPIC -ffast-math -mcpu=7450 -mtune=7450
82 CCFLAGS += -pipe -fPIC
85 CPPFLAGS += -D_THREAD_SAFE
87 OPENGL_HEADERS = /System/Library/Frameworks/OpenGL.framework
100 CCFLAGS += -pipe -fPIC
103 CPPFLAGS += -D_THREAD_SAFE
105 OPENGL_HEADERS = /usr/X11R6/include
106 JAVA_HEADERS = /usr/local/jdk1.3.1/include
107 JAVA_SYSTEM_HEADERS = /usr/local/jdk1.3.1/include/freebsd
116 CFLAGS += -n32 -mips3 -Xcpluscomm
117 CCFLAGS += -n32 -mips3 -Xcpluscomm -LANG:std
118 CCFLAGS += -LANG:libc_in_namespace_std=off
119 REL_CFLAGS += -n32 -mips3 -O2 -OPT:Olimit=0
120 REL_CCFLAGS += -n32 -mips3 -O2 -OPT:Olimit=0
121 OPENGL_HEADERS = /usr/include
125 ARFLAGSQUIET = -ar -o
132 CFLAGS += -pipe -fPIC
133 CCFLAGS += -pipe -fPIC
141 OPENGL_HEADERS = /usr/X11R6/include
150 CFLAGS += -pipe -fPIC
151 CCFLAGS += -pipe -fPIC
155 CPPFLAGS += -D__FreeBSD__
156 OPENGL_HEADERS = /usr/X11R6/include
167 CFLAGS += -pipe -fPIC
168 CCFLAGS += -pipe -fPIC
173 OPENGL_HEADERS = /usr/openwin/share/include
174 CPPFLAGS += -DSUN_OGL_NO_VERTEX_MACROS
175 JAVA_HEADERS = /usr/java/include
176 JAVA_SYSTEM_HEADERS = /usr/java/include/solaris
178 OPENGL_HEADERS = /usr/local/include
186 ifeq ($(FREE_WINDOWS),true)
189 CFLAGS += -pipe -mno-cygwin -mwindows
190 CCFLAGS += -pipe -mno-cygwin -mwindows
191 CPPFLAGS += -DFREE_WINDOWS
195 #OPENGL_HEADERS = /usr/include/w32api
200 WINRC = $(wildcard *.rc)
203 CC = $(SRCHOME)/tools/cygwin/cl_wrapper.pl
204 CCC = $(SRCHOME)/tools/cygwin/cl_wrapper.pl
205 JAVAC = $(SRCHOME)/tools/cygwin/java_wrapper.pl -c
206 JAVAH = $(SRCHOME)/tools/cygwin/java_wrapper.pl -h
208 REL_CCFLAGS += /O2 -GX
209 DBG_CFLAGS += /Fd$(DIR)/debug/
210 DBG_CCFLAGS += /Fd$(DIR)/debug/
215 CPPFLAGS += -DWIN32 -D_WIN32 -D__WIN32
216 CPPFLAGS += -D_M_IX86
217 CPPFLAGS += -I"/cygdrive/c/Program Files/Microsoft Visual Studio/VC98/include"
218 JAVA_HEADERS = /cygdrive/c/j2sdk1.4.0-beta3/include
219 JAVA_SYSTEM_HEADERS = /cygdrive/c/j2sdk1.4.0-beta3/include/win32
220 CPP = $(SRCHOME)/tools/cygwin/cl_wrapper.pl
224 WINRC = $(wildcard *.rc)
228 ifeq (debug, $(findstring debug, $(MAKECMDGOALS)))
229 export DEBUG_DIR=debug/
232 ifneq (x$(DEBUG_DIR), x)
233 CFLAGS +=$(DBG_CFLAGS)
234 CCFLAGS+=$(DBG_CCFLAGS)
236 CFLAGS +=$(REL_CFLAGS)
237 CCFLAGS+=$(REL_CCFLAGS)
240 # Note: include nan_warn's LEVEL_*_WARNINGS after CC/OS have been set.
247 $(DIR)/$(DEBUG_DIR)%.o: %.c
249 @set -e; $(CC) -M $(CPPFLAGS) $< 2>/dev/null \
250 | sed 's@\($*\)\.o[ :]*@$(DIR)/$(DEBUG_DIR)\1.o : @g' \
251 > $(DIR)/$(DEBUG_DIR)$*.d; \
252 [ -s $(DIR)/$(DEBUG_DIR)$*.d ] || $(RM) $(DIR)/$(DEBUG_DIR)$*.d
256 @$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
258 $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
261 $(DIR)/$(DEBUG_DIR)%.o: %.cpp
263 @set -e; $(CCC) -M $(CPPFLAGS) $< 2>/dev/null \
264 | sed 's@\($*\)\.o[ :]*@$(DIR)/$(DEBUG_DIR)\1.o : @g' \
265 > $(DIR)/$(DEBUG_DIR)$*.d; \
266 [ -s $(DIR)/$(DEBUG_DIR)$*.d ] || $(RM) $(DIR)/$(DEBUG_DIR)$*.d
270 @$(CCC) -c $(CCFLAGS) $(CPPFLAGS) $< -o $@
272 $(CCC) -c $(CCFLAGS) $(CPPFLAGS) $< -o $@
275 $(DIR)/$(DEBUG_DIR)%.res: %.rc
276 ifeq ($(FREE_WINDOWS),true)
277 windres $< -O coff -o $@
279 $(SRCHOME)/tools/cygwin/cl_wrapper.pl - rc /fo$@ $<
282 $(DIR)/$(DEBUG_DIR)%.class: %.java
284 $(JAVAC) -verbose -g -deprecation -sourcepath . -classpath "$(JARS)" -d $(DIR)/$(DEBUG_DIR) $<
286 $(JAVAC) -verbose -g -deprecation -d $(DIR)/$(DEBUG_DIR) $<
289 $(DIR)/$(DEBUG_DIR)%.h: $(DIR)/$(DEBUG_DIR)%.class
290 $(JAVAH) -classpath $(DIR)/$(DEBUG_DIR) -d $(DIR)/$(DEBUG_DIR) -jni $*
293 @echo "WARNING: Fake header creation rule used, dependencies will be remade"
295 CSRCS ?= $(wildcard *.c)
296 CCSRCS ?= $(wildcard *.cpp)
297 JSRCS ?= $(wildcard *.java)
300 -include $(CSRCS:%.c=$(DIR)/$(DEBUG_DIR)%.d) $(CCSRCS:%.cpp=$(DIR)/$(DEBUG_DIR)%.d)
303 OBJS += $(CSRCS:%.c=$(DIR)/$(DEBUG_DIR)%.o)
304 OBJS += $(CCSRCS:%.cpp=$(DIR)/$(DEBUG_DIR)%.o)
305 OBJS += $(WINRC:%.rc=$(DIR)/$(DEBUG_DIR)%.res)
307 JCLASS += $(JSRCS:%.java=$(DIR)/$(DEBUG_DIR)%.class)
309 LIB_a = $(DIR)/$(DEBUG_DIR)lib$(LIBNAME).a
312 # $OBJS can be empty except for some spaces
313 ifneq (x, x$(strip $(OBJS)))
317 @echo " -- lib: lib$(LIBNAME).a -- "
318 @$(AR) $(ARFLAGSQUIET) $@ $(OBJS)
320 $(AR) $(ARFLAGS) $@ $(OBJS)
324 @echo " -- lib: lib$(LIBNAME).a -- "
325 @$(AR) $(ARFLAGSQUIET) $@ $?
327 $(AR) $(ARFLAGS) $@ $?
335 ALLTARGETS ?= $(LIB_a)
337 all debug :: makedir $(ALLTARGETS)
342 @echo "====> make creator subtarget in `pwd | sed 's/^.*develop\///'`"
343 @$(MAKE) makedir DIR=$(DIR)/$(DEBUG_DIR)cre
344 @$(MAKE) lib CSRCS="$(CRE_CSRCS)" LIBNAME=$(LIBNAME)$@
347 @echo "====> make publisher subtarget in `pwd | sed 's/^.*develop\///'`"
348 @$(MAKE) makedir DIR=$(DIR)/$(DEBUG_DIR)pub
349 @$(MAKE) lib CSRCS="$(PUB_CSRCS)" LIBNAME=$(LIBNAME)$@
352 @echo "====> make player subtarget in `pwd | sed 's/^.*develop\///'`"
353 @$(MAKE) makedir DIR=$(DIR)/player/$(DEBUG_DIR)
354 @$(MAKE) lib CSRCS="$(SAP_CSRCS)" LIBNAME=$(LIBNAME)$@
356 clean:: optclean debugclean
359 @-[ ! -d $(DIR) ] || ( cd $(DIR) && \
360 $(RM) *.o *.a *.d *.res ii_files/*.ii *.class *.h )
363 @-[ ! -d $(DIR)/debug ] || ( cd $(DIR)/debug && \
364 $(RM) *.o *.a *.d *.res ii_files/*.ii *.class *.h )
368 @# don't use mkdir -p. Cygwin will try to make network paths and fail
369 @[ -d $(DIR) ] || mkdir $(DIR)
370 @[ -d $(DIR)/debug ] || mkdir $(DIR)/debug