diff options
Diffstat (limited to 'mayaPlug/Makefile.linux')
| -rw-r--r-- | mayaPlug/Makefile.linux | 254 |
1 files changed, 254 insertions, 0 deletions
diff --git a/mayaPlug/Makefile.linux b/mayaPlug/Makefile.linux new file mode 100644 index 0000000..5d24f00 --- /dev/null +++ b/mayaPlug/Makefile.linux @@ -0,0 +1,254 @@ +# Shave and a Haircut +# (c) 2019 Epic Games +# US Patent 6720962 + +#################################################################### +# +# Maya Version & Location +# +#################################################################### + +ifndef MAYA_LOCATION +$(error "MAYA_LOCATION is not defined") +endif + +ifeq ($(wildcard $(MAYA_LOCATION)),) +$(error "MAYA_LOCATION contains '$(MAYA_LOCATION)', which does not exist.") +endif + +versionInfo := $(shell ../utils/getMayaAPIVersion.sh) +mayaAPI := $(word 1,$(versionInfo)) +mayaVersion := $(word 2,$(versionInfo)) +mayaMajorVersion := $(word 3, $(versionInfo)) +mayaMinorVersion := $(word 4, $(versionInfo)) +mayaDirVersion := $(word 6, $(versionInfo)) + +bits := 64 + + +#################################################################### +# +# Linux Version +# +#################################################################### + +osVersion := $(shell ../utils/getos.sh) + +ifeq ($(osVersion),) + $(error "Operating system type not recognized. Is /etc/issue present?") +endif + +arch := $(shell ../utils/getarch.sh) + + +#################################################################### +# +# Compiler & Linker +# +#################################################################### + +# +# Some versions of Maya use non-standard versions of gcc, which are +# expected to be installed in /opt (e.g. /opt/gcc322) +# +CFLAGS = -pipe -D_BOOL -DUNIX -DLINUX -DFUNCPROTO -D_GNU_SOURCE \ + -DREQUIRE_IOSTREAM -Wall -Wall \ + -Wno-deprecated -fno-gnu-keywords +C++ = $(shell ../utils/getg++.sh $(mayaDirVersion)) + +ifeq ($(C++),) + $(error "Maya version $(mayaVersion) not supported.") +endif + +CFLAGS += -fPIC -DBits64_ -DLINUX_64 -march=athlon64 -m64 -fpermissive \ + -Dnullptr=0 + +ifndef SHAVE_RMAN_SDKS + $(error "SHAVE_RMAN_SDKS not defined.") +endif + +PRMAN = $(SHAVE_RMAN_SDKS)/21.7/maya$(mayaVersion)/linux +SHAVELIB = ../libexe/shavelibAW-x64.a + +ifdef debug +_DEBUG=1 +endif + +ifdef DEBUG +_DEBUG=1 +endif + +ifdef _DEBUG +# It's tempting to add -gstabs+ here to get more C++ specific info, but +# that confuses gdb with the result that it gives 'Cannot access memory' +# errors when you try to print local vars or member vars. +CFLAGS += -D_DEBUG -O0 -g -ggdb -fno-inline +else +CFLAGS += -O3 +endif + +ifdef _INSECURE +CFLAGS += -D_INSECURE +endif + +ifdef _BETA +CFLAGS += -D_BETA +endif + +ifdef SHAVE_PROFILE +profile = 1 +endif + +ifdef profile +CFLAGS += -g +endif + +C++FLAGS = $(CFLAGS) $(WARNFLAGS) + +ifeq ($(shell echo '$(mayaAPI) >= 20180000' | bc),1) + C++FLAGS += -std=c++0x +endif + +INCLUDES = -I. -I.. -I../libexe/sample/include -isystem $(PRMAN)/include -isystem $(MAYA_LOCATION)/include -isystem /usr/X11R6/include +LD = $(C++) -shared $(C++FLAGS) +LIBS = -L$(MAYA_LOCATION)/lib -L/usr/X11R6/lib -lOpenMaya -lOpenMayaFX -lOpenMayaRender -lOpenMayaUI -lOpenMayaAnim -lFoundation -lGLU -lGL -lpthread + +######################### Qt stuff ################################# +# vlad|17Mar2010 +# + +qtIncludeDir := $(MAYA_LOCATION)/include/qt + +ifeq ($(wildcard $(qtIncludeDir)/QtGui),) + $(error "Could not find Qt header files for Maya $(mayaVersion).") +endif + +INCLUDES += -I$(qtIncludeDir) + +ifeq ($(shell echo '$(mayaVersion) < 2017' | bc),1) +LIBS += -lQtCore -lQtGui +else +LIBS += -lQt5Core -lQt5Gui +endif + +######################## procedrals ############################### +#vlad |20Jun2011 + +INCLUDES += -I../procedurals/includes + +#################################################################### + +#################################################################### +# +# Generic Build Rules +# +#################################################################### + +.SUFFIXES: .cpp .cc .o .so .c + +.cc.o: + $(C++) -c $(INCLUDES) $(C++FLAGS) $< + +.cpp.o: + $(C++) -c $(INCLUDES) $(C++FLAGS) $< + +.cc.i: + $(C++) -E $(INCLUDES) $(C++FLAGS) $*.cc > $*.i + +.cc.so: + -rm -f $@ + $(LD) -o $@ $(INCLUDES) $< $(LIBS) + +.cpp.so: + -rm -f $@ + $(LD) -o $@ $(INCLUDES) $< $(LIBS) + +.o.so: + -rm -f $@ + $(LD) -o $@ $< $(LIBS) + + +#################################################################### +# +# Specific Build Rules +# +#################################################################### + +SHAVEFILES = shaveNode.o shaveShadowNode.o shaveObjExporter.o \ + shaveRenderCallback.o shaveRender.o shaveTextureStore.o \ + shaveGlobals.o shaveMaya.o shaveWriteRib.o shaveBlindData.o \ + shaveUtil.o shaveCheckObjectVisibility.o shaveInfo.o \ + isSharedCmd.o shaveVertexShader.o shaveNodeCmd.o \ + shaveRenderCmd.o shaveAPIimpl.o \ + pluginImpl.o shaveXPM.o shaveIcon.o shaveIconCmd.o \ + shaveBackgroundShader.o shaveVolumeShader.o shaveItHairImpl.o \ + shaveRenderer.o shaveMayaRenderer.o \ + shaveSDKCALLBACKS.o shavePadCmd.o \ + shaveHairShape.o shaveHairUI.o shaveCallbacks.o shaveUtilCmd.o \ + shaveHairGeomIt.o shaveHairShapeAttrs.o shaveBrushCtx.o \ + shaveBrushCtxCmd.o shaveBrushManip.o shaveStyleCmd.o \ + shaveCursorCtx.o shaveCursorCtxCmd.o shaveCutCtx.o shaveCutCtxCmd.o \ + shaveWriteHairCmd.o ShavePerVertTexInfo.o \ + shaveVrayRenderer.o shaveVraySharedFunctions.o shaveVrayNode.o \ + shaveVrayCmd.o shavePack2TexCmd.o shaveExportGame.o \ + shaveGeometryOverride.o + + +ifdef _DEBUG +SHAVEFILES += shaveDebug.o +endif + +ifdef _BETA +all: shaveNode.so +else +all: shaveNode.so libShaveAPI.so +endif + +libShave.so: $(SHAVEFILES) + -rm -f $@ + $(LD) -o $@ $(SHAVEFILES) \ + -Wl,-Bsymbolic -Wl,--allow-shlib-undefined \ + $(SHAVELIB) $(LIBS) + +shaveNode.so: plugin.o libShave.so + -rm -f $@ + $(LD) -o $@ plugin.o libShave.so \ + -Wl,-Bsymbolic -Wl,--allow-shlib-undefined \ + $(LIBS) + +libShaveAPI.so: shaveAPI.o shaveItHair.o libShave.so + -rm -f $@ + $(LD) -o $@ $^ $(LIBS) + +shaveAPITestCmd.so: shaveAPITestCmd.o libShaveAPI.so + -rm -f $@ + $(LD) -o $@ shaveAPITestCmd.o -L. -lShaveAPI + +testo.so: testo.o + -rm -f $@ + $(LD) -o $@ testo.o $(LIBS) -Wl,-Bsymbolic \ + -Wl,--allow-shlib-undefined + +force: ; + +CCDEP = gcc + +depend dep deps depends: .depends + +.depends: $(SHAVEFILES:.o=.cpp) plugin.cpp Makefile.linux + @$(CCDEP) -MM $(C++FLAGS) $(INCLUDES) $(SHAVEFILES:.o=.cpp) plugin.cpp >.depends + + +#################################################################### +# +# Cleanup +# +#################################################################### + +clean: + -rm -f *.o + +Clean: + -rm -f *.o *.so *.bak + +include .depends |