blob: 6c283dc2508f1ff549737f31912e83bd94b2d536 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
# $Id$
os=$(shell uname -s)
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/X11R6/$(LIB)
CPPFLAGS = -MMD -I/usr/X11R6/include
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
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)
LD_QUICKSTART_INFO=
GCXXINCS=
LIBIVY = libIvy
LIBIVY_GLFW = $(LIBIVY)_glfw
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
#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)
%.o: %.cxx
$(CC) -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)
install: $(LIBIVY_STATIC) $(LIBIVY_GLFW_STATIC) $(LIBIVY_SHARED) $(LIBIVY_GLFW_SHARED)
# 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: $(LIBIVY_STATIC) $(LIBIVY_GLFW_STATIC) $(LIBIVY_SHARED) $(LIBIVY_GLFW_SHARED)
# 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
testIvy : testIvy.cxx
g++ -g $(XTLIB) $(LLDLIBS) -o $@ testIvy.cxx -lIvy -lxtivy -lXt -lX11
distclean clean :
rm -f $(LIBIVY_STATIC) $(LIBIVY_GLFW_STATIC) $(LIBIVY_SHARED) \
$(LIBIVY_GLFW_SHARED) $(OBJECTS) $(DEPS) \
$(OBJECTS_GLFW) $(DEPS_GLFW) core *.o *.d *~
-include *.d
|