<div dir="ltr">Hi All,<div><br></div><div> I just blew an hour investigating converting the xcode build files to Makefiles. I've hit a wall but I thought I'd share because</div><div>a) someone might want to take a tilt at this themselves</div><div>b) someone might have a nifty way around the wall</div><div><br></div><div>So what's the issue here? Under <a href="http://www.squeakvm.org/svn/squeak/branches/Cog/{build.macos32x86,build.macos64x64}">http://www.squeakvm.org/svn/squeak/branches/Cog/{build.macos32x86,build.macos64x64}</a> are build directories for each configuration of cog, such as squeak.cog.v3 or newspeak.stack.spur. These contain project files. The old 10.6 Carbon UI project files are called CoreVM.xcodeproj/project.pbxproj and the new 10.8 Cocoa UI ones, currently extant for only {build.macos32x86,build.macos64x64}/squeak.cog.spur) are called SqueakCogSpur32x86.xcodeproj/project.pbxproj.</div><div><br></div><div>There are also a bunch of projects for external plugins such as SqueakFFIPrims/SqueakFFIPrims.xcodeproj. These things are all monolithic property lists with lots of commonality and they differ only slightly, mostly to include the relevant interp.h file for the configuration. For example, build.macos32x86/squeak.cog.v3 uses src/vm/interp.h, build.macos32x86/squeak.cog.spur uses spursrc/vm/interp.h, build.macos64x64/squeak.cog.spur uses spur64src/vm/interp.h, etc.</div><div><br></div><div>Now, if these were replaced by makefiles, they could trivially be parameterised by the relevant interp.h and lots of duplication would disappear. It would be much faster to add a new configuration, etc.</div><div><br></div><div>So how to derive the first set of makefiles? Manually, obviously, but ghaaa, no please no.</div><div><br></div><div>So I found GNUStep's pbxbuild. This was deprecated in 2012 and apparently applies only to xcode version 2 project files, not the version 3.2 we're using. It still builds and installs (with a little bit of effort):</div><div><br></div><div>1. download GNUStep Makefiles from <a href="http://wwwmain.gnustep.org/resources/downloads.php?site=ftp%3A%2F%2Fftp.gnustep.org%2Fpub%2Fgnustep%2F">http://wwwmain.gnustep.org/resources/downloads.php?site=ftp%3A%2F%2Fftp.gnustep.org%2Fpub%2Fgnustep%2F</a></div><div>2. unpack the tar</div><div> $ tar xzf ~/Downloads/gnustep-make-2.6.7.tar.gz</div><div>3. cd and build</div><div> $ cd gnustep-make-2.6.7/;./configure; sudo gnumake install</div><div><br></div><div>4. Download pbxbuild from github</div><div> $ git clone <a href="https://github.com/gnustep/pbxbuild.git">https://github.com/gnustep/pbxbuild.git</a> pbxbuild</div><div>5. cd and build</div><div> $ cd pbxbuild; GNUSTEP_MAKEFILES=/Library/GNUstep/Makefiles make -f GNUmakefile</div><div><br></div><div>But when one tries this (-g = generate makefiles)</div><div> $ cd build.macos32x86/squeak.cog.spur; ~/src/pbxbuild/pbxbuild -g SqueakCogSpur32x86.xcodeproj</div><div>it outputs some errors and segfaults:</div><div><div>2016-01-09 09:55:44.568 pbxbuild[33864:507] -[PBPbxProject initWithFile:](146) rootObject class: __NSCFDictionary</div><div>2016-01-09 09:55:44.569 pbxbuild[33864:507] -[PBPbxProject initWithFile:](147) description: </div><div>2016-01-09 09:55:44.569 pbxbuild[33864:507] -[PBPbxProject initWithFile:](148) {</div><div> buildConfigurationList = 94D95B1D0923E6810034C6F0;</div><div> compatibilityVersion = "Xcode 2.4";</div><div> developmentRegion = English;</div><div> hasScannedForEncodings = 1;</div><div> isa = PBXProject;</div><div> knownRegions = (</div><div> English,</div><div> Japanese,</div><div> French,</div><div> German</div><div> );</div><div> mainGroup = 08773EB500C6A1C4C0A80109;</div><div> productRefGroup = 08773F3000C6A1C4C0A80109;</div><div> projectDirPath = "";</div><div> projectRoot = "";</div><div> targets = (</div><div> 941A3B2B09AA144000C9D25A</div><div> );</div><div>}</div><div>2016-01-09 09:55:44.570 pbxbuild[33864:507] -[PBPbxProject(Private) addGroupRecursivelyByKey:parentPath:](82) Examining Group with name: 'Sources'</div><div>2016-01-09 09:55:44.571 pbxbuild[33864:507] Warning: Unknown reference type '(null)' in PBXGroup!</div><div>2016-01-09 09:55:44.571 pbxbuild[33864:507] Warning: Unknown reference type '(null)' in PBXGroup!</div><div>2016-01-09 09:55:44.571 pbxbuild[33864:507] Warning: Unknown reference type '(null)' in PBXGroup!</div><div>2016-01-09 09:55:44.572 pbxbuild[33864:507] Warning: Unknown reference type '(null)' in PBXGroup!</div><div>Segmentation fault: 11</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div>Then the thought is to try parsing the project files with Smalltalk and writing the exporter myself. (In fact I tried this first cuz I suspected pbxbuild would be a bust). So one can convert a project.pbxproj file to an xml file via</div><div>$ plutil -convert xml1 -o - SqueakCogSpur32x86.xcodeproj/project.pbxproj >SqueakCogSpur32x86.xml</div><div>and I loaded XML_Parser. But the resulting tree is so deeply nested I gave up.</div><div><br></div><div>The next thought was that yes, I could try and debug the pbxbuild Objective-C, but that would take time learning new tools, and it would be much nicer to use Smalltalk. So I cast around for an Objective-C to Smalltalk translator. I can't find one. There /are/ Objective-C to Java and Objective-C to Swift translators. But I'm not about to try and convert those so that I can convert the pbxbuild code to Smalltalk. But I thought there might be some folks here that have copious free time and are crazy enough to try. hence this message.</div><div><br></div><div>good morning.</div><div><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>