# 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) #################################################################### # # Compiler & Linker # #################################################################### ifdef DEBUG _DEBUG = 1 endif IS_CARBON_DEPRECATED = -D "CARBON_DEPRECATED" CFLAGS += -fvisibility=hidden -DCC_GNU_ -DOSMac_ -DOSMacOSX_ -DOSMac_MachO_ \ -fpascal-strings \ $(IS_CARBON_DEPRECATED) ifdef _DEBUG CFLAGS += -g -ggdb -fno-inline else CFLAGS += -O3 endif CFLAGS_X86_64 = $(CFLAGS) -DBits64_ -arch x86_64 # 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)) .PHONY: all all: shaveLibAW-x86_64.a shaveLibAW2-x86_64.a shaveLibAW-i386.a shaveLibAW2-i386.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_X86_64) shaveLibAW2-x86_64.a: shaveLibAW2-x86_64.o ar -rc $@ $^ shaveLibAW2-x86_64.o: *.h *.c *.cpp $(CC) -c shavelib1forAWOSX_INTEL.c -o $@ $(CFLAGS_X86_64) -DALTERNATE_DEFS .PHONY: clean clean: rm -f *.o *.a