• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /macosx-10.10.1/Security-57031.1.35/SecurityTests/clxutils/NISCC/TLS_SSL/nisccSimpleClient/
1# name of executable to build
2EXECUTABLE=nisccSimpleClient
3# C++ source (with .cpp extension)
4CPSOURCE= nisccSimpleClient.cpp
5# C source (.c extension)
6CSOURCE=
7
8#
9# Differs from standard clxutils since ../ is not clxutils....
10#
11CL_UTIL_DIR=../../../
12
13OUR_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#
20PROJ_LIBS=
21#
22# Optional lib search paths
23#
24PROJ_LIBPATH=
25#
26# choose one for cc
27#
28VERBOSE=
29#VERBOSE=-v
30
31#
32# Other files to remove at 'make clean' time
33#
34OTHER_TO_CLEAN=
35
36#
37# non-standard frameworks (e.g., -framework foo)
38#
39PROJ_FRAMEWORKS= -framework CoreFoundation
40#
41# project-specific includes, with leading -I
42#
43PROJ_INCLUDES= 
44
45#
46# Optional C flags (warnings, optimizations, etc.)
47#
48PROJ_CFLAGS=
49
50#
51# Optional link flags (using cc, not ld)
52#
53PROJ_LDFLAGS=
54
55#
56# Optional dependencies
57#
58PROJ_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#
76OBJROOT ?= .
77SRCROOT ?= .
78#
79# Executables written to SYMROOT if specified, else to LOCAL_BUILD_DIR
80# env var if specified, else to '.'.
81#
82SYMROOT ?= $(shell echo $(LOCAL_BUILD_DIR))
83LOCAL_BUILD=$(SYMROOT)
84ifeq "" "$(LOCAL_BUILD)"
85	LOCAL_BUILD = .
86endif
87
88# independent of SYMROOT
89CLEAN_DIR=$(shell echo $(LOCAL_BUILD_DIR))
90ifeq "" "$(CLEAN_DIR)"
91	CLEAN_DIR = .
92endif
93
94#
95# DSTROOT only used for install
96$
97DSTROOT ?= ""
98
99INSTALLDIR := $(DSTROOT)/usr/local/bin
100
101CLAPP_UTILS= ../../..
102UTIL_LIB_SRC= ../../../clAppUtils
103
104OFILES= $(CSOURCE:%.c=$(OBJROOT)/%.o) $(CPSOURCE:%.cpp=$(OBJROOT)/%.o) 
105
106#
107# Assume final load with cc, not ld
108#
109STD_LIBS=-lclutils -lcsputils
110STD_LIBPATH= -L$(LOCAL_BUILD) $(UTILLIB_PATH) -L$(UTIL_LIB_SRC) 
111ALL_LIBS= $(STD_LIBS) $(PROJ_LIBS)
112ALL_LIBPATHS= $(STD_LIBPATH) $(PROJ_LIBPATH) 
113PRIV_FRAMEWORK_PATH= /System/Library/PrivateFrameworks
114
115#
116# Override this from the make command line to add e.g. -lMallocDebug
117#
118CMDLINE_LDFLAGS=
119
120ALL_LDFLAGS= $(CMDLINE_LDFLAGS) $(ALL_LIBS) $(ALL_LIBPATHS) $(PROJ_LDFLAGS) \
121	-F$(LOCAL_BUILD) -F$(PRIV_FRAMEWORK_PATH)
122
123CC=c++
124
125STD_FRAMEWORKS= -framework Security -framework CoreFoundation -framework security_cdsa_utils
126ALL_FRAMEWORKS= $(STD_FRAMEWORKS) $(PROJ_FRAMEWORKS)
127
128#
129# to get to headers in frameworks
130#
131STD_FINCLUDES= -F$(LOCAL_BUILD) -F$(PRIV_FRAMEWORK_PATH)
132#
133# the common headers for csputils
134#
135STD_INCLUDES= -I$(CLAPP_UTILS) $(UTILLIB_HDRS) -F$(PRIV_FRAMEWORK_PATH) 
136ALL_INCLUDES= $(STD_INCLUDES) $(PROJ_INCLUDES)
137CINCLUDES= $(STD_FINCLUDES) $(ALL_INCLUDES)
138
139###WFLAGS= -Wno-four-char-constants -Wall -Werror -Wno-format
140WFLAGS= -Wno-four-char-constants -Wall  -Wno-format -Wno-deprecated-declarations
141
142STD_CFLAGS= -g  $(VERBOSE) 
143DEBUG_CFLAGS=
144
145ALL_CFLAGS= $(CINCLUDES) $(STD_CFLAGS) $(PROJ_CFLAGS) $(WFLAGS) $(DEBUG_CFLAGS)
146
147#
148# Executable in build folder
149#
150BUILT_TARGET= $(LOCAL_BUILD)/$(EXECUTABLE)
151
152first:	UTIL_LIB $(PROJ_DEPENDS) $(BUILT_TARGET)
153
154build: first
155
156install: build
157	install -d -m 0755 $(INSTALLDIR)
158	install -p -m 0755 $(BUILT_TARGET) $(INSTALLDIR)
159
160installhdrs:
161
162#
163# Executable might be in . if no LOCAL_BUILD_DIR specified
164#
165clean:
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
171UTIL_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
183