2002-04-02 14:58:18 +08:00
|
|
|
SHELL = /bin/sh
|
|
|
|
OS := $(shell uname)
|
|
|
|
|
|
|
|
## We don't care about architectural distinguishers in the OS
|
|
|
|
## such as IRIX64, IRIX32, etc. so we truncate IRIX?? to IRIX
|
|
|
|
ifeq ($(findstring IRIX,$(OS)),IRIX)
|
|
|
|
OS := IRIX
|
|
|
|
endif
|
|
|
|
|
2002-04-05 02:01:44 +08:00
|
|
|
## Make CYGWIN_XXXX CYGWIN so it's "Windows cross platform" :)
|
|
|
|
ifeq ($(findstring CYGWIN,$(OS)),CYGWIN)
|
|
|
|
OS := CYGWIN
|
|
|
|
endif
|
|
|
|
|
2002-04-02 14:58:18 +08:00
|
|
|
# TOPDIR needs to be redefined for every Makefile
|
|
|
|
TOPDIR ?= ../
|
|
|
|
THISDIR = .
|
|
|
|
MAKEDEPEND = ignore
|
|
|
|
|
|
|
|
INC = -I$(TOPDIR)/include
|
|
|
|
DEF =
|
|
|
|
|
|
|
|
CXXFLAGS = $(ARCHARGS) $(DOF) $(DEF) $(INC)
|
|
|
|
LDFLAGS = $(ARCHARGS) $(DOF) $(LINKARGS) -L$(TOPDIR)/lib
|
|
|
|
OBJS = $(C++FILES:.cpp=.o) \
|
|
|
|
$(CXXFILES:.cpp=.o) \
|
|
|
|
$(CFILES:.c=.o) \
|
|
|
|
|
|
|
|
DOF = $(OPTF)
|
|
|
|
DEBUGDIR = $(OS)$(ARCH).Debug
|
|
|
|
OPTDIR = $(OS)$(ARCH).Opt
|
|
|
|
BININST = bin
|
|
|
|
LIBINST = lib
|
|
|
|
PLUGININST = lib/osgPlugins
|
|
|
|
|
2002-04-04 01:42:12 +08:00
|
|
|
INST_SYS_PREFIX = /usr/local
|
|
|
|
INST_LIBS = $(INST_SYS_PREFIX)/lib$(ARCH)
|
|
|
|
INST_PLUGINS = $(INST_SYS_PREFIX)/lib$(ARCH)/osgPlugins
|
|
|
|
INST_INCLUDE = $(INST_SYS_PREFIX)/include
|
|
|
|
INST_SHARE_PREFIX = /usr/share
|
|
|
|
INST_DEMOS = $(INST_SHARE_PREFIX)/OpenSceneGraph/bin
|
2002-04-09 22:55:38 +08:00
|
|
|
INST_SRC = $(INST_SHARE_PREFIX)/OpenSceneGraph/src
|
2002-04-05 09:52:15 +08:00
|
|
|
INST_DOC = $(INST_SHARE_PREFIX)/OpenSceneGraph/doc
|
2002-04-04 01:42:12 +08:00
|
|
|
INST_DATA = $(INST_SHARE_PREFIX)/OpenSceneGraph/data
|
2002-04-09 22:55:38 +08:00
|
|
|
INST_DEMO_SRC = $(INST_SRC)/demos
|
2002-04-02 14:58:18 +08:00
|
|
|
|
2002-04-09 22:55:38 +08:00
|
|
|
LINK = ln -sf
|
|
|
|
INSTBINCMD = install -m 755
|
|
|
|
INSTDEVCMD = install -m 644
|
|
|
|
INSTLINKBINCMD = $(LINK)
|
|
|
|
INSTLINKDEVCMD = $(LINK)
|
2002-04-02 14:58:18 +08:00
|
|
|
|
2002-04-09 22:55:38 +08:00
|
|
|
LIB_PREFIX = lib
|
2002-04-04 01:42:12 +08:00
|
|
|
LIB_EXT = so
|
|
|
|
PLUGIN_PREFIX = osgdb_
|
|
|
|
PLUGIN_EXT = so
|
|
|
|
|
2002-04-05 02:01:44 +08:00
|
|
|
MAKEDIST = echo " === Distribution build is not implemented yet for $(OS)"; printf "\n"
|
2002-04-09 22:55:38 +08:00
|
|
|
INSTLOGFILE = /tmp/.osg_inst_log
|
2002-04-02 14:58:18 +08:00
|
|
|
|
2002-04-05 09:52:15 +08:00
|
|
|
RECURSIVE_TARGETS = \
|
2002-04-02 14:58:18 +08:00
|
|
|
opt\
|
|
|
|
debug\
|
|
|
|
clean\
|
2002-04-12 13:09:45 +08:00
|
|
|
cleandepend\
|
|
|
|
cleandependopt\
|
|
|
|
cleandependdbg\
|
2002-04-02 14:58:18 +08:00
|
|
|
cleandbg\
|
|
|
|
cleanopt\
|
2002-04-12 13:09:45 +08:00
|
|
|
cleantarget\
|
|
|
|
cleantargetopt\
|
|
|
|
cleantargetdbg\
|
2002-04-02 14:58:18 +08:00
|
|
|
clobber\
|
2002-04-05 09:52:15 +08:00
|
|
|
clobberdbg\
|
|
|
|
clobberopt\
|
2002-04-02 14:58:18 +08:00
|
|
|
beautify\
|
|
|
|
docs\
|
|
|
|
depend\
|
|
|
|
|
|
|
|
#### SUN OS Specific definitions
|
|
|
|
ifeq ($(OS),SunOS)
|
|
|
|
|
|
|
|
C++ = CC
|
|
|
|
DEPARG = -xM1
|
|
|
|
INC +=
|
|
|
|
DEF += -features=extensions
|
2002-04-04 01:42:12 +08:00
|
|
|
OPTF = -xO4
|
2002-04-09 00:25:45 +08:00
|
|
|
DBGF = -g
|
2002-04-02 14:58:18 +08:00
|
|
|
SHARED = -G
|
|
|
|
ifeq ($(ARCH),64)
|
|
|
|
ARCHARGS = -xarch=v9
|
|
|
|
else
|
|
|
|
ARCHARGS =
|
|
|
|
endif
|
|
|
|
LINKARGS =
|
|
|
|
DYNAMICLIBRARYLIB = -ldl
|
|
|
|
OSG_LIBS = -losgGLUT -losgDB -losgUtil -losg
|
|
|
|
FREETYPE_LIB = -lfreetype
|
|
|
|
GLUT_LIB = -lglut
|
|
|
|
GL_LIBS = -lGLU -lGL
|
|
|
|
X_LIBS = -lXext -lXmu -lXi -lX11
|
|
|
|
SOCKET_LIBS = -lsocket -lnsl
|
|
|
|
OTHER_LIBS = -lCstd
|
|
|
|
TIFF_LIB = -ltiff
|
|
|
|
|
2002-04-04 01:42:12 +08:00
|
|
|
INSTBINCMD = cp
|
|
|
|
INSTDEVCMD = cp
|
|
|
|
|
2002-04-04 01:53:46 +08:00
|
|
|
INST_SYS_PREFIX = /opt/OpenSceneGraph
|
2002-04-09 22:55:38 +08:00
|
|
|
INST_SHARE_PREFIX = /opt
|
2002-04-02 14:58:18 +08:00
|
|
|
|
2002-04-09 22:55:38 +08:00
|
|
|
MAKEDIST = $(TOPDIR)/Make/makepkg
|
2002-04-02 14:58:18 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
#### IRIX Specific definitions
|
|
|
|
ifeq ($(OS),IRIX)
|
|
|
|
|
|
|
|
C++ = CC
|
|
|
|
DEPFLAGS = -M
|
2002-04-16 05:48:43 +08:00
|
|
|
INC += -I/usr/local/include
|
2002-04-02 14:58:18 +08:00
|
|
|
DEF += -LANG:std -OPT:Olimit=0 \
|
2002-04-16 05:48:43 +08:00
|
|
|
-DEBUG:woff=1682 -DEBUG:woff=3303\
|
2002-04-02 14:58:18 +08:00
|
|
|
-MDupdate $(MAKEDEPEND)
|
|
|
|
OPTF = -O2
|
|
|
|
DBGF = -g
|
|
|
|
SHARED = -shared
|
|
|
|
ARCH = 32
|
|
|
|
ifeq ($(ARCH),64)
|
|
|
|
ARCHARGS = -64
|
|
|
|
else
|
|
|
|
ARCHARGS = -n32
|
|
|
|
endif
|
2002-04-16 05:48:43 +08:00
|
|
|
LINKARGS = -LANG:std -OPT:Olimit=0 -L/usr/local/lib32 -rpath /usr/local/lib32
|
2002-04-02 14:58:18 +08:00
|
|
|
DYNAMICLIBRARYLIB = -ldl
|
|
|
|
OSG_LIBS = -losgGLUT -losgDB -losgUtil -losg
|
|
|
|
FREETYPE_LIB = -lfreetype
|
|
|
|
GLUT_LIB = -lglut
|
|
|
|
GL_LIBS = -lGLU -lGL
|
|
|
|
X_LIBS = -lXext -lXi -lXmu -lX11
|
|
|
|
SOCKET_LIBS =
|
|
|
|
OTHER_LIBS = -lm
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
#### Linux specific definitions
|
2002-04-15 22:45:14 +08:00
|
|
|
|
2002-04-02 14:58:18 +08:00
|
|
|
ifeq ($(OS),Linux)
|
2002-04-15 22:45:14 +08:00
|
|
|
|
|
|
|
ifeq (x$(CXX),x)
|
2002-04-02 14:58:18 +08:00
|
|
|
C++ = g++
|
2002-04-15 22:45:14 +08:00
|
|
|
else
|
|
|
|
C++ = $(CXX)
|
|
|
|
endif
|
2002-04-02 14:58:18 +08:00
|
|
|
DEPARG = -MM
|
|
|
|
INC +=
|
|
|
|
DEF += -W -Wall
|
|
|
|
OPTF = -O2
|
2002-04-11 05:51:34 +08:00
|
|
|
DBGF = "-g -DOSG_USE_MEMORY_MANAGER"
|
2002-04-02 14:58:18 +08:00
|
|
|
SHARED = -shared
|
|
|
|
ARCHARGS =
|
|
|
|
LINKARGS = -L/usr/X11R6/lib
|
2002-04-09 00:50:13 +08:00
|
|
|
LIBS = -lstdc++
|
2002-04-02 14:58:18 +08:00
|
|
|
DYNAMICLIBRARYLIB = -ldl
|
|
|
|
OSG_LIBS = -losgGLUT -losgDB -losgUtil -losg
|
|
|
|
FREETYPE_LIB = -lfreetype
|
|
|
|
GLUT_LIB = -lglut
|
|
|
|
GL_LIBS = -lGLU -lGL
|
|
|
|
X_LIBS = -lXmu -lX11
|
|
|
|
SOCKET_LIBS =
|
|
|
|
OTHER_LIBS =
|
2002-04-10 09:29:45 +08:00
|
|
|
PNG_LIBS = -lpng
|
|
|
|
JPEG_LIBS = -ljpeg
|
|
|
|
TIFF_LIB = -ltiff
|
|
|
|
GIF_LIBS = -lgif
|
2002-04-05 02:01:44 +08:00
|
|
|
|
|
|
|
MAKEDIST = $(TOPDIR)/Make/makerpms
|
2002-04-02 14:58:18 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
#### FreeBSD specific definitions
|
|
|
|
ifeq ($(OS),FreeBSD)
|
|
|
|
C++ = g++
|
|
|
|
DEPARG = -MM
|
|
|
|
INC += -I/usr/local/include -I/usr/X11R6/include
|
|
|
|
DEF += -W -Wall
|
|
|
|
OPTF = -O2
|
|
|
|
DBGF = -g
|
|
|
|
SHARED = -shared
|
|
|
|
ARCHARGS =
|
|
|
|
LINKARGS = -L/usr/X11R6/lib -L/usr/local/lib -rpath /usr/local/lib
|
|
|
|
DYNAMICLIBRARYLIB =
|
|
|
|
OSG_LIBS = -losgGLUT -losgDB -losgUtil -losg
|
|
|
|
FREETYPE_LIB = -lfreetype
|
|
|
|
GLUT_LIB = -lglut
|
|
|
|
GL_LIBS = -lGLU -lGL
|
|
|
|
X_LIBS = -lXmu -lX11
|
|
|
|
SOCKET_LIBS =
|
|
|
|
OTHER_LIBS =
|
2002-04-04 01:42:12 +08:00
|
|
|
|
2002-04-04 01:53:46 +08:00
|
|
|
INST_SYS_PREFIX = /opt/X11R6
|
|
|
|
INST_SHARE_PREFIX = /usr/share/OpenSceneGraph
|
|
|
|
|
2002-04-02 14:58:18 +08:00
|
|
|
endif
|
|
|
|
|
2002-04-05 09:52:15 +08:00
|
|
|
#### MacOS X specific definitions
|
2002-04-02 14:58:18 +08:00
|
|
|
ifeq ($(OS),Darwin)
|
|
|
|
C++ = cc
|
|
|
|
INC += -I/usr/include -I/sw/include
|
|
|
|
DEF += -Wall -D__DARWIN_OSX__
|
|
|
|
OPTF = -O2
|
|
|
|
DBGF = -g
|
|
|
|
DEPARG = -M $(DEF)
|
|
|
|
SHARED = -shared
|
|
|
|
ARCHARGS =
|
|
|
|
LINKARGS = -L/usr/lib -L/sw/lib
|
|
|
|
DYNAMICLIBRARYLIB =
|
|
|
|
OSG_LIBS = -losgGLUT -losgDB -losgUtil -losg
|
|
|
|
FREETYPE_LIB = -lfreetype
|
|
|
|
GLUT_LIB = -framework GLUT
|
|
|
|
CARBON_LIB = -framework Carbon
|
|
|
|
GL_LIBS = -framework OpenGL $(CARBON_LIB)
|
|
|
|
X_LIBS =
|
|
|
|
SOCKET_LIBS =
|
|
|
|
OTHER_LIBS = -lm -ldl -lstdc++ -lobjc
|
2002-04-04 01:42:12 +08:00
|
|
|
LIBEXT = dylib
|
2002-04-02 14:58:18 +08:00
|
|
|
QUICKTIME_LIB = -framework QuickTime
|
|
|
|
TIFF_LIB = -ltiff
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
#### Cygwin/Mingw specific definitions
|
2002-04-05 02:01:44 +08:00
|
|
|
ifeq ($(OS),CYGWIN)
|
2002-04-02 14:58:18 +08:00
|
|
|
C++ = c++
|
|
|
|
DEPARG = -M
|
|
|
|
INC +=
|
|
|
|
DEF += -DWIN32 -W -Wall
|
|
|
|
OPTF = -O2
|
|
|
|
DBGF = -g
|
|
|
|
SHARED = -shared\
|
|
|
|
-Wl,--export-all-symbols \
|
2002-04-05 02:01:44 +08:00
|
|
|
-Wl,--output-def,lib$(TARGET_BASENAME).def \
|
|
|
|
-Wl,--out-implib,$(TOPDIR)/lib/lib$(TARGET_BASENAME).dll.a \
|
2002-04-02 14:58:18 +08:00
|
|
|
|
|
|
|
ARCHARGS =
|
|
|
|
LINKARGS = -W -Wall
|
|
|
|
DYNAMICLIBRARYLIB =
|
|
|
|
|
|
|
|
OSG_LIBS = -losgGLUT -losgDB -losgUtil -losg
|
|
|
|
GL_LIBS = -lglu32 -lopengl32
|
|
|
|
GLUT_LIB = -lglut32 $(GL_LIBS)
|
|
|
|
X_LIBS = -lgdi32 -luser32
|
|
|
|
OSGDB_LIBS = -losgdb_3ds \
|
|
|
|
-losgdb_bmp \
|
|
|
|
-losgdb_dw \
|
|
|
|
-losgdb_flt \
|
|
|
|
-losgdb_jpg \
|
|
|
|
-losgdb_lwo \
|
|
|
|
-losgdb_obj \
|
|
|
|
-losgdb_osg \
|
|
|
|
-losgdb_osgtgz \
|
|
|
|
-losgdb_pic \
|
|
|
|
-losgdb_png \
|
|
|
|
-losgdb_rgb \
|
|
|
|
-losgdb_tga \
|
|
|
|
-losgdb_tgz \
|
|
|
|
-losgdb_tiff \
|
|
|
|
-losgdb_zip
|
|
|
|
SOCKET_LIBS =
|
|
|
|
OTHER_LIBS = $(GL_LIBS)
|
2002-04-05 02:01:44 +08:00
|
|
|
PNG_LIBS = -lpng -lz
|
|
|
|
JPEG_LIBS = -ljpeg
|
|
|
|
GIF_LIBS = -lungif
|
|
|
|
TIFF_LIB = -ltiff -lz -ljpeg
|
|
|
|
FREETYPE_LIB = -lfreetype2
|
|
|
|
|
2002-04-04 01:42:12 +08:00
|
|
|
|
2002-04-05 09:52:15 +08:00
|
|
|
LIB_PREFIX = cyg
|
|
|
|
LIB_EXT = dll
|
|
|
|
PLUGIN_EXT = dll
|
2002-04-04 01:42:12 +08:00
|
|
|
|
2002-04-05 09:52:15 +08:00
|
|
|
LINK = cp -f
|
|
|
|
|
|
|
|
INST_SYS_PREFIX = /usr/local/OpenSceneGraph
|
|
|
|
INST_LIBS = $(INST_SYS_PREFIX)/bin
|
|
|
|
INST_PLUGINS = $(INST_SYS_PREFIX)/bin
|
|
|
|
INST_INCLUDE = $(INST_SYS_PREFIX)/include
|
|
|
|
INST_SHARE_PREFIX = /usr/local/OpenSceneGraph
|
|
|
|
INST_DEMOS = $(INST_SHARE_PREFIX)/bin
|
|
|
|
INST_DEMO_SRC = $(INST_SHARE_PREFIX)/src/demos
|
|
|
|
INST_DOC = $(INST_SHARE_PREFIX)/doc
|
|
|
|
INST_DATA = $(INST_SHARE_PREFIX)/data
|
2002-04-04 01:42:12 +08:00
|
|
|
|
2002-04-02 14:58:18 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
VPATH=..
|
|
|
|
|