]> git.saurik.com Git - apple/security.git/blob - SecurityTests/clxutils/NISCC/TLS_SSL/nisccSimpleClient/Makefile
Security-57031.10.10.tar.gz
[apple/security.git] / SecurityTests / clxutils / NISCC / TLS_SSL / nisccSimpleClient / Makefile
1 # name of executable to build
2 EXECUTABLE=nisccSimpleClient
3 # C++ source (with .cpp extension)
4 CPSOURCE= nisccSimpleClient.cpp
5 # C source (.c extension)
6 CSOURCE=
7
8 #
9 # Differs from standard clxutils since ../ is not clxutils....
10 #
11 CL_UTIL_DIR=../../../
12
13 OUR_INCLUDES=-I$(CL_UTIL_DIR)/clAppUtils
14
15 #
16 # Note final load with cc, not ld
17 #
18 # project-specific libraries, e.g., -lstdc++
19 #
20 PROJ_LIBS=
21 #
22 # Optional lib search paths
23 #
24 PROJ_LIBPATH=
25 #
26 # choose one for cc
27 #
28 VERBOSE=
29 #VERBOSE=-v
30
31 #
32 # Other files to remove at 'make clean' time
33 #
34 OTHER_TO_CLEAN=
35
36 #
37 # non-standard frameworks (e.g., -framework foo)
38 #
39 PROJ_FRAMEWORKS= -framework CoreFoundation
40 #
41 # project-specific includes, with leading -I
42 #
43 PROJ_INCLUDES=
44
45 #
46 # Optional C flags (warnings, optimizations, etc.)
47 #
48 PROJ_CFLAGS=
49
50 #
51 # Optional link flags (using cc, not ld)
52 #
53 PROJ_LDFLAGS=
54
55 #
56 # Optional dependencies
57 #
58 PROJ_DEPENDS=
59
60 #include ../Makefile.cdsa
61 ############################################################################
62 # We just include our custom version of Makefile.cdsa intact right here....
63 ############################################################################
64 #
65 # Common makefile fragment for dmitch's clxutils, nisccSimpleClient variant
66 # This is -included from project-specific Makefiles, assumed
67 # to be one directory down from this file.
68 #
69 # See Makefile.template for sample project-specific Makefile.
70 #
71
72 # Defaults for variables provided by buildit
73 #
74 # Object files written to '.' unless OBJROOT specified
75 #
76 OBJROOT ?= .
77 SRCROOT ?= .
78 #
79 # Executables written to SYMROOT if specified, else to LOCAL_BUILD_DIR
80 # env var if specified, else to '.'.
81 #
82 SYMROOT ?= $(shell echo $(LOCAL_BUILD_DIR))
83 LOCAL_BUILD=$(SYMROOT)
84 ifeq "" "$(LOCAL_BUILD)"
85 LOCAL_BUILD = .
86 endif
87
88 # independent of SYMROOT
89 CLEAN_DIR=$(shell echo $(LOCAL_BUILD_DIR))
90 ifeq "" "$(CLEAN_DIR)"
91 CLEAN_DIR = .
92 endif
93
94 #
95 # DSTROOT only used for install
96 $
97 DSTROOT ?= ""
98
99 INSTALLDIR := $(DSTROOT)/usr/local/bin
100
101 CLAPP_UTILS= ../../..
102 UTIL_LIB_SRC= ../../../clAppUtils
103
104 OFILES= $(CSOURCE:%.c=$(OBJROOT)/%.o) $(CPSOURCE:%.cpp=$(OBJROOT)/%.o)
105
106 #
107 # Assume final load with cc, not ld
108 #
109 STD_LIBS=-lclutils -lcsputils
110 STD_LIBPATH= -L$(LOCAL_BUILD) $(UTILLIB_PATH) -L$(UTIL_LIB_SRC)
111 ALL_LIBS= $(STD_LIBS) $(PROJ_LIBS)
112 ALL_LIBPATHS= $(STD_LIBPATH) $(PROJ_LIBPATH)
113 PRIV_FRAMEWORK_PATH= /System/Library/PrivateFrameworks
114
115 #
116 # Override this from the make command line to add e.g. -lMallocDebug
117 #
118 CMDLINE_LDFLAGS=
119
120 ALL_LDFLAGS= $(CMDLINE_LDFLAGS) $(ALL_LIBS) $(ALL_LIBPATHS) $(PROJ_LDFLAGS) \
121 -F$(LOCAL_BUILD) -F$(PRIV_FRAMEWORK_PATH)
122
123 CC=c++
124
125 STD_FRAMEWORKS= -framework Security -framework CoreFoundation -framework security_cdsa_utils
126 ALL_FRAMEWORKS= $(STD_FRAMEWORKS) $(PROJ_FRAMEWORKS)
127
128 #
129 # to get to headers in frameworks
130 #
131 STD_FINCLUDES= -F$(LOCAL_BUILD) -F$(PRIV_FRAMEWORK_PATH)
132 #
133 # the common headers for csputils
134 #
135 STD_INCLUDES= -I$(CLAPP_UTILS) $(UTILLIB_HDRS) -F$(PRIV_FRAMEWORK_PATH)
136 ALL_INCLUDES= $(STD_INCLUDES) $(PROJ_INCLUDES)
137 CINCLUDES= $(STD_FINCLUDES) $(ALL_INCLUDES)
138
139 ###WFLAGS= -Wno-four-char-constants -Wall -Werror -Wno-format
140 WFLAGS= -Wno-four-char-constants -Wall -Wno-format -Wno-deprecated-declarations
141
142 STD_CFLAGS= -g $(VERBOSE)
143 DEBUG_CFLAGS=
144
145 ALL_CFLAGS= $(CINCLUDES) $(STD_CFLAGS) $(PROJ_CFLAGS) $(WFLAGS) $(DEBUG_CFLAGS)
146
147 #
148 # Executable in build folder
149 #
150 BUILT_TARGET= $(LOCAL_BUILD)/$(EXECUTABLE)
151
152 first: UTIL_LIB $(PROJ_DEPENDS) $(BUILT_TARGET)
153
154 build: first
155
156 install: build
157 install -d -m 0755 $(INSTALLDIR)
158 install -p -m 0755 $(BUILT_TARGET) $(INSTALLDIR)
159
160 installhdrs:
161
162 #
163 # Executable might be in . if no LOCAL_BUILD_DIR specified
164 #
165 clean:
166 rm -f $(BUILT_TARGET) $(EXECUTABLE)
167 cd $(SRCROOT); rm -f $(OFILES) *.o
168 cd $(LOCAL_BUILD); rm -f $(EXECUTABLE) $(OTHER_TO_CLEAN)
169 rm -f $(CLEAN_DIR)/$(EXECUTABLE)
170
171 UTIL_LIB:
172 (cd $(UTIL_LIB_SRC); make)
173
174 $(BUILT_TARGET): $(OFILES)
175 $(CC) -o $(BUILT_TARGET) $(ALL_FRAMEWORKS) $^ $(ALL_LDFLAGS)
176
177 $(OBJROOT)/%.o: %.c
178 $(CC) $(ALL_CFLAGS) -c -o $(OBJROOT)/$*.o $<
179
180 $(OBJROOT)/%.o: %.cpp
181 $(CC) $(ALL_CFLAGS) -c -o $(OBJROOT)/$*.o $<
182