llvm-project
68 строк · 2.5 Кб
1#
2# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
3# See https://llvm.org/LICENSE.txt for license information.
4# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5CCDIR=/usr/bin
6#CCDIR=/Volumes/Keep/gcc/usr/bin
7
8all: std
9
10clean:
11rm -fr *.dSYM *.o *-bin testfilerunner
12
13TFR = ~public/bin/testfilerunner
14
15testfilerunner: testfilerunner.h testfilerunner.m
16gcc -fobjc-gc-only -g -arch x86_64 -arch i386 -std=gnu99 testfilerunner.m -o testfilerunner -framework Foundation
17
18tests:
19grep CONFIG *.[cmCM] | $(TFR) $(CCDIR) --
20
21open:
22grep CONFIG *.[cmCM] | $(TFR) $(CCDIR) -open --
23
24fast:
25grep CONFIG *.[cmCM] | $(TFR) -fast $(CCDIR) --
26
27std:
28grep CONFIG *.[cmCM] | $(TFR) --
29
30clang:
31grep CONFIG *.[cmCM] | $(TFR) -clang -fast --
32
33fastd:
34grep CONFIG *.[cmCM] | $(TFR) -fast --
35
36
37# Hack Alert: arguably most of the following belongs in libclosure's Makefile; sticking it here until I get around to grokking what goes on in that file.
38sudid:
39@echo Enabling sudo: # Hack Alert: enable sudo first thing so we don't hang at the password prompt later
40@sudo echo Thanks
41
42
43RootsDirectory ?= /tmp/
44# Note: the libsystem project (built by the libsystemroot target below) uses the ALTUSRLOCALLIBSYSTEM variable, so we use it here to maintain parity
45ALTUSRLOCALLIBSYSTEM ?= $(RootsDirectory)/alt-usr-local-lib-system/
46altusrlocallibsystem:
47ditto /usr/local/lib/system $(ALTUSRLOCALLIBSYSTEM) # FIXME: conditionalize this copy
48
49
50# <rdar://problem/6456031> ER: option to not require extra privileges (-nosudo or somesuch)
51Buildit ?= ~rc/bin/buildit -rootsDirectory $(RootsDirectory) -arch i386 -arch ppc -arch x86_64
52blocksroot: sudid clean altusrlocallibsystem
53sudo $(Buildit) ..
54ditto $(RootsDirectory)/libclosure.roots/libclosure~dst/usr/local/lib/system $(ALTUSRLOCALLIBSYSTEM)
55
56
57LibsystemVersion ?= 121
58LibsystemPath ?= ~rc/Software/SnowLeopard/Projects/Libsystem/Libsystem-$(LibsystemVersion)
59LibsystemTmpPath ?= $(RootsDirectory)/Libsystem-$(LibsystemVersion)
60libsystemroot: blocksroot
61ditto $(LibsystemPath) $(LibsystemTmpPath) # FIXME: conditionalize this copy
62sudo ALTUSRLOCALLIBSYSTEM=$(ALTUSRLOCALLIBSYSTEM) $(Buildit) $(LibsystemTmpPath)
63
64
65# Defaults to product of the libsystemroot target but does not automatically rebuild that, make both targets if you want a fresh root
66LibsystemRootPath ?= $(RootsDirectory)/Libsystem-$(LibsystemVersion).roots/Libsystem-$(LibsystemVersion)~dst/usr/lib/
67roottests:
68grep CONFIG *.[cmCM] | $(TFR) -dyld $(LibsystemRootPath) -- # FIXME: figure out if I can "call" the std target instead of duplicating it
69
70