# Shave and a Haircut # (c) 2019 Epic Games # US Patent 6720962 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) #################################################################### # # Maya Version # #################################################################### versionInfo := $(shell ../utils/getMayaAPIVersion.sh) mayaAPI := $(word 1,$(versionInfo)) mayaVersion := $(word 2,$(versionInfo)) mayaMajorVersion := $(word 3, $(versionInfo)) mayaMinorVersion := $(word 4, $(versionInfo)) # Maya requires OSX 10.4 or better. ifeq ($(osVersionMajor),10) ifeq ($(filter-out 0 1 2 3,$(osVersionMinor)),) $(error Maya $(mayaVersion) requires OSX 10.4 or better) endif endif #################################################################### # # Compiler & Linker # #################################################################### ifdef DEBUG _DEBUG = 1 endif CFLAGS += -fvisibility=hidden -DCC_GNU_ -DOSMac_ -DOSMacOSX_ -DOSMac_MachO_ \ -D "CARBON_DEPRECATED" -fpascal-strings -DBits64_ -arch x86_64 ifdef _DEBUG CFLAGS += -g -ggdb -fno-inline else CFLAGS += -O3 endif # This is a space-separated 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)) .PHONY: all all: shaveLibAW-x86_64.a shaveLibAW2-x86_64.a # Build targets shaveLibAW-x86_64.a: shaveLibAW-x86_64.o ar -rc $@ $^ shaveLibAW-x86_64.o: $(BLOB_SOURCES) $(CC) -c shavelib1forAWOSX_INTEL.c -o $@ $(CFLAGS) shaveLibAW2-x86_64.a: shaveLibAW2-x86_64.o ar -rc $@ $^ shaveLibAW2-x86_64.o: *.h *.c *.cpp $(CC) -c shavelib1forAWOSX_INTEL.c -o $@ $(CFLAGS) -DALTERNATE_DEFS .PHONY: clean clean: rm -f *.o *.a