Nat! bio photo

Nat!

Senior Mull

Twitter Github Twitch

mulle_xcode_to_make now on bitbucket

I have decided to place a work in progress on bitbucket.
It's called mulle_xcode_to_make and it's a tool to convert the project.pbxproj file into a Makefile.


If you want to try it out, do:

hg clone https://bitbucket.org/mulle_nat/mulle_xcode_configurations
hg clone https://bitbucket.org/mulle_nat/mulle_xcode_to_make
cd mulle_xcode_to_make
xcodebuild -configuration Debug
./build/Debug/mulle_xcode_to_make mulle_xcode_to_make.xcodeproj

I started this, because I didn't like either PTOMAKE nor pbxbuild.

Currently it produces something like this:

#
#
# Makefile created with mulle_xcode_to_make
# on 2010-12-30 00:11:31 +0100 by nat
#

# Default Target and Configuration
#
ifndef CONFIGURATION
CONFIGURATION = Release
endif
ifndef TARGET
TARGET = mulle_xcode_to_make
endif


# Some stuff needed to get it all working

_CFLAGS_LOCAL_INCLUDE_DIRS = -I.
CC=gcc
CFLAGS = $(_CFLAGS) $(_CFLAGS_LOCAL_INCLUDE_DIRS)
LDFLAGS = $(_LDFLAGS) $(_LDFLAGS_LOCAL_LIBRARY_DIRS)

###
# Settings for Target "mulle_xcode_to_make"
#
ifeq "$(TARGET)" "mulle_xcode_to_make"

#
# Configurations
#
# common settings
MACH_O_TYPE = mh_execute
PRODUCT_NAME = mulle_xcode_to_make
_CFLAGS = -mdynamic-no-pic
_CPPFLAGS = -mdynamic-no-pic

#
# Operations for Phase "ShellScriptBuildPhase"
#

#
# Operations for Phase "CopyFilesBuildPhase"
#

#
# Operations for Phase "FrameworksBuildPhase"
#
$(EXECUTABLE_NAME): $(MULLE_XCODE_TO_MAKE_OBJECT_FILES)
        $(LD) $(LDFLAGS) -o $(EXECUTABLE_NAME) \
        $(MULLE_XCODE_TO_MAKE_OBJECT_FILES) \
        -framework Foundation
clean:
        rm $(MULLE_XCODE_TO_MAKE_OBJECT_FILES)
        rm -rf $(EXECUTABLE_NAME)

#
# Operations for Phase "SourcesBuildPhase"
#
MULLE_XCODE_TO_MAKE_OBJECT_FILES = main.o \
        PBXObject.o \
        NSObject+DecodeWithObjectStorage.o \
        MullePBXUnarchiver.o \
        PBXObject+MakefileDescription.o \
        NSTask+System.o \
        NSString+XcconfigSettings.o \
        Xcode.o \
        NSArray+MulleFirstObject.o \
        XcodePlugin.o \
        NSDictionary+CommonAndDifferences.o \
        PBXProject+MakefileDescription.o \
        XcodePlatform.o \
        XcodeCorePlugin.o \
        XcodeGCCPlugin.o \
        NSMutableDictionary+Settings.o \
        NSObject+StringReplacementHack.o \
        PBXBuildPhase+MakefileDescription.o

main.o: main.m MullePBXUnarchiver.h PBXObject+MakefileDescription.h \
  PBXObject.h

PBXObject.o: PBXObject.m PBXObject.h MullePBXUnarchiver.h

NSObject+DecodeWithObjectStorage.o: NSObject+DecodeWithObjectStorage.m \
  NSObject+DecodeWithObjectStorage.h

MullePBXUnarchiver.o: MullePBXUnarchiver.m MullePBXUnarchiver.h \
  NSObject+DecodeWithObjectStorage.h PBXObject.h

PBXObject+MakefileDescription.o: PBXObject+MakefileDescription.m \
  PBXObject+MakefileDescription.h PBXObject.h \
  NSObject+DecodeWithObjectStorage.h NSTask+System.h \
  NSString+XcconfigSettings.h Xcode.h

NSTask+System.o: NSTask+System.m NSTask+System.h

NSString+XcconfigSettings.o: NSString+XcconfigSettings.m \
  NSString+XcconfigSettings.h

Xcode.o: Xcode.m Xcode.h NSArray+MulleFirstObject.h NSTask+System.h \
  XcodePlatform.h XcodePlugin.h NSMutableDictionary+Settings.h

NSArray+MulleFirstObject.o: NSArray+MulleFirstObject.m \
  NSArray+MulleFirstObject.h

XcodePlugin.o: XcodePlugin.m XcodePlugin.h Xcode.h XcodeCorePlugin.h \
  XcodeGCCPlugin.h

NSDictionary+CommonAndDifferences.o: NSDictionary+CommonAndDifferences.m \
  NSDictionary+CommonAndDifferences.h NSArray+MulleFirstObject.h

PBXProject+MakefileDescription.o: PBXProject+MakefileDescription.m \
  PBXProject+MakefileDescription.h PBXObject.h \
  PBXObject+MakefileDescription.h PBXBuildPhase+MakefileDescription.h \
  NSArray+MulleFirstObject.h NSDictionary+CommonAndDifferences.h \
  NSMutableDictionary+Settings.h NSString+XcconfigSettings.h Xcode.h \
  XcodeGCCPlugin.h XcodePlugin.h

XcodePlatform.o: XcodePlatform.m XcodePlatform.h Xcode.h \
  NSArray+MulleFirstObject.h NSMutableDictionary+Settings.h

XcodeCorePlugin.o: XcodeCorePlugin.m XcodeCorePlugin.h XcodePlugin.h \
  Xcode.h

XcodeGCCPlugin.o: XcodeGCCPlugin.m XcodeGCCPlugin.h XcodePlugin.h Xcode.h

NSMutableDictionary+Settings.o: NSMutableDictionary+Settings.m \
  NSMutableDictionary+Settings.h NSObject+StringReplacementHack.h

NSObject+StringReplacementHack.o: NSObject+StringReplacementHack.m \
  NSObject+StringReplacementHack.h

PBXBuildPhase+MakefileDescription.o: PBXBuildPhase+MakefileDescription.m \
  PBXBuildPhase+MakefileDescription.h PBXObject.h \
  PBXObject+MakefileDescription.h NSObject+DecodeWithObjectStorage.h \
  NSTask+System.h NSString+XcconfigSettings.h Xcode.h

endif

So you get an idea where this is heading, and you can also see, where there are problems. Basically the compilation is already pretty much OK concerning include directories and CFLAGS and header dependencies.

The exception is, that ARCHS isn't used/interpreted/printed properly.

Linking isn't really aware of any product types yet. There is no support for installation and packaging of frameworks.

This amongst many other problems.