Home | History | Annotate | Download | only in BlocksRuntime
      1 #
      2 #                     The LLVM Compiler Infrastructure
      3 #
      4 # This file is distributed under the University of Illinois Open Source
      5 # License. See LICENSE.TXT for details.
      6 CCDIR=/usr/bin
      7 #CCDIR=/Volumes/Keep/gcc/usr/bin
      8 
      9 all: std
     10 
     11 clean:
     12 	rm -fr *.dSYM *.o *-bin testfilerunner
     13 
     14 TFR = ~public/bin/testfilerunner
     15 
     16 testfilerunner: testfilerunner.h testfilerunner.m
     17 	gcc -fobjc-gc-only -g -arch x86_64 -arch i386 -std=gnu99 testfilerunner.m -o testfilerunner -framework Foundation
     18 
     19 tests:
     20 	grep CONFIG *.[cmCM] | $(TFR) $(CCDIR) --
     21 
     22 open:
     23 	grep CONFIG *.[cmCM] | $(TFR) $(CCDIR) -open --
     24 
     25 fast:
     26 	grep CONFIG *.[cmCM] | $(TFR) -fast $(CCDIR) --
     27 
     28 std:
     29 	grep CONFIG *.[cmCM] | $(TFR) --
     30 
     31 clang:
     32 	grep CONFIG *.[cmCM] | $(TFR) -clang -fast --
     33 
     34 fastd:
     35 	grep CONFIG *.[cmCM] | $(TFR) -fast --
     36 
     37 
     38 # 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.
     39 sudid:
     40 	@echo Enabling sudo:  # Hack Alert: enable sudo first thing so we don't hang at the password prompt later
     41 	@sudo echo Thanks
     42 
     43 
     44 RootsDirectory ?= /tmp/
     45 # Note: the libsystem project (built by the libsystemroot target below) uses the ALTUSRLOCALLIBSYSTEM variable, so we use it here to maintain parity
     46 ALTUSRLOCALLIBSYSTEM ?= $(RootsDirectory)/alt-usr-local-lib-system/
     47 altusrlocallibsystem:
     48 	ditto /usr/local/lib/system $(ALTUSRLOCALLIBSYSTEM)  # FIXME: conditionalize this copy
     49 
     50 
     51 # <rdar://problem/6456031> ER: option to not require extra privileges (-nosudo or somesuch)
     52 Buildit ?= ~rc/bin/buildit -rootsDirectory $(RootsDirectory) -arch i386 -arch ppc -arch x86_64
     53 blocksroot: sudid clean altusrlocallibsystem
     54 	sudo $(Buildit) ..
     55 	ditto $(RootsDirectory)/libclosure.roots/libclosure~dst/usr/local/lib/system $(ALTUSRLOCALLIBSYSTEM)
     56 
     57 
     58 LibsystemVersion ?= 121
     59 LibsystemPath ?= ~rc/Software/SnowLeopard/Projects/Libsystem/Libsystem-$(LibsystemVersion)
     60 LibsystemTmpPath ?= $(RootsDirectory)/Libsystem-$(LibsystemVersion)
     61 libsystemroot: blocksroot
     62 	ditto $(LibsystemPath) $(LibsystemTmpPath)  # FIXME: conditionalize this copy
     63 	sudo ALTUSRLOCALLIBSYSTEM=$(ALTUSRLOCALLIBSYSTEM) $(Buildit) $(LibsystemTmpPath)
     64 
     65 
     66 # Defaults to product of the libsystemroot target but does not automatically rebuild that, make both targets if you want a fresh root
     67 LibsystemRootPath ?= $(RootsDirectory)/Libsystem-$(LibsystemVersion).roots/Libsystem-$(LibsystemVersion)~dst/usr/lib/
     68 roottests: 
     69 	grep CONFIG *.[cmCM] | $(TFR) -dyld $(LibsystemRootPath) --  # FIXME: figure out if I can "call" the std target instead of duplicating it
     70 
     71