OpenSceneGraph/Make/makedefs
2003-01-22 23:40:47 +00:00

505 lines
15 KiB
Plaintext

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
## Make CYGWIN_XXXX CYGWIN so it's "Windows cross platform" :)
ifeq ($(findstring CYGWIN,$(OS)),CYGWIN)
OS := CYGWIN
endif
## Make MINGW_XXXX MINGW so it's "Windows cross platform" :)
ifeq ($(findstring MINGW,$(OS)),MINGW)
OS := MINGW
endif
# 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
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
INST_SRC = $(INST_SHARE_PREFIX)/OpenSceneGraph/src
INST_DOC = $(INST_SHARE_PREFIX)/OpenSceneGraph/doc
INST_DATA = $(INST_SHARE_PREFIX)/OpenSceneGraph/data
INST_DEMO_SRC = $(INST_SRC)/demos
LINK = ln -sf
INSTBINCMD = install -m 755
INSTDEVCMD = install -m 644
INSTLINKBINCMD = $(LINK)
INSTLINKDEVCMD = $(LINK)
LIB_PREFIX = lib
LIB_EXT = so
PLUGIN_PREFIX = osgdb_
PLUGIN_EXT = so
MAKEDIST = echo " === Distribution build is not implemented yet for $(OS)"; printf "\n"
INSTLOGFILE = /tmp/.osg_inst_log
RECURSIVE_TARGETS = \
opt\
debug\
clean\
cleandepend\
cleandependopt\
cleandependdbg\
cleandbg\
cleanopt\
cleantarget\
cleantargetopt\
cleantargetdbg\
clobber\
clobberdbg\
clobberopt\
beautify\
docs\
depend\
#### SUN OS Specific definitions
ifeq ($(OS),SunOS)
#### if useing g++ on a sun
ifeq ($(COMPILER),gnu)
C++ = g++
DEPARG = -M
INC += -I/usr/local/glut-3.7/include
DEF += -W -Wall -fPIC -fpermissive
OPTF = -O2
DBGF = -g -DOSG_COMPILE_UNIT_TESTS
SHARED = -shared -fPIC
ifeq ($(ARCH),64)
ARCHARGS = -m64 -DARCH64
else
ARCHARGS =
endif
GLUT_LIB = -L/usr/local/glut-3.7/lib/glut -lglut
GIF_LIBS = -lgif
TIFF_LIB = -ltiff
JPEG_LIBS = -ljpeg
PNG_LIBS = -lpng -lz
FREETYPE_LIB = -lfreetype
OTHER_LIBS =
#### using forte compilers (default)
else
C++ = CC
DEPARG = -xM1
INC +=
DEF += -features=extensions
OPTF = -xO4
DBGF = -g -DOSG_COMPILE_UNIT_TESTS
SHARED = -G
ifeq ($(ARCH),64)
ARCHARGS = -xarch=v9 -DARCH64
else
ARCHARGS =
endif
GLUT_LIB = -lglut
OTHER_LIBS = -lCstd
LINKARGS =
GIF_LIBS = /usr/local/lib/libgif.a
TIFF_LIB = /usr/local/lib/libtiff.a
JPEG_LIBS = /usr/local/lib/libjpeg.a
PNG_LIBS = /usr/local/lib/libpng.a /usr/local/lib/libz.a
FREETYPE_LIB = /usr/local/lib/libfreetype.a
endif
DYNAMICLIBRARYLIB = -ldl
OSG_LIBS = -losgGLUT -losgGA -losgDB -losgUtil -losg
GL_LIBS = -lGLU -lGL
X_LIBS = -lXext -lXmu -lXi -lX11
SOCKET_LIBS = -lsocket -lnsl
INSTBINCMD = cp
INSTDEVCMD = cp
INST_SYS_PREFIX = /opt/OpenSceneGraph
INST_SHARE_PREFIX = /opt
MAKEDIST = $(TOPDIR)/Make/makepkg
endif
#### IRIX Specific definitions
ifeq ($(OS),IRIX)
LINKARGS = -L${TOPDIR}/lib -LANG:std -OPT:Olimit=0
C++ = CC
DEPARG = -M
INC += -I${TOPDIR}/include -I/usr/freeware/include
DEF += -LANG:std -OPT:Olimit=0 \
-DEBUG:woff=1682 -DEBUG:woff=3303\
-MDupdate $(MAKEDEPEND)
OPTF = -O2
DBGF = -g -DOSG_COMPILE_UNIT_TESTS
SHARED = -shared
ARCH = 32
PFLIBS = \
-lpf3ds -lpfdem -lpfdted -lpfdwb -lpfdxf -lpfevt \
-lpfflt -lpfgds -lpfgfo -lpfim -lpflsa -lpflsb \
-lpfnff -lpfobj -lpfpegg -lpfpfb -lpfphd -lpfpts \
-lpfrot -lpfscale -lpfsgf -lpfsgo -lpfsphere -lpfsv \
-lpftri -lpfunc -lpfvct -lpfdu -lpfutil -lpf -limage
FREETYPE_LIB = -lfreetype
ifeq ($(ARCH),64)
ARCHARGS = -64 -DARCH64
LINKARGS += -L/usr/freeware/lib64
PF_XTRA_LIBS = -L/usr/lib64/libpfdb -rpath /usr/lib64/libpfdb \
$(PFLIBS)
else
ARCHARGS = -n32
LINKARGS += -L/usr/freeware/lib32
PF_XTRA_LIBS = -L/usr/lib32/libpfdb -rpath /usr/lib32/libpfdb \
$(PFLIBS)
endif
DYNAMICLIBRARYLIB =
OSG_LIBS = -losgGLUT -losgGA -losgDB -losgUtil -losg
GLUT_LIB = -lglut
GL_LIBS = -lGLU -lGL
X_LIBS = -lXext -lXi -lXmu -lX11
SOCKET_LIBS =
OTHER_LIBS = -lm
PNG_LIBS = -lpng
JPEG_LIBS = -ljpeg
TIFF_LIB = -ltiff
GIF_LIBS = -lungif
MAKEDIST = $(TOPDIR)/Make/makeirixdist
endif
#### Linux specific definitions
ifeq ($(OS),Linux)
ifeq (x$(CXX),x)
C++ = g++
else
C++ = $(CXX)
endif
DEPARG = -M
INC +=
DEF += -W -Wall
OPTF = -O2
DBGF = -g -gstabs+ -DOSG_COMPILE_UNIT_TESTS
SHARED = -shared
ARCHARGS =
LINKARGS = -L/usr/X11R6/lib
LIBS = -lstdc++
DYNAMICLIBRARYLIB = -ldl
OSG_LIBS = -losgGLUT -losgGA -losgDB -losgUtil -losg
FREETYPE_LIB = -lfreetype
GLUT_LIB = -lglut
GL_LIBS = -lGLU -lGL
X_LIBS = -lXi -lXmu -lX11
PF_XTRA_LIBS = -L/usr/lib/libpfdb -Xlinker -rpath /usr/lib/libpfdb \
-lpfdu -lpfutil -lpf
SOCKET_LIBS =
OTHER_LIBS = -lpthread
PNG_LIBS = -lpng
JPEG_LIBS = -ljpeg
TIFF_LIB = -ltiff
GIF_LIBS = -lungif
MAKEDIST = $(TOPDIR)/Make/makerpms
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 -DOSG_COMPILE_UNIT_TESTS
SHARED = -shared
ARCHARGS =
LINKARGS = -L/usr/X11R6/lib -L/usr/local/lib -rpath /usr/local/lib
DYNAMICLIBRARYLIB =
OSG_LIBS = -losgGLUT -losgGA -losgDB -losgUtil -losg
FREETYPE_LIB = -lfreetype
GLUT_LIB = -lglut
GL_LIBS = -lGLU -lGL
X_LIBS = -lXmu -lX11
SOCKET_LIBS =
OTHER_LIBS =
INST_SYS_PREFIX = /opt/X11R6
INST_SHARE_PREFIX = /usr/share/OpenSceneGraph
endif
#### MacOS X specific definitions
ifeq ($(OS),Darwin)
C++ = c++
INC +=
DEF += -Wall -D__DARWIN_OSX__
OPTF = -O2
DBGF = -g -DOSG_COMPILE_UNIT_TESTS
DEPARG = -M $(DEF)
SHARED = -shared
ARCHARGS =
LINKARGS =
DYNAMICLIBRARYLIB =
OSG_LIBS = -losgGLUT -losgGA -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 -lstdc++ -lobjc
LIB_EXT = dylib
QUICKTIME = -framework QuickTime $(CARBON_LIB)
TIFF_LIB = -ltiff
# src libs which require external libs: osgText
SRC_DIRS = osg osgUtil osgDB osgParticle osgSim\
osgGA osgGLUT \
osgPlugins \
Demos
LIBVERSION = -dylib_current_version 0.9.1
# Plugins which require external libs: gif jpeg png tiff osgText
PLUGIN_DIRS = bmp dw flt \
lib3ds logos lwo obj \
osg osgParticle osgtgz pic \
quicktime rgb tga tgz \
txp zip
# Demos which require external libs: osghud osgtext
DEMOS_DIRS = osgbillboard osgcallback osgclip \
osgcluster osgconv osgcopy osgcube osggeometry \
osghangglide osgimpostor osgmultitexture osgoccluder \
osgparticle osglightpoint osgprerender osgshadowtexture osgreflect osgscribe osgstereoimage \
osgtexture1D osgtexture2D osgtexture3D osgversion osgviews sgv \
osgshape osganimate osgteapot
endif
#### Cygwin/Mingw specific definitions
ifeq ($(OS),CYGWIN)
C++ = c++
DEPARG = -M
INC +=
DEF += -DWIN32 -W -Wall -DNOMINMAX
OPTF = -O2
DBGF = -g -DOSG_COMPILE_UNIT_TESTS
SHARED = -shared\
-Wl,--export-all-symbols \
-Wl,--output-def,lib$(TARGET_BASENAME).def \
-Wl,--out-implib,$(TOPDIR)/lib/lib$(TARGET_BASENAME).dll.a \
ARCHARGS =
LINKARGS = -W -Wall
DYNAMICLIBRARYLIB =
OSG_LIBS = -losgGLUT -losgGA -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)
PNG_LIBS = -lpng -lz
JPEG_LIBS = -ljpeg
GIF_LIBS = -lungif
TIFF_LIB = -ltiff -lz -ljpeg
FREETYPE_LIB = -lfreetype2
LIB_PREFIX = cyg
LIB_EXT = dll
PLUGIN_EXT = dll
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_SRC = $(INST_SHARE_PREFIX)/src
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
# Demos which require external libs: osghud osgtext
DEMOS_DIRS = osgbillboard osgcallback osgclip \
osgconv osgcopy osgcube osggeometry \
osghangglide osgimpostor osgmultitexture osgoccluder \
osgparticle osgprerender osgreflect osgscribe osgstereoimage \
osgtexture1D osgtexture2D osgtexture3D osgversion osgviews sgv \
osgshape osganimate osgteapot
#osgcluster
endif
#### Cygwin/Mingw specific definitions
ifeq ($(OS),MINGW)
C++ = c++
DEPARG = -M
INC +=
DEF += -DWIN32 -Wall
# -W
OPTF = -O2
DBGF = -g -DOSG_COMPILE_UNIT_TESTS
SHARED = -shared\
-Wl,--export-all-symbols \
-Wl,--output-def,lib$(TARGET_BASENAME).def \
-Wl,--out-implib,$(TOPDIR)/lib/lib$(TARGET_BASENAME).dll.a \
ARCHARGS =
LINKARGS = -W -Wall
DYNAMICLIBRARYLIB =
OSG_LIBS = -losgGLUT -losgGA -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)
PNG_LIBS = -lpng -lz
JPEG_LIBS = -ljpeg
GIF_LIBS = -lungif
TIFF_LIB = -ltiff -lz -ljpeg
FREETYPE_LIB = -lfreetype
# LIB_PREFIX = cyg
LIB_PREFIX = lib
LIB_EXT = dll
PLUGIN_EXT = dll
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_SRC = $(INST_SHARE_PREFIX)/src
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
PLUGIN_DIRS = osg rgb lib3ds flt obj lwo bmp pic tga osgtgz tgz zip
# txp
DEMOS_DIRS = osghangglide osgbillboard osgconv osgcopy osgcube osgimpostor\
osgreflect osgscribe osgstereoimage osgtexture1D osgtexture2D osgtexture3D\
osgviews osgversion sgv osghud osgtext
# osgcluster
endif
#### HP-UX Specific definitions
# contributed by tino.schwarze@informatik.tu-chemnitz.de
ifeq ($(OS),HP-UX)
C++ = g++
DEPARG = -M
INC += -I/opt/glut/include
DEF += -W -Wall -fPIC
OPTF = -O2
# gcc 3.1 uses DWARF as default, my GDB might not yet support this...
# at least I've got problems everywhere
DBGF = -g -gstabs+ -DOSG_COMPILE_UNIT_TESTS
SHARED = -shared -fPIC
ARCH = 32
ifeq ($(ARCH),64)
# not yet tested
ARCHARGS = -march=2.0 -DARCH64
else
# at least my gcc 3.1 defaults to HP-PA RISC 1.1
ARCHARGS =
endif
LINKARGS = -lpthread
LIB_EXT = sl
PLUGIN_EXT = sl
DYNAMICLIBRARYLIB = -ldld
OSG_LIBS = -losgGLUT -losgGA -losgDB -losgUtil -losg
# glut delivered with HP-UX is outdated
GLUT_LIB = -L/opt/glut/lib -lglut
GL_LIBS = -L/opt/graphics/OpenGL/lib -lGLU -lGL
X_LIBS = -L/usr/lib/X11R6 -lXext -lXi -lX11 -L/usr/lib/X11R4 -lXmu
SOCKET_LIBS =
# make sure that global constructors/destructors are called upon
# shl_load() / shl_unload() - this is a gcc specific workaround
OTHER_LIBS = -lm -Wl,+init -Wl,_GLOBAL__DI -Wl,+fini -Wl,_GLOBAL__DD
FREETYPE_INCLUDE = -I/opt/freetype/include -I/opt/freetype/include/freetype2
FREETYPE_LIB = -L/opt/freetype/lib -lfreetype
PNG_INCLUDE = -I/opt/libpng/include
PNG_LIBS = -L/opt/libpng/lib -lpng -L/opt/zlib/lib -lz
JPEG_INCLUDE = -I/opt/jpeg-6/include
JPEG_LIBS = -L/opt/jpeg-6/lib -ljpeg
TIFF_INCLUDE = -I/opt/tiff-3.5/include
TIFF_LIB = -L/opt/tiff-3.5/lib -ltiff
GIF_INCLUDE = -I/opt/libungif/include
GIF_LIBS = -L/opt/libungif/lib -lungif
endif
VPATH=..