]> git.saurik.com Git - apple/security.git/blob - SecurityTests/cspxutils/Makefile
Security-57031.10.10.tar.gz
[apple/security.git] / SecurityTests / cspxutils / Makefile
1 #
2 # Top-level Makefile for cspxutils. Allows build or clean
3 # of all directories in one swoop.
4 #
5 SHELL := /bin/zsh
6
7 SUBDIRS= utilLib aesVect ascTool asymCompat asymPerform asymTest attachLeak \
8 badattr badmac badsig ccSymCompat ccSymTest ccHmacCompat ccHmacClone \
9 ccOneShot ccCtxSize ccPerform ccOpensslCompat contextReuse \
10 cryptTool dbTool dbVerifyKey dhFulltest dhTest dsaPartial ecdhTest \
11 hashClone hashCompat hashTest hashTime hashTimeLibCrypt hashTimeSA keyDate \
12 keyHash keyHashAsym keyStore keyStoreLeak macCompat macTest mdsdump mdsLookup \
13 miniWrap pbeTest perform pubKeyTool randTest rawRsaSig rawSig rsatool \
14 sha2Time sha2Vectors sha2VectorsCdsa sigPerform sigtest \
15 sshKey ssl2Padding symCompat symDelta symTest wrap wrapTest
16
17 INSTALLDIR=$(DSTROOT)/usr/local/bin
18
19 # default SRCROOT for clean target
20 SRCROOT ?= $(shell pwd)
21
22 # just for all target
23 BUILD_DIR = $(shell echo $(LOCAL_BUILD_DIR))
24 LOCALBUILD=$BUILD_DIR
25
26 first:
27 @foreach i in $(SUBDIRS); \
28 if [[ -a $$i ]] then; \
29 echo "=== Making $$i ==="; \
30 cd $$i || exit 1; \
31 make -r || exit 1; \
32 cd ..; \
33 fi; \
34 end
35
36 build: first
37
38 sphinx:
39 make "SPHINX=-DSPHINX"
40
41 # architecture options
42
43 64bit:
44 make "DEBUG_CFLAGS=-arch x86_64" "CMDLINE_LDFLAGS=-arch x86_64"
45
46 64bitFat:
47 make "DEBUG_CFLAGS=-arch x86_64 -arch i386" "CMDLINE_LDFLAGS=-arch x86_64 -arch i386"
48
49 fat:
50 make "DEBUG_CFLAGS=-arch i386" "CMDLINE_LDFLAGS=-arch i386"
51
52 install:
53 @foreach i in $(SUBDIRS); \
54 echo "=== Installing $$i ==="; \
55 cd $$i; \
56 make install "DSTROOT=$(DSTROOT)" "SYMROOT=$(SYMROOT)" \
57 "OBJROOT=$(OBJROOT)" || exit 1; \
58 cd ..; \
59 end
60 install -d -m 0755 $(INSTALLDIR)
61 install -p -m 0755 cspdvt $(INSTALLDIR)
62 echo "** BUILD SUCCEEDED **"
63
64 installhdrs:
65 @foreach i in $(SUBDIRS); \
66 echo "=== Installing Headers for $$i ==="; \
67 cd $$i; \
68 make installhdrs "DSTROOT=$(DSTROOT)" "SYMROOT=$(SYMROOT)" \
69 "OBJROOT=$(OBJROOT)" "SRCROOT=$(SRCROOT)/$$i" \
70 || exit 1; \
71 cd ..; \
72 end
73
74 installsrc:
75 cp -R . $(SRCROOT)
76
77 clean:
78 @foreach i in $(SUBDIRS); \
79 if [[ -a $$i ]] then; \
80 echo "=== Cleaning $$i ==="; \
81 cd $$i || exit 1; \
82 make clean "DSTROOT=$(DSTROOT)" "SYMROOT=$(SYMROOT)" \
83 "OBJROOT=$(OBJROOT)" "SRCROOT=$(SRCROOT)/$$i" \
84 || exit 1; \
85 cd ..; \
86 fi; \
87 end
88
89 all:
90 @if [[ -z "$(BUILD_DIR)" ]] then; \
91 echo "=== You must set the LOCAL_BUILD_DIR environment variable to make all. ==="; \
92 exit 1 ; \
93 fi
94 make 64bitFat || exit(1)
95 cd ../clxutils; make 64bitFat || exit(1)
96 @echo "=== cspxutils and clxutils are ready to run. ==="