3
3
include $(MODULE_TOPDIR)/include/Make/Lib.make
5
SHLIB_LD = $(CXX) -shared
5
ifeq ($(findstring darwin,$(ARCH)),darwin)
6
ifneq ($(WX_ISOSX64BIT),1)
7
CFLAGS := $(subst -arch ppc64,,$(subst -arch x86_64,,$(CFLAGS)))
8
LDFLAGS := $(subst -arch ppc64,,$(subst -arch x86_64,,$(LDFLAGS)))
7
12
LIB_NAME = grass6_wxnviz
8
SOURCES := $(wildcard *.cpp) $(LIB_NAME)_wrap.cpp
9
SHLIB_OBJS := $(patsubst %.cpp, $(OBJDIR)/%.o, $(SOURCES))
11
EXTRA_CFLAGS = $(SHLIB_CFLAGS) $(GDALCFLAGS) $(PYTHONCFLAGS) $(WXWIDGETSCXXFLAGS) $(XCFLAGS) $(XMINC)
12
EXTRA_LIBS = $(GISLIB) $(OGSFLIB) $(NVIZLIB) $(OPENGLLIB) $(OPENGLULIB)
13
ifeq ($(findstring darwin,$(ARCH)),darwin)
14
EXTRA_LIBS := -bundle -undefined dynamic_lookup $(EXTRA_LIBS)
16
EXTRA_LIBS := $(PYTHONLDFLAGS) $(WXWIDGETSLIB) $(EXTRA_LIBS)
19
LOCAL_HEADERS = nviz.h
14
SHLIB = $(OBJDIR)/_$(LIB_NAME).so
21
16
ETCDIR = $(ETC)/wxpython
23
SHLIB = $(OBJDIR)/_$(LIB_NAME).so
25
EXTRA_CLEAN_FILES = $(SHLIB) $(LIB_NAME).i $(LIB_NAME).py $(LIB_NAME)_wrap.cpp
29
20
ifneq ($(USE_WXWIDGETS),)
41
32
echo "/* auto-generated swig typedef file */" >> $(LIB_NAME).i
42
33
cat nviz.h >> $(LIB_NAME).i
44
$(LIB_NAME).py $(LIB_NAME)_wrap.cpp: $(LIB_NAME).i
45
$(SWIG) -c++ -python -shadow -o $(LIB_NAME)_wrap.cpp $<
47
$(SHLIB): $(SHLIB_OBJS)
48
ifeq ($(findstring darwin,$(ARCH)),darwin)
49
$(CXX) -o $@ $(LDFLAGS) $^ $(EXTRA_LIBS)
51
$(SHLIB_LD) -o $@ $(LDFLAGS) $^ $(EXTRA_LIBS)
55
$(MAKE) $(ETCDIR)/nviz/_$(LIB_NAME).so $(ETCDIR)/nviz/$(LIB_NAME).py
35
$(LIB_NAME).py: $(SHLIB)
37
$(SHLIB): $(LIB_NAME).i
38
python setup.py build_ext --swig=$(SWIG) --swig-opts=-c++ --build-lib=$(OBJDIR) --build-temp=$(OBJDIR)
40
.NOTPARALLEL: $(LIB_NAME).py $(LIB_NAME)_wrap.cpp
42
install_nviz: $(ETCDIR)/nviz/_$(LIB_NAME).so $(ETCDIR)/nviz/$(LIB_NAME).py
57
44
$(ETCDIR)/nviz/_$(LIB_NAME).so: $(SHLIB)