4 # ***** BEGIN GPL 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.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software Foundation,
18 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 # Contributor(s): Blender Foundation (2008).
22 # ***** END GPL LICENSE BLOCK *****
26 DIR = $(OCGDIR)/blender/makesrna
28 ALLRNA = $(wildcard rna_*.c)
29 DEFRNA = $(filter-out %rna_define.c, $(filter-out %rna_access.c, $(ALLRNA)))
31 GENRNA = $(filter-out %_api.c, $(DEFRNA))
32 GENSRCS = $(patsubst rna_%.c, rna_%_gen.c, $(GENRNA))
33 GENTARGET = $(patsubst %.c, $(DIR)/$(DEBUG_DIR)%.c, $(GENSRCS))
35 MAKESRCS = $(DEFRNA) makesrna.c rna_define.c
36 MAKEOBJS = $(patsubst %.c, $(DIR)/$(DEBUG_DIR)%.o, $(notdir $(MAKESRCS)))
38 CSRCS = $(GENSRCS) rna_access.c
40 include nan_compile.mk
43 -include $(MAKESRCS:%.c=$(DIR)/$(DEBUG_DIR)%.d)
46 CFLAGS += $(LEVEL_1_C_WARNINGS)
48 CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
49 CPPFLAGS += -I../../blenlib
50 CPPFLAGS += -I../../blenkernel
51 CPPFLAGS += -I../../imbuf
52 CPPFLAGS += -I../../makesdna
53 CPPFLAGS += -I../../windowmanager
54 CPPFLAGS += -I../../editors/include
58 ifeq ($(WITH_FFMPEG),true)
59 CPPFLAGS += -DWITH_FFMPEG
60 CPPFLAGS += $(NAN_FFMPEGCFLAGS)
63 ifeq ($(WITH_OPENEXR), true)
64 CPPFLAGS += -DWITH_OPENEXR
67 ifeq ($(WITH_DDS), true)
68 CPPFLAGS += -DWITH_DDS
71 ifeq ($(WITH_OPENJPEG), true)
72 CPPFLAGS += -DWITH_OPENJPEG
75 ifeq ($(WITH_QUICKTIME), true)
76 CPPFLAGS += -DWITH_QUICKTIME
80 # Windows needs these extra libs because of winstuff... It is not
81 # _really_ needed, but it is the easiest fix for now. If you have
82 # some spare time, try to trace down the exact dep.
83 ifneq ($(FREE_WINDOWS),true)
84 WINLIBS = kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
85 WINLIBS += advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
86 WINLIBS += winmm.lib opengl32.lib glu32.lib largeint.lib
87 WINLIBS += /link /nodefaultlib:libc
89 LDFLAGS += -mwindows -mno-cygwin
94 @$(RM) $(DIR)/makesrna* $(DIR)/rna*
95 @$(RM) $(DIR)/debug/makesrna* $(DIR)/debug/rna*
97 # TODO include right .mk for ldflags
99 # A small note: we do not use the debug version of the alloc lib. That
100 # is done quite intentionally. If there is a bug in that lib, it needs
101 # to be fixed by the module maintainer.
103 $(DIR)/$(DEBUG_DIR)makesrna: $(MAKEOBJS) $(OCGDIR)/blender/makesdna/$(DEBUG_DIR)libdna.a $(NAN_GUARDEDALLOC)/lib/libguardedalloc.a
104 $(CC) $(LDFLAGS) -o $@ $(WINLIBS) $^
106 $(DIR)/$(DEBUG_DIR)rna_phony_gen.c: $(DIR)/$(DEBUG_DIR)makesrna
108 $(SRCHOME)/tools/cygwin/cl_wrapper.pl - $(DIR)/$(DEBUG_DIR)makesrna \
111 $(DIR)/$(DEBUG_DIR)makesrna $(DIR)/$(DEBUG_DIR)
115 $(GENTARGET): $(DIR)/$(DEBUG_DIR)rna_phony_gen.c
117 $(DIR)/$(DEBUG_DIR)makesrna.o: makesrna.c $(wildcard rna_*.c)
118 $(CC) -c $(CFLAGS) $(CPPFLAGS) makesrna.c -o $@