]> git.saurik.com Git - apple/security.git/blame - SecurityTests/cspxutils/Makefile
Security-57031.1.35.tar.gz
[apple/security.git] / SecurityTests / cspxutils / Makefile
CommitLineData
d8f41ccd
A
1#
2# Top-level Makefile for cspxutils. Allows build or clean
3# of all directories in one swoop.
4#
5SHELL := /bin/zsh
6
7SUBDIRS= 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
17INSTALLDIR=$(DSTROOT)/usr/local/bin
18
19# default SRCROOT for clean target
20SRCROOT ?= $(shell pwd)
21
22# just for all target
23BUILD_DIR = $(shell echo $(LOCAL_BUILD_DIR))
24LOCALBUILD=$BUILD_DIR
25
26first:
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
36build: first
37
38sphinx:
39 make "SPHINX=-DSPHINX"
40
41# architecture options
42
4364bit:
44 make "DEBUG_CFLAGS=-arch x86_64" "CMDLINE_LDFLAGS=-arch x86_64"
45
4664bitFat:
47 make "DEBUG_CFLAGS=-arch x86_64 -arch i386" "CMDLINE_LDFLAGS=-arch x86_64 -arch i386"
48
49fat:
50 make "DEBUG_CFLAGS=-arch i386" "CMDLINE_LDFLAGS=-arch i386"
51
52install:
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
64installhdrs:
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
74installsrc:
75 cp -R . $(SRCROOT)
76
77clean:
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
89all:
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. ==="