?

Log in

No account? Create an account
PBTOMAKE - XCode on Linux! - Joe Mason
May 11th, 2006
11:15 pm

[Link]

Previous Entry Share Next Entry
PBTOMAKE - XCode on Linux!
PBTOMAKE is a nice program to convert Xcode and Project Builder files from MacOS X to Makefiles that can be used on Linux (or other Unix varients). This is useful, for example, as a first step to porting an application from Cocoa to GNUstep.

The tool is described prominently in this MacDevCenter article which unfortunately shows up nowhere on Google - at least, not if you search for any combination of "Xcode", "Linux", and "GNUstep". It's the second hit for "Xcode Unix", though. It's a shame I never thought to search for that - I eventually found a Usenet post by the author and emailed him for the download link, but it could have saved me days if it had been found by Google under "Linux" and Xode as well.

So this post is my attempt to give the tool more visibility: XCODE XCODE XCODE XCODE LINUX LINUX LINUX LINUX.

There. And now for some content: to use it on Linux, put it in a directory and unzip it there. This gives you lots of directores with _'s in their names, which I assume are from Resource Forks and other Mac wackiness. Go to TOMAKE-Xcode2.1/Source/PBTOMAKE/ and edit the makefile there - ignore the makefile in the Source directory, it doesn't work. Take out the "CC=/usr/bin/g++-4.0" line (YOU should be setting the CC variable, not the makefile), and change the "$(CC) $(LNK_OPTIONS)" line to "$(CXX) $(LNK_OPTIONS)" to be sure it links with a C++ compiler. Now it should build!

The instructions are in a file called "pbtomake.pdf", and they start out by telling you to prepare your XCode source by "making all file references Project Relative". This is pretty easy to do without just an editor, as long as the project doesn't use the old binary-only Xcode format: open the .xcodeproj (Xcode) or .pbxproj (ProjectBuilder, I assume) file, and replace all instances of "<group>" and "<absolute>" with "<project>". Only problem is then you'll have to fix a bunch of paths in the resulting makefile. I'm still not sure the best way around that.

Tags: , ,

(8 comments | Leave a comment)

Comments
 
[User Picture]
From:spelloodeedoo
Date:May 12th, 2006 01:08 pm (UTC)
(Link)
God I'm happy to work on a Microsoft platform. :P
[User Picture]
From:joenotcharles
Date:May 12th, 2006 08:22 pm (UTC)
(Link)
I'm working on Microsoft in my day job, and porting from Mac to Linux in my spare time. I'm a renaissance geek!
[User Picture]
From:nothings
Date:May 12th, 2006 03:43 pm (UTC)
(Link)
Replace all instances of "" and "" with ""? Sounds tricky.
[User Picture]
From:joenotcharles
Date:May 12th, 2006 08:24 pm (UTC)
(Link)
Whoops - HTML escaping.
[User Picture]
From:hellocire
Date:May 13th, 2006 05:36 am (UTC)
(Link)
nice find. You should submit a digg story :)
[User Picture]
From:notofthisworld
Date:May 19th, 2006 02:16 am (UTC)
(Link)
Oh hey, I'll have to remember that tool! I like to do my development in PowerBuilder, but being able to make portable makefiles would be good too.

(Sorry for the really late comment!)
From:(Anonymous)
Date:September 21st, 2007 04:59 pm (UTC)

Compiling in Linux

(Link)
The latest version lacks a proper makefile for Linux (all the paths are missing) here's a fixed one :
###################################################
#
# Makefile for pbtomake
# Creator [PBTOMAKE]
# Created: [Fri Jun 10 11:19:39 2005]
#
###################################################

#
# Macros
#

CC = g++
CC_OPTIONS = $(CXXFLAGS)

#
# INCLUDE directories for pbtomake
#

INCLUDE = -IBASE_PC/ -IBASE_PC/Dohickies/


#
# Build pbtomake
#

pbtomake : \
		main.o\
		CMaker.o\
		CTarget.o\
		BASE_PC/cutil.o\
		BASE_PC/CBufFile.o\
		BASE_PC/Dohickies/CpbxLexFile.o\
		BASE_PC/Dohickies/CSymbol.o\
		BASE_PC/Dohickies/CLexFile.o\
		BASE_PC/Dohickies/CTokFile.o
	$(CC) $(LNK_OPTIONS)	-o $@	$^ 

#
# Build the parts of pbtomake
#

%.o:	%.cp
	$(CC) $(CC_OPTIONS) -c $(INCLUDE) -o $@ $<


##### END RUN ####
From:(Anonymous)
Date:January 12th, 2008 12:00 am (UTC)

celpjefscycle

(Link)
Thanks for information.
many interesting things
Celpjefscylc
Powered by LiveJournal.com