Xcode over network

Discussion in 'Mac Programming' started by dailo, Apr 7, 2006.

  1. dailo macrumors regular

    Mar 29, 2006
    I really like to use Xcode to program but I am making KLD modules for FreeBSD and it's a pain always uploading an updated file to my FreeBSD server and compiling it. Is there anyway I can have it automatically upload the updated source code to my FreeBSD server so I don't have to do it manually everytime. i tried cyberduck's synchronization thing, but it doesn't appear to be doing it automatically when I save with Xcode. Thanks!
  2. superbovine macrumors 68030


    Nov 7, 2003
    Use SCM to work with xcode. if you need more help, i'd suggest you google for it. there is a lot resources on this topic.


    I'd suggest you have the CVS server installed on your bsd box, it can be on your mac. After you update your repository just make a CVS account for your bsd box to update it source code before compiling. You can do all this in your make file or use a different script entirely. Generally, I have two scripts one to update and clean and one to make. One of the things you will have to catch is it will update the *.o files, and you will have to clean them once you update your CVS account on your bsd box.
  3. Eraserhead macrumors G4


    Nov 3, 2005
    You "should" be able to program it in applescript with a folder action, I'm not exactly sure how to program it but it should work, alternatively you could do an applescript that runs when idle, and checks the directory for items modified after it last ran, then upload to your server.
  4. superbovine macrumors 68030


    Nov 7, 2003
    CVS does exactly what you said in the first part. however, it logs and revision numbers and all kinds of usually things for you to keep your revision straight and code sharing between multiple coders.
  5. dailo thread starter macrumors regular

    Mar 29, 2006
    Wow CVS, never really looked into this before. Seems pretty frickin awesome haha. Keeps all my revisions, thansk a lot!! I am a student programmer and this seems like it will help a lot. Thanks.
  6. dailo thread starter macrumors regular

    Mar 29, 2006
    How do I add a command in my makefile to automatically update the source before compiling it? I cannot seem to find anything on it on google. Thanks.

  7. superbovine macrumors 68030


    Nov 7, 2003
    After you learn this stuff pretty well, CVS looks great on a resume.

    This is a partial script which you should be able to modify your own makefile to work with this. I use two different scripts, this is part of my update cvs script.

    The script basically calls a cvs update then backups the old source code in a backup directory giving you another layer of revisions. after that it overwrites the old source with the updated source from the cvs.

    cat << EOF
    This script will make a backup of the ~/prod/src directory, and then replace
    ~/dev/src with a snapshot of the CVS using ~/cvsstuff/Crimson local copy
    (which will be updated).
    Press return to continue, Ctrl-C to quit out.
    read dummy
    echo "Updating the cvs local copy at ~/cvsstuff/c2src/src/"
    cd ~/cvsstuff/c2src/src/
    cvs update
    echo "Done."
    echo "Moving current source/bin directory to src_`date "+%b_%d_%Y"`."
    cd ~/dev
    mv src src_`date "+%b_%d_%Y"`
    mkdir src
    echo "Done."
    echo "Copying new src snapshot."
    cd src
    cp ~/cvsstuff/c2src/src/*.[ch] .
    cp ~/cvsstuff/c2src/src/makefile .
    cp ~/cvsstuff/c2src/src/depend .
    echo "Done."
    If this code is confusing you, read up on some shell scripting. google knows all about shell scripting. here is a link to get you started.

  8. dailo thread starter macrumors regular

    Mar 29, 2006
    Thanks a lot! I started to write my own script, but yours is much better.

    Also this CVS stuff is pretty awesome. I've always heard of it, but never took the time to look into it. But seems very useful, especially for big projects.

Share This Page