1 # name of executable to build
2 EXECUTABLE=nisccSimpleClient
3 # C++ source (with .cpp extension)
4 CPSOURCE= nisccSimpleClient.cpp
5 # C source (.c extension)
9 # Differs from standard clxutils since ../ is not clxutils....
13 OUR_INCLUDES=-I$(CL_UTIL_DIR)/clAppUtils
16 # Note final load with cc, not ld
18 # project-specific libraries, e.g., -lstdc++
22 # Optional lib search paths
32 # Other files to remove at 'make clean' time
37 # non-standard frameworks (e.g., -framework foo)
39 PROJ_FRAMEWORKS= -framework CoreFoundation
41 # project-specific includes, with leading -I
46 # Optional C flags (warnings, optimizations, etc.)
51 # Optional link flags (using cc, not ld)
56 # Optional dependencies
60 #include ../Makefile.cdsa
61 ############################################################################
62 # We just include our custom version of Makefile.cdsa intact right here....
63 ############################################################################
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.
69 # See Makefile.template for sample project-specific Makefile.
72 # Defaults for variables provided by buildit
74 # Object files written to '.' unless OBJROOT specified
79 # Executables written to SYMROOT if specified, else to LOCAL_BUILD_DIR
80 # env var if specified, else to '.'.
82 SYMROOT ?= $(shell echo $(LOCAL_BUILD_DIR))
83 LOCAL_BUILD=$(SYMROOT)
84 ifeq "" "$(LOCAL_BUILD)"
88 # independent of SYMROOT
89 CLEAN_DIR=$(shell echo $(LOCAL_BUILD_DIR))
90 ifeq "" "$(CLEAN_DIR)"
95 # DSTROOT only used for install
99 INSTALLDIR := $(DSTROOT)/usr/local/bin
101 CLAPP_UTILS= ../../..
102 UTIL_LIB_SRC= ../../../clAppUtils
104 OFILES= $(CSOURCE:%.c=$(OBJROOT)/%.o) $(CPSOURCE:%.cpp=$(OBJROOT)/%.o)
107 # Assume final load with cc, not ld
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
116 # Override this from the make command line to add e.g. -lMallocDebug
120 ALL_LDFLAGS= $(CMDLINE_LDFLAGS) $(ALL_LIBS) $(ALL_LIBPATHS) $(PROJ_LDFLAGS) \
121 -F$(LOCAL_BUILD) -F$(PRIV_FRAMEWORK_PATH)
125 STD_FRAMEWORKS= -framework Security -framework CoreFoundation -framework security_cdsa_utils
126 ALL_FRAMEWORKS= $(STD_FRAMEWORKS) $(PROJ_FRAMEWORKS)
129 # to get to headers in frameworks
131 STD_FINCLUDES= -F$(LOCAL_BUILD) -F$(PRIV_FRAMEWORK_PATH)
133 # the common headers for csputils
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)
139 ###WFLAGS= -Wno-four-char-constants -Wall -Werror -Wno-format
140 WFLAGS= -Wno-four-char-constants -Wall -Wno-format -Wno-deprecated-declarations
142 STD_CFLAGS= -g $(VERBOSE)
145 ALL_CFLAGS= $(CINCLUDES) $(STD_CFLAGS) $(PROJ_CFLAGS) $(WFLAGS) $(DEBUG_CFLAGS)
148 # Executable in build folder
150 BUILT_TARGET= $(LOCAL_BUILD)/$(EXECUTABLE)
152 first: UTIL_LIB $(PROJ_DEPENDS) $(BUILT_TARGET)
157 install -d -m 0755 $(INSTALLDIR)
158 install -p -m 0755 $(BUILT_TARGET) $(INSTALLDIR)
163 # Executable might be in . if no LOCAL_BUILD_DIR specified
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)
172 (cd $(UTIL_LIB_SRC); make)
174 $(BUILT_TARGET): $(OFILES)
175 $(CC) -o $(BUILT_TARGET) $(ALL_FRAMEWORKS) $^ $(ALL_LDFLAGS)
178 $(CC) $(ALL_CFLAGS) -c -o $(OBJROOT)/$*.o $<
180 $(OBJROOT)/%.o: %.cpp
181 $(CC) $(ALL_CFLAGS) -c -o $(OBJROOT)/$*.o $<