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 line to enable integrated game engine
41 #CFLAGS += -DGAMEBLENDER=1
44 CFLAGS += $(NAN_DEBUG)
45 CCFLAGS += $(NAN_DEBUG)
48 REL_CFLAGS += -DNDEBUG
49 REL_CCFLAGS += -DNDEBUG
53 # OS dependent parts ---------------------------------------------------
74 CCFLAGS += -pipe -fPIC
77 CPPFLAGS += -D_THREAD_SAFE
79 OPENGL_HEADERS = /System/Library/Frameworks/OpenGL.framework
92 CCFLAGS += -pipe -fPIC
95 CPPFLAGS += -D_THREAD_SAFE
97 OPENGL_HEADERS = /usr/X11R6/include
98 JAVA_HEADERS = /usr/local/jdk1.3.1/include
99 JAVA_SYSTEM_HEADERS = /usr/local/jdk1.3.1/include/freebsd
108 CFLAGS += -n32 -mips3 -Xcpluscomm
109 CCFLAGS += -n32 -mips3 -Xcpluscomm -LANG:std
110 REL_CFLAGS += -O2 -OPT:Olimit=0
111 REL_CCFLAGS += -O2 -OPT:Olimit=0
112 OPENGL_HEADERS = /usr/include
116 ARFLAGSQUIET = -ar -o
123 CFLAGS += -pipe -fPIC
124 CCFLAGS += -pipe -fPIC
132 OPENGL_HEADERS = /usr/X11R6/include
141 CFLAGS += -pipe -fPIC
142 CCFLAGS += -pipe -fPIC
146 CPPFLAGS += -D__FreeBSD__
147 OPENGL_HEADERS = /usr/X11R6/include
158 CFLAGS += -pipe -fPIC
159 CCFLAGS += -pipe -fPIC
164 OPENGL_HEADERS = /usr/openwin/share/include
165 CPPFLAGS += -DSUN_OGL_NO_VERTEX_MACROS
166 JAVA_HEADERS = /usr/java/include
167 JAVA_SYSTEM_HEADERS = /usr/java/include/solaris
169 OPENGL_HEADERS = /usr/local/include
177 CC = $(SRCHOME)/tools/cygwin/cl_wrapper.pl
178 CCC = $(SRCHOME)/tools/cygwin/cl_wrapper.pl
179 JAVAC = $(SRCHOME)/tools/cygwin/java_wrapper.pl -c
180 JAVAH = $(SRCHOME)/tools/cygwin/java_wrapper.pl -h
182 REL_CCFLAGS += /O2 -GX
183 DBG_CFLAGS += /Fd$(DIR)/debug/
184 DBG_CCFLAGS += /Fd$(DIR)/debug/
189 CPPFLAGS += -DWIN32 -D_WIN32 -D__WIN32
190 CPPFLAGS += -D_M_IX86
191 CPPFLAGS += -I"/cygdrive/c/Program Files/Microsoft Visual Studio/VC98/include"
192 JAVA_HEADERS = /cygdrive/c/j2sdk1.4.0-beta3/include
193 JAVA_SYSTEM_HEADERS = /cygdrive/c/j2sdk1.4.0-beta3/include/win32
194 CPP = $(SRCHOME)/tools/cygwin/cl_wrapper.pl
198 WINRC = $(wildcard *.rc)
201 ifeq (debug, $(findstring debug, $(MAKECMDGOALS)))
202 export DEBUG_DIR=debug/
205 ifneq (x$(DEBUG_DIR), x)
206 CFLAGS +=$(DBG_CFLAGS)
207 CCFLAGS+=$(DBG_CCFLAGS)
209 CFLAGS +=$(REL_CFLAGS)
210 CCFLAGS+=$(REL_CCFLAGS)
213 # Note: include nan_warn's LEVEL_*_WARNINGS after CC/OS have been set.
220 $(DIR)/$(DEBUG_DIR)%.o: %.c
222 @set -e; $(CC) -M $(CPPFLAGS) $< 2>/dev/null \
223 | sed 's@\($*\)\.o[ :]*@$(DIR)/$(DEBUG_DIR)\1.o : @g' \
224 > $(DIR)/$(DEBUG_DIR)$*.d; \
225 [ -s $(DIR)/$(DEBUG_DIR)$*.d ] || $(RM) $(DIR)/$(DEBUG_DIR)$*.d
229 @$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
231 $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
234 $(DIR)/$(DEBUG_DIR)%.o: %.cpp
236 @set -e; $(CCC) -M $(CPPFLAGS) $< 2>/dev/null \
237 | sed 's@\($*\)\.o[ :]*@$(DIR)/$(DEBUG_DIR)\1.o : @g' \
238 > $(DIR)/$(DEBUG_DIR)$*.d; \
239 [ -s $(DIR)/$(DEBUG_DIR)$*.d ] || $(RM) $(DIR)/$(DEBUG_DIR)$*.d
243 @$(CCC) -c $(CCFLAGS) $(CPPFLAGS) $< -o $@
245 $(CCC) -c $(CCFLAGS) $(CPPFLAGS) $< -o $@
248 $(DIR)/$(DEBUG_DIR)%.res: %.rc
249 $(SRCHOME)/tools/cygwin/cl_wrapper.pl - rc /fo$@ $<
251 $(DIR)/$(DEBUG_DIR)%.class: %.java
253 $(JAVAC) -verbose -g -deprecation -sourcepath . -classpath "$(JARS)" -d $(DIR)/$(DEBUG_DIR) $<
255 $(JAVAC) -verbose -g -deprecation -d $(DIR)/$(DEBUG_DIR) $<
258 $(DIR)/$(DEBUG_DIR)%.h: $(DIR)/$(DEBUG_DIR)%.class
259 $(JAVAH) -classpath $(DIR)/$(DEBUG_DIR) -d $(DIR)/$(DEBUG_DIR) -jni $*
262 @echo "WARNING: Fake header creation rule used, dependencies will be remade"
264 CSRCS ?= $(wildcard *.c)
265 CCSRCS ?= $(wildcard *.cpp)
266 JSRCS ?= $(wildcard *.java)
269 -include $(CSRCS:%.c=$(DIR)/$(DEBUG_DIR)%.d) $(CCSRCS:%.cpp=$(DIR)/$(DEBUG_DIR)%.d)
272 OBJS += $(CSRCS:%.c=$(DIR)/$(DEBUG_DIR)%.o)
273 OBJS += $(CCSRCS:%.cpp=$(DIR)/$(DEBUG_DIR)%.o)
274 OBJS += $(WINRC:%.rc=$(DIR)/$(DEBUG_DIR)%.res)
276 JCLASS += $(JSRCS:%.java=$(DIR)/$(DEBUG_DIR)%.class)
278 LIB_a = $(DIR)/$(DEBUG_DIR)lib$(LIBNAME).a
281 # $OBJS can be empty except for some spaces
282 ifneq (x, x$(strip $(OBJS)))
286 @echo " -- lib: lib$(LIBNAME).a -- "
287 @$(AR) $(ARFLAGSQUIET) $@ $(OBJS)
289 $(AR) $(ARFLAGS) $@ $(OBJS)
293 @echo " -- lib: lib$(LIBNAME).a -- "
294 @$(AR) $(ARFLAGSQUIET) $@ $?
296 $(AR) $(ARFLAGS) $@ $?
304 ALLTARGETS ?= $(LIB_a)
306 all debug :: makedir $(ALLTARGETS)
311 @echo "====> make creator subtarget in `pwd | sed 's/^.*develop\///'`"
312 @$(MAKE) makedir DIR=$(DIR)/$(DEBUG_DIR)cre
313 @$(MAKE) lib CSRCS="$(CRE_CSRCS)" LIBNAME=$(LIBNAME)$@
316 @echo "====> make publisher subtarget in `pwd | sed 's/^.*develop\///'`"
317 @$(MAKE) makedir DIR=$(DIR)/$(DEBUG_DIR)pub
318 @$(MAKE) lib CSRCS="$(PUB_CSRCS)" LIBNAME=$(LIBNAME)$@
321 @echo "====> make player subtarget in `pwd | sed 's/^.*develop\///'`"
322 @$(MAKE) makedir DIR=$(DIR)/player/$(DEBUG_DIR)
323 @$(MAKE) lib CSRCS="$(SAP_CSRCS)" LIBNAME=$(LIBNAME)$@
325 clean:: optclean debugclean
328 @-[ ! -d $(DIR) ] || ( cd $(DIR) && \
329 $(RM) *.o *.a *.d *.res ii_files/*.ii *.class *.h )
332 @-[ ! -d $(DIR)/debug ] || ( cd $(DIR)/debug && \
333 $(RM) *.o *.a *.d *.res ii_files/*.ii *.class *.h )
337 @# don't use mkdir -p. Cygwin will try to make network paths and fail
338 @[ -d $(DIR) ] || mkdir $(DIR)
339 @[ -d $(DIR)/debug ] || mkdir $(DIR)/debug