{"id":469,"date":"2015-03-10T18:37:53","date_gmt":"2015-03-11T01:37:53","guid":{"rendered":"http:\/\/www.isam.ca\/?p=469"},"modified":"2015-03-10T19:57:14","modified_gmt":"2015-03-11T02:57:14","slug":"makefile-for-d-isam-dynamic-library-in-xcode","status":"publish","type":"post","link":"https:\/\/www.isam.ca\/?p=469","title":{"rendered":"Makefile for D-ISAM dynamic library in Xcode"},"content":{"rendered":"<p>This makefile differs from a static build in the following ways:<\/p>\n<p>The library filename extension is <code>.dylib<\/code><\/p>\n<p><code>-fPIC<\/code> is added to compiler flags.<\/p>\n<p><code>-dynamiclib<\/code>\u00a0<code><\/code>is added to linker flags.<\/p>\n<p><code>INSTALL_NAME<\/code> is set to the full destination path and name of the library, as finally installed.<\/p>\n<p>Without setting install_name it would be necessary to link the library directly into the install folder, or to use the install_name_tool to set this value later. The Xcode linker refers to this value when setting the library load path in your applications.<\/p>\n<p>Please see <a href=\"http:\/\/www.isam.ca\/?p=474\">Building D-ISAM in Xcode from the command line<\/a> for more details.<\/p>\n<pre># ------------------------------------------------------------------------\r\n# DISAM                                                           MAKEFILE \r\n# ------------------------------------------------------------------------\r\n#\r\n# this version is designed to operate from your disam root folder,\r\n# and does NOT require moving everything into a common folder\r\n#\r\n# ------------------------------------------------------------------------\r\n\r\nINSTALL_NAME = \/Library\/Disam72\/libdisam72.dylib\r\n\r\nISLIBNAME = disam72\r\nISLIBWHAT = shared\r\nISEXTWHAT = dylib\r\nISCFWHAT = -fPIC\r\nISLFWHAT =\r\nISCFOFFB = -D_FILE_OFFSET_BITS=64\r\nISLFOFFB =\r\nISBINLIBS =\r\nISCFLAGS =\r\nISLFLAGS =\r\n\r\n# ------------------------------------------------------------------------\r\n\r\nISINCLUDE = -Ihead -Ibase -Idecs -Iutil -Itest -Iexport\r\n\r\nNAME = $(ISLIBNAME)\r\nWHAT = $(ISLIBWHAT)\r\nTYPE = $(ISEXTWHAT)\r\n\r\nWHERE= target\/$(NAME)_$(WHAT)\r\n\r\nISAM = $(WHERE)\/lib\/lib$(NAME)\r\n\r\nLIBS = -l$(NAME) $(ISBINLIBS)\r\n\r\nCFLG = $(ISCFWHAT) $(ISCFOFFB) $(ISCFLAGS) $(CFLAGS)\r\nLFLG = $(ISLFWHAT) $(ISLFOFFB) $(ISLFLAGS) $(LDFLAGS)\r\n\r\nBASE =\tbase\/isaccess.o \\\r\n\tbase\/isapface.o \\\r\n\tbase\/isremote.o \\\r\n\tbase\/isadmin.o \\\r\n\tbase\/isaudit.o \\\r\n\tbase\/isbuild.o \\\r\n\tbase\/ischeck.o \\\r\n\tbase\/isclustr.o \\\r\n\tbase\/iscomp.o \\\r\n\tbase\/iscustom.o \\\r\n\tbase\/isdatio.o \\\r\n\tbase\/isdelete.o \\\r\n\tbase\/isentry.o \\\r\n\tbase\/iserase.o \\\r\n\tbase\/isfree.o \\\r\n\tbase\/isglobal.o \\\r\n\tbase\/isgrow.o \\\r\n\tbase\/ishead.o \\\r\n\tbase\/isidxdel.o \\\r\n\tbase\/isidxio.o \\\r\n\tbase\/isindex.o \\\r\n\tbase\/isinfo.o \\\r\n\tbase\/iskey.o \\\r\n\tbase\/islast.o \\\r\n\tbase\/islocate.o \\\r\n\tbase\/islock.o \\\r\n\tbase\/ismemory.o \\\r\n\tbase\/ismif.o \\\r\n\tbase\/isnode.o \\\r\n\tbase\/isopen.o \\\r\n\tbase\/ispath.o \\\r\n\tbase\/isprune.o \\\r\n\tbase\/isread.o \\\r\n\tbase\/isrepair.o \\\r\n\tbase\/issquash.o \\\r\n       \tbase\/isbytes.o \\\r\n\tbase\/isdebug.o \\\r\n\tbase\/issystem.o \\\r\n\tbase\/isnetsys.o \\\r\n\tbase\/isschema.o \\\r\n\tbase\/istrans.o \\\r\n\tbase\/istree.o \\\r\n\tbase\/isunique.o \\\r\n\tbase\/isupdate.o \\\r\n\tbase\/isvarlen.o \\\r\n\tbase\/iswrite.o\r\n\r\nWRAP =\twrap\/stdbuild.o \\\r\n\twrap\/stdcheck.o \\\r\n\twrap\/stdextra.o \\\r\n\twrap\/stdinfo.o \\\r\n\twrap\/stdlast.o \\\r\n\twrap\/stdlock.o \\\r\n\twrap\/stdmif.o \\\r\n\twrap\/stdread.o \\\r\n\twrap\/stdtrans.o \\\r\n\twrap\/stdwrap.o \\\r\n\twrap\/stdwrite.o\r\n\r\nDECS = \tdecs\/dec_roun.o \\\r\n\tdecs\/decadd.o \\\r\n\tdecs\/deccmp.o \\\r\n\tdecs\/decconv.o \\\r\n\tdecs\/deccvasc.o \\\r\n\tdecs\/decdiv.o \\\r\n\tdecs\/dececvt.o \\\r\n\tdecs\/decefcvt.o \\\r\n\tdecs\/decextra.o \\\r\n\tdecs\/decfcvt.o \\\r\n\tdecs\/decmul.o \\\r\n\tdecs\/decsub.o \\\r\n\tdecs\/dectoasc.o\r\n\r\nCO = $(CC) $(ISINCLUDE) $(CFLG)\r\nCL = $(CC) $(LFLG) -L$(WHERE)\/lib\r\nAR = ar \r\n# RANLIB = $(AR) ts\r\nRANLIB = ranlib\r\n\r\n.c.o:\r\n\t$(CO) -c $*.c -o $*.o\r\n\r\n$(ISAM).a:\t$(BASE) $(WRAP) $(DECS)\r\n\t$(AR) r $(ISAM).$(TYPE) $(BASE) $(WRAP) $(DECS)\r\n\t$(RANLIB) $(ISAM).$(TYPE)\r\n\r\n$(ISAM).dylib:\t$(BASE) $(WRAP) $(DECS)\r\n\t$(CO) -dynamiclib $(BASE) $(WRAP) $(DECS) -o $(ISAM).$(TYPE) -install_name $(INSTALL_NAME)\r\n\r\nlib:\t$(ISAM).$(TYPE)\r\n\r\ntest_A:\ttest\/bench.o test\/auto.o test\/mult.o test\/user.o test\/lock.o test\/dups.o\r\n\t$(CL) test\/auto.o test\/bench.o $(LIBS) -o $(WHERE)\/bin\/auto_test\r\n\t$(CL) test\/mult.o test\/bench.o $(LIBS) -o $(WHERE)\/bin\/mult_test\r\n\t$(CL) test\/user.o test\/bench.o $(LIBS) -o $(WHERE)\/bin\/user_test\r\n\t$(CL) test\/lock.o test\/bench.o $(LIBS) -o $(WHERE)\/bin\/lock_test\r\n\t$(CL) test\/dups.o test\/bench.o $(LIBS) -o $(WHERE)\/bin\/dups_test\r\n\r\ntest_B:\ttest\/mifs.o test\/bash.o test\/life.o\r\n\t$(CL) test\/mifs.o              $(LIBS) -o $(WHERE)\/bin\/mifs_test\r\n\t$(CL) test\/bash.o              $(LIBS) -o $(WHERE)\/bin\/bash_test\r\n\t$(CL) test\/life.o              $(LIBS) -o $(WHERE)\/bin\/life_test\r\n\r\ntest:\ttest_A test_B\r\n\r\nutil_base: util\/utility.o util\/dcheck.o util\/dstats.o util\/dpack.o util\/dbugscan.o\r\n\t$(CL) util\/dcheck.o\tutil\/utility.o\t$(LIBS) -o $(WHERE)\/bin\/dcheck\r\n\t$(CL) util\/dstats.o\tutil\/utility.o\t$(LIBS) -o $(WHERE)\/bin\/dstats\r\n\t$(CL) util\/dpack.o\tutil\/utility.o\t$(LIBS) -o $(WHERE)\/bin\/dpack\r\n\t$(CL) util\/dbugscan.o\t                $(LIBS) -o $(WHERE)\/bin\/dbugscan\r\n\r\nutil_core: util\/dsplit.o util\/dlist.o util\/dschema.o\r\n\t$(CL) util\/dsplit.o\tutil\/utility.o\t$(LIBS) -o $(WHERE)\/bin\/dsplit\r\n\t$(CL) util\/dlist.o\tutil\/utility.o\t$(LIBS) -o $(WHERE)\/bin\/dlist\r\n\t$(CL) util\/dschema.o\tutil\/utility.o\t$(LIBS) -o $(WHERE)\/bin\/dschema\r\n\r\nremote: util\/disamnet.o util\/dswabnet.o\r\n\t$(CL) util\/disamnet.o\t$(LIBS) -o $(WHERE)\/bin\/disamnet\r\n\t$(CL) util\/dswabnet.o\t$(LIBS) -o $(WHERE)\/bin\/dswabnet\r\n\r\nutil:\tutil_base util_core\r\n\r\nexport:\texport\/isreport.o export\/isfield.o export\/isload.o export\/dreport.o\r\n\t$(CL) export\/isreport.o export\/isfield.o export\/isload.o \\\r\n\t      export\/dreport.o $(LIBS) -o $(WHERE)\/bin\/dreport\r\n\r\ncheck:  test\r\n\t$(WHERE)\/bin\/dstats\r\n\t$(WHERE)\/bin\/dcheck\r\n\t$(WHERE)\/bin\/mifs_test\r\n\t$(WHERE)\/bin\/bash_test\r\n\t$(WHERE)\/bin\/dcheck bashfile\r\n\t$(WHERE)\/bin\/auto_test\r\n\t$(WHERE)\/bin\/dcheck autofile\r\n\trm -f autofile.dat autofile.idx\r\n\trm -f bashfile.idx bashfile.dat\r\n\r\nparts: lib util test check export\r\n\r\nsqueaky:\r\n\trm -rf target\/*\r\n\r\nclean:\t\r\n\trm -rf base\/*.o wrap\/*.o decs\/*.o test\/*.o util\/*.o export\/*.o server\/*.o\r\n\r\nnew:\r\n\trm -rf $(WHERE)\r\n\tmkdir -p $(WHERE)\/lib $(WHERE)\/bin\r\n\tcp head\/isconfig.h $(WHERE)\r\n\r\nall: squeaky clean new lib util test remote<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This makefile differs from a static build in the following ways: The library filename extension is .dylib -fPIC is added to compiler flags. -dynamiclib\u00a0is added to linker flags. INSTALL_NAME is set to the full destination path and name of the library, as finally installed. Without setting install_name it would be necessary to link the library [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[6,5],"_links":{"self":[{"href":"https:\/\/www.isam.ca\/index.php?rest_route=\/wp\/v2\/posts\/469"}],"collection":[{"href":"https:\/\/www.isam.ca\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.isam.ca\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.isam.ca\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.isam.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=469"}],"version-history":[{"count":7,"href":"https:\/\/www.isam.ca\/index.php?rest_route=\/wp\/v2\/posts\/469\/revisions"}],"predecessor-version":[{"id":546,"href":"https:\/\/www.isam.ca\/index.php?rest_route=\/wp\/v2\/posts\/469\/revisions\/546"}],"wp:attachment":[{"href":"https:\/\/www.isam.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=469"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.isam.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=469"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.isam.ca\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=469"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}