# Shave and a Haircut # (c) 2019 Epic Games # US Patent 6720962 # # This Makefile builds those Shave components which are independent of any # embedding software (e.g. Maya, C4D, XSI, etc). # include ../config-osx.mak #################################################################### # # OSX Version # #################################################################### osVersion := $(shell ../utils/getos.sh) ifeq ($(findstring osx,$(osVersion)),) $(error This Makefile is only for use on OSX) endif osVersion := $(subst osx,,$(osVersion)) osVersionMajor := $(word 1,$(subst ., ,$(osVersion))) osVersionMinor := $(word 2,$(subst ., ,$(osVersion))) osVersion := $(osVersionMajor).$(osVersionMinor) # We must be running OS X 10.4 or later. ifeq ($(filter-out 0 1 2 3 4 5 6 7 8 9,$(osVersionMajor)),) $(error This is not an OS X 10.4 (or later) system.) else ifeq ($(osVersionMajor),10) ifeq ($(filter-out 0 1 2 3,$(osVersionMinor)),) $(error This is not an OS X 10.4 (or later) system.) endif endif CFLAGS += -fvisibility=hidden -DCC_GNU_ -DOSMac_ -DOSMacOSX_ -DOSMac_MachO_ -fpascal-strings \ -DBits64_ -arch x86_64 -D "CARBON_DEPRECATED" LDFLAGS += -DBits64_ -arch x86_64 LIBS = -framework System \ -framework CoreServices \ -framework Carbon \ -framework ApplicationServices \ -framework OpenGL \ -framework IOKit ifdef DEBUG _DEBUG = 1 endif ifdef _DEBUG CFLAGS += -g -ggdb -fno-inline LDFLAGS += -g else CFLAGS += -O3 endif INCLUDES = # This is a space-seprated list of source files which do not affect the # compilation of "the blob" i.e. shavelib1forAWOSX(_INTEL).c NON_BLOB_SOURCES = BLOB_SOURCES = $(filter-out $(NON_BLOB_SOURCES),$(wildcard *.c) $(wildcard *.cpp) $(wildcard *.h)) # # Note that although the source files we use have 'AW' in their names, they # are really independent of Maya. # .PHONY: all all: libShaveEngine-x86_64.dylib libShaveEngine-x86_64.dylib: shavelib1forAWOSX_INTEL.xo $(CC) $^ -o $@ -dynamiclib $(LDFLAGS) $(LIBS) -single_module shavelib1forAWOSX_INTEL.xo: $(BLOB_SOURCES) $(CC) shavelib1forAWOSX_INTEL.c -o shavelib1forAWOSX_INTEL.xo -c $(CFLAGS) $(INCLUDES) -DEXTPRIM .PHONY: clean clean: rm -f libShaveEngine-x86_64.dylib *.xo