# $Id$ os=$(shell uname -s) PATH := $(PATH):/usr/lib/qt4/bin/:/usr/share/qt4/bin/ ifeq ($(os),Darwin) IVY_PATH := $(HOME)/src-ext/ivy-c-3.6/src CPPFLAGS = -MMD -I$(IVY_PATH) DSO_EXT = .dylib LD = g++ -dynamiclib -single_module LDFLAGS = -L$(IVY_PATH) -L/sw/lib -framework OpenGL -framework AGL -framework Carbon else PERHAPS64 := $(shell uname --machine | perl -ne "print /64/ ? '64' : '';") LIB:= lib$(PERHAPS64) XTLIB= -L/usr/$(LIB) -L/usr/X11R6/$(LIB) XTOPT= -DUSE_XT QTINC= -I/usr/include/qt4 -I/usr/include/qt4/QtGui -I/usr/lib/qt4/include -I/usr/lib/qt4/include/QtCore -I/usr/lib/qt4/include/QtGui QTOPT= -D_REENTRANT -DQT_SHARED QTLIB= -lQtGui -lQtCore -lpthread CPPFLAGS = -MMD -I/usr/X11R6/include -I/usr/local/include/Ivy DSO_EXT = .so LD = g++ -shared -fPIC #PREFIX=/usr/local ifndef PREFIX PREFIX=/usr LDFLAGS = -L$(PREFIX)/$(LIB) $(XTLIB) else LDFLAGS = -L$(PREFIX)/$(LIB)/ivy $(XTLIB) endif endif CASESENSITIVE = "yes" ifeq ($(CASESENSITIVE), "no") PCRE_OPT=PCRE_CASELESS REGCOMP_OPT=REG_ICASE else PCRE_OPT=0 REGCOMP_OPT=REG_EXTENDED endif REGEXP= -DUSE_PCRE_REGEX -DPCRE_OPT=$(PCRE_OPT) PCREINC = $(shell pcre-config --cflags) CXXFILES := Ivy.cxx IvyApplication.cxx OBJECTS := $(CXXFILES:.cxx=.o) DEPS := $(CXXFILES:.cxx=.d) CXXFILES_GLFW := Ivy_glfw.cxx IvyApplication.cxx OBJECTS_GLFW := $(CXXFILES_GLFW:.cxx=.o) DEPS_GLFW := $(CXXFILES_GLFW:.cxx=.d) CXXFILES_QT := Ivy.cxx IvyApplication.cxx ivyqtloop.cxx OBJECTS_QT := $(CXXFILES_QT:.cxx=.o) DEPS_QT := $(CXXFILES_QT:.cxx=.d) CXXFILES_XT := Ivy.cxx IvyApplication.cxx OBJECTS_XT := Ivy_Xt.o IvyApplication.o DEPS_XT := $(CXXFILES_XT:.cxx=.d) LD_QUICKSTART_INFO= GCXXINCS= LIBIVY = libIvy LIBIVY_GLFW = $(LIBIVY)_glfw LIBIVY_QT = $(LIBIVY)_Qt LIBIVY_XT = $(LIBIVY)_Xt LIBIVY_STATIC = $(LIBIVY).a LIBIVY_GLFW_STATIC = $(LIBIVY_GLFW).a LIBIVY_SHARED = $(LIBIVY)$(DSO_EXT) LIBIVY_DEPLIBS = -livy LIBIVY_GLFW_SHARED = $(LIBIVY_GLFW)$(DSO_EXT) LIBIVY_GLFW_DEPLIBS = -lglfw -livy -lX11 -lXext -lXxf86vm -lGL -lpthread LIBIVY_QT_SHARED = $(LIBIVY_QT)$(DSO_EXT) LIBIVY_QT_DEPLIBS = -lX11 -lXext -lQtCore -livy -lpthread LIBIVY_XT_SHARED = $(LIBIVY_XT)$(DSO_EXT) LIBIVY_XT_DEPLIBS = -lX11 -lXext -lXt -lpthread #a mettre dans les makefiles generant les executables #LLDLIBS= -rpath. -L. -lTextureLabel -lInventor -lInventorXt -lXm -lXt -lttf -lGL -lGLU -lm ifdef DEBUG CC= g++ -fPIC -g -Wall -pg $(CPPFLAGS) DBG=debug else CC= g++ -fPIC -O2 -Wall $(CPPFLAGS) DBG= endif default: $(LIBIVY_STATIC) $(LIBIVY_GLFW_STATIC) $(LIBIVY_SHARED) \ $(LIBIVY_GLFW_SHARED) $(LIBIVY_QT_SHARED) $(LIBIVY_XT_SHARED) \ testIvyQt testIvyXt %.o: %.cxx $(CC) -c $< Ivy_Xt.o: Ivy.cxx $(CC) $(XTOPT) $< -c -o Ivy_Xt.o ivyqtloop.o: ivyqtloop.moc ivyqtloop.moc: ivyqtloop.h moc $(QTOPT) $(QTINC) -i $< -o $@ ivyqtloop.o: ivyqtloop.cxx $(CC) $(QTINC) $(QTOPT) -c $< $(LIBIVY_STATIC) : $(OBJECTS) ar rv $(LIBIVY_STATIC) $(OBJECTS) ranlib $(LIBIVY_STATIC) $(LIBIVY_GLFW_STATIC) : $(OBJECTS_GLFW) ar rv $(LIBIVY_GLFW_STATIC) $(OBJECTS_GLFW) ranlib $(LIBIVY_GLFW_STATIC) $(LIBIVY_SHARED) : $(OBJECTS) $(LD) -o $(LIBIVY_SHARED) $(OBJECTS) $(LDFLAGS) $(LIBIVY_DEPLIBS) $(LIBIVY_GLFW_SHARED) : $(OBJECTS_GLFW) $(LD) -o $(LIBIVY_GLFW_SHARED) $(OBJECTS_GLFW) $(LDFLAGS) $(LIBIVY_GLFW_DEPLIBS) $(LIBIVY_QT_SHARED) : $(OBJECTS_QT) $(LD) -o $(LIBIVY_QT_SHARED) $(OBJECTS_QT) \ $(LDFLAGS) $(LIBIVY_QT_DEPLIBS) $(LIBIVY_XT_SHARED) : $(OBJECTS_XT) $(LD) -o $(LIBIVY_XT_SHARED) $(OBJECTS_XT) \ $(LDFLAGS) $(LIBIVY_XT_DEPLIBS) install: default # headers mkdir -p $(DESTDIR)$(PREFIX)/include/Ivy install -m 0644 Ivy*.h $(DESTDIR)$(PREFIX)/include/Ivy # libs mkdir -p $(DESTDIR)$(PREFIX)/$(LIB) install -m 0644 $(LIBIVY_STATIC) $(DESTDIR)$(PREFIX)/$(LIB) install -m 0644 $(LIBIVY_GLFW_STATIC) $(DESTDIR)$(PREFIX)/$(LIB) install -m 0644 $(LIBIVY_SHARED) $(DESTDIR)$(PREFIX)/$(LIB) install -m 0644 $(LIBIVY_GLFW_SHARED) $(DESTDIR)$(PREFIX)/$(LIB) install_mandriva64: default # make clean; make install_mandriva64 PREFIX=/usr/local # make clean; make install_mandriva64 DEBUG=1 PREFIX=/usr/local # # headers mkdir -p /usr/local/include/Ivy install -m 0644 Ivy*.h /usr/local/include/Ivy # libs mkdir -p /usr/local/lib64/$(IVY) install -m 0644 $(LIBIVY_STATIC) /usr/local/lib64/$(DBG) install -m 0644 $(LIBIVY_GLFW_STATIC) /usr/local/lib64/$(DBG) install -m 0644 $(LIBIVY_SHARED) /usr/local/lib64/$(DBG) install -m 0644 $(LIBIVY_GLFW_SHARED) /usr/local/lib64/$(DBG) LLDLIBS = -L $(XTLIB) -Wl,-rpath,$(XTLIB) -L. -Wl,-rpath,. -L$(IVY_PATH)/src -Wl,-rpath,/usr/local/lib64 -L/usr/local/lib64 testIvyXt : testIvyXt.cxx g++ -g $(CPPFLAGS) $(XTLIB) $(LLDLIBS) -o $@ testIvyXt.cxx -lIvy -lxtivy -lXt -lX11 -lIvy_Xt testIvyQt.moc: testIvyQt.cxx moc $(QTOPT) $(QTINC) -i $< -o $@ testIvyQt : testIvyQt.cxx testIvyQt.moc g++ -g $(QTOPT) $(QTINC) $(LLDLIBS) -o $@ testIvyQt.cxx -lIvy_Qt -livy $(QTLIB) distclean clean : rm -f $(LIBIVY_STATIC) $(LIBIVY_GLFW_STATIC) $(LIBIVY_SHARED) \ $(LIBIVY_GLFW_SHARED) $(OBJECTS) $(DEPS) \ $(OBJECTS_GLFW) $(DEPS_GLFW) core *.o *.d *~ *.moc -include *.d