I'm in the process of porting a Linux application to Mac. I have different files with the source code that can get compiled and linked using the standard Makefile.
I'm going to be porting that code to Mac and continue writing code in C (sorry, no obj-c). Is there a way to create a project on XCode, add the existing code so I can use XCode and the IDE, compile and debug the code and generate Mac Makefiles?
Thanks for the help
Importing into XcodeOpen Xcode and select Open Another Project or File, Open. Open the folder you unzipped from your Dropsource download and locate the file with “. xcodeproj” extension in the root directory. Select the file and click Open.
In the Xcode Groups & Files pane, right-click <Project Name>, and create a new group in your project. Import the generated code into the new group by selecting Add, then Existing Files. Navigate to the directory that contains the generated code. Select both the includes and src folders for the generated code.
Launch Xcode, then click “Create a new Xcode project” in the Welcome to Xcode window or choose File > New > Project. In the sheet that appears, select the target operating system or platform and a template under Application. In the following sheets, fill out the forms and choose options to configure your project.
New Project -> Other -> External Build System
(in new project)
Expand "Targets"
select the target the template created
press return
edit the target settings:
/usr/bin/make
for invocation. if you want to use some other build system, then you'll have more to configure.note that you'll lose some integration when using a makefile.
you can regain some of that by adding the sources to the project (drag and drop), and not associating them with a target.
to improve navigation and code completion, you may want to create a second (dummy) target (such as a static library) so the ide parses your programs. you would then add the sources to the dummy static library, and set the makefile as a 'dependency' of the static library (so it gets built, and so it gets built first).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With