-
Notifications
You must be signed in to change notification settings - Fork 818
/
config.mk
54 lines (43 loc) · 1.24 KB
/
config.mk
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
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
#── vi: set noet ft=make ts=8 sw=8 fenc=utf-8 :vi ────────────────────┘
PREFIX = /usr/local
COSMOCC = .cosmocc/3.2.4
TOOLCHAIN = $(COSMOCC)/bin/cosmo
AR = $(TOOLCHAIN)ar
CC = $(TOOLCHAIN)cc
CXX = $(TOOLCHAIN)c++
ZIPOBJ = $(COSMOCC)/bin/zipobj
MKDEPS = $(COSMOCC)/bin/mkdeps
INSTALL = install
ARFLAGS = rcsD
CCFLAGS = -g -O3 -fexceptions
TARGET_ARCH = -Xx86_64-mssse3
CPPFLAGS_ = -iquote. -mcosmo -DGGML_MULTIPLATFORM
TMPDIR = o//tmp
IGNORE := $(shell mkdir -p $(TMPDIR))
# apple still distributes a 17 year old version of gnu make
ifeq ($(MAKE_VERSION), 3.81)
$(error please use bin/make from cosmocc.zip rather than old xcode make)
endif
# let `make m=foo` be shorthand for `make MODE=foo`
ifneq ($(m),)
ifeq ($(MODE),)
MODE := $(m)
endif
endif
# make build more deterministic
LC_ALL = C.UTF-8
SOURCE_DATE_EPOCH = 0
export MODE
export TMPDIR
export LC_ALL
export SOURCE_DATE_EPOCH
# `make` runs `make all` by default
.PHONY: all
all: o/$(MODE)/
.PHONY: clean
clean:; rm -rf o
.PHONY: distclean
distclean:; rm -rf o cosmocc
.cosmocc/3.2.4:
build/download-cosmocc.sh $@ 3.2.4 d2fa6dbf6f987310494581deff5b915dbdc5ca701f20f7613bb0dcf1de2ee511