summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 15 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 4cace62..7817c6f 100644
--- a/Makefile
+++ b/Makefile
@@ -12,10 +12,12 @@ LDFLAGS = -L$(IVY_PATH) -L/sw/lib -framework OpenGL -framework AGL -framework Ca
else
CPPFLAGS = -MMD -I/usr/X11R6/include
DSO_EXT = .so
-LD = g++ -shared
-LDFLAGS = -L/usr/X11R6/lib
+LD = g++ -shared -fPIC
+#PREFIX=/usr/local
+ifndef PREFIX
PREFIX=/usr
endif
+endif
CXXFILES := Ivy.cxx IvyApplication.cxx
@@ -45,11 +47,13 @@ LIBIVY_GLFW_DEPLIBS = -lglfw -livy -lX11 -lXext -lXxf86vm -lGL -lpthread
PERHAPS64= `uname -m | perl -ne "print /64/ ? '64' : '';"`
ifeq ($(PERHAPS64), '64')
- XTLIB = -L/usr/X11R6/lib/
+ LIB=lib
else
- XTLIB = -L/usr/X11R6/lib64/
+ LIB=lib64
endif
+XTLIB = -L/usr/X11R6/$(LIB)/
+
#a mettre dans les makefiles generant les executables
#LLDLIBS= -rpath. -L. -lTextureLabel -lInventor -lInventorXt -lXm -lXt -lttf -lGL -lGLU -lm
@@ -84,16 +88,16 @@ install:
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
-
+ 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)
+
LLDLIBS = -L $(XTLIB) -Wl,-rpath,$(XTLIB) -L. -Wl,-rpath,. -L$(IVY_PATH)/src
testIvy : testIvy.cxx
- g++ -g $(LDFLAGS) $(LLDLIBS) -o $@ testIvy.cxx -lIvy -lxtivy -lXt -lX11
+ g++ -g $(XTLIBS) $(LLDLIBS) -o $@ testIvy.cxx -lIvy -lxtivy -lXt -lX11
distclean clean :