blob: 2a9c9c080f1b44dc8671130d3ecc025a6a2f596c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
# 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
|