Go to Post "Yes, I'd like to Super Size my speed controller combo and add a jumbo distribution block, please." "You want fries with that?" - Travis Hoffman [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
View Poll Results: How interested are you?
I'll probably help develop it 13 25.49%
I'll probably beta test 11 21.57%
I'll probably use it 16 31.37%
No interest at all 11 21.57%
Voters: 51. You may not vote on this poll

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #19   Spotlight this post!  
Unread 29-12-2006, 15:24
chris31 chris31 is offline
Team 2021 Captain
AKA: Chris Davidson
FRC #2021 (FA Robotics)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2006
Location: Atlanta, GA/ Fredericksburg,VA
Posts: 949
chris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond repute
Send a message via AIM to chris31
Re: Eclipse Development

Quote:
Originally Posted by AustinSchuh View Post
I have been using Wine, Debian, makefiles, and vim to program our robot for the past 2 years. I have trouble finding the correct compiler flags. Would there be any way to extract the makefile that compiles the code from the eclipse project without installing Eclipse?
I havent tried it, but give this a shot.

PHP Code:
#!/usr/bin/env python

#Auto Makefile Generator
#Copyright under terms of GPL
#Based on Team 245's old Makefile....
#        Copyright (C) 2005  Team 245
#
#        This program is free software; you can redistribute it and/or modify
#        it under the terms of the GNU General Public License as published by
#        the Free Software Foundation; either version 2 of the License, or
#        (at your option) any later version.
#
#        This program is distributed in the hope that it will be useful,
#        but WITHOUT ANY WARRANTY; without even the implied warranty of
#        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#        GNU General Public License for more details.
#
#        You should have received a copy of the GNU General Public License
#        along with this program; if not, write to the Free Software Foundation,
#        Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.


import os

DEBUG
=False
VERSION
="0.1.92 (0.2 beta 3)"

def printGPLBanner():
    print 
"Makefile Generator, version "+VERSION+", Copyright (C) 2005 Adam-Bots"
    
print "This software comes with ABSOLUTELY NO WARRANTY"
    
print "This is free software, and you are welcome to redistribute it under certain conditions; See the accompanying license for details"
    
def isCygwin():
    
import os;
    return 
os.platform=='cygwin'

def isLinux():
    
import os;
    return 
os.platform.beginswith('linux')

def mccPath():
    
#Find path to the MCC folder.
    
if isCygwin():
        
pass
def sprint
(msg,level=0):
    
# Prints a message of a given verbosity:
        #Level 0 : Print regardless of status
        #Level 1 : Print if DEBUG is set
    
if level == 0:
        print 
msg
    elif level 
== 1:
        if 
DEBUG:
            print 
"DEBUG:",msg
    
else:
        print 
msg
def mccCommand
():
    return 
"mcc18"
def mccArgs():
    return 
"-D_FRC_BOARD -w3 pa=3 -O+ -nw=2066"
def linkerCommand():
    return 
"mplink"
def mp2hexCommand():
    return 
"mp2hex"
def ifiLoaderCommand():
    return 
"picloader_textmode"
def ifiSerialDevice():
    return 
"/dev/ttyS0"
def ifiReadLogfile():
    return 
"./read.log"
def codePath():
    
unixish_path="Z:"+os.getcwd()+"//"
    
return unixish_path.replace("/","\\")
def libPath():
    return 
"/opt/mcc18/lib"
def includePath():
    return 
"/opt/mcc18/h"
def includePathWindows():
    return 
"Z:\\\\opt\\\\mcc18\\\\h"

printGPLBanner();
print
print
print

sprint("Opening the Makefile",1)
print
outfile=open('Makefile','w')
outfile.write('#This is automatically generated by the configure.py script\n#Keep your dirty hands off');
outfile.write("\n")
outfile.write('#Run ./configure.py to generate a fresh one.')
outfile.write("\n")
outfile.write('MCC18='+mccCommand())
outfile.write("\n")
outfile.write("PIC=18F8722 # Don't change")
outfile.write("\n")
outfile.write("ARGS="+mccArgs())
outfile.write("\n")
outfile.write("LINKER="+linkerCommand())
outfile.write("\n")
outfile.write("MP2HEX="+mp2hexCommand())
outfile.write("\n")
outfile.write("IFILOAD="+ifiLoaderCommand())
outfile.write("\n")
outfile.write("SERIAL_DEV="+ifiSerialDevice())
outfile.write("\n")
outfile.write("READLOG="+ifiReadLogfile())
outfile.write("\n")
outfile.write("LIB_PATH="+libPath())
outfile.write("\n")
outfile.write("CODE_PATH="+codePath())
outfile.write("\n")
outfile.write("INCLUDE_PATH="+includePath())
outfile.write("\n")
outfile.write("INCLUDE_PATHW="+includePathWindows())
outfile.write("\n")
outfile.write("\n\n\n\n")


sprint("Enumerating Target Object Files...")
import os;
all_targets=""
pipe=os.popen("find . -maxdepth 1 -name \"*.c\" | gawk '{gsub(/\\.c/,\".o\");print}' | uniq",'rt'
line=pipe.readline()
while 
line != "":
    
all_targets+=line[2:-1]
    
all_targets+=" "
    
line=pipe.readline()

all_targets.rstrip()

outfile.write("ALL_TARGETS="+all_targets);
outfile.write("\n")
sprint("Enumerating Header Files...")

pipe=os.popen("find . -name \"*.h\"",'rt')
line=pipe.readline()
headers=""
while line != "":
        
headers+=line[2:-1]
        
headers+=" "
        
line=pipe.readline()
headers.rstrip()


outfile.write("INCLUDE_FILES="+headers);
outfile.write("\n")
outfile.write("############ Targets: ")
outfile.write("\n")
outfile.write("default: FrcCode.hex")
outfile.write("\n")

sprint("Writing static targets...")
outfile.write("""
#Remove all the individual file backup (The files ending with ~)
#NOTE that this does NOT remove your tbz2 backups!
clean-backup-files:
    @echo -e "
Removing all the backup files your annoying editor makes..."
    @find . -name "
*~" |xargs rm -f

#Removes all compiled files from the directory
clean: clean-backup-files clean-deps nohex
    @echo -e "
Cleaning compiler intermediate files..."
    @rm -rf *.o *.err

#Remove deps folder
clean-deps:
    @echo -e "
Cleaning dependency folder..."
    @rm -rf .deps
    @mkdir .deps
    @touch .deps/dummy

#Remove hexfiles
nohex:
    @echo -e "
Cleaning linker output and hex files..."
    @rm -rf *.hex *.cod *.cof

#These all start the IFI Loader.
safeload: prettycode clean check load
load: FrcCode.hex
    $(IFILOAD) FrcCode.hex $(SERIAL_DEV)

read:
    @echo -e "
Monitoring $(SERIAL_DEV) for data"
    @echo -e "
Output will also be logged to $(READLOG)"
    @echo -e "
---------"
    @cat $(SERIAL_DEV) | tee $(READLOG) || /bin/true
    
    
prettycode:
    @echo -e "
Using indent to autoformat your .and .h files..."
    @indent *.c *.h
all: clean FrcCode.hex
%.o: %.c
    @echo -e "
Compiling $@..."
    @echo -e "
1.   Checking Dependencies for $@"
    @cpp -nostdinc -isystem $(INCLUDE_PATH) -M -MP $< -MF .deps/$*.deps
    @echo -e "
2.   Launching Compiler..."
    @echo -n "
A thought to keep you occupied:  "
    @fortune -s || echo "
GET FORTUNE"
    @$(MCC18) -p=$(PIC) -fo $@ $< /i\\""$(INCLUDE_PATHW)"
\\" $(ARGS) 
    @echo -e "
Done with $@."




FrcCode.hex :  $(ALL_TARGETS) $(INCLUDE_FILES)
    @echo -e "
Linking..."
    $(LINKER) /l\\""$(LIB_PATH)"
\\" \\""18f8722.lkr"\\" $(ALL_TARGETS) \\""$(CODE_PATH)FRC_library.lib"\\" /m\\""FrcCode.map"\\" /o\\""FrcCode.cof"\\"
    $(MP2HEX) FrcCode.cof



.deps/*: 
    @echo -e "
Creating Dependency Makefiles..."
    @mkdir -p .deps
    @touch .deps/dummy
    @echo -e "
Done!"

include .deps/*
"""
)
print
print

sprint("Makefile is generated, setting up working directory....")
os.system('rm -rf .deps')
os.system('mkdir .deps')
os.system('touch .deps/dummy')

print
print
print

sprint("Finished. To build, run 'make'"
EDIT: I got Eclipse up and running on my XP laptop. I got it compiling code and all. Ill be grabbin a copy of Astros code and making sure it all runs on windows.

Last edited by chris31 : 29-12-2006 at 15:35.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Eclipse Plugin Maintaineer? duane Programming 21 31-10-2006 22:34
Eclipse Visual Editor Mike Programming 9 27-09-2006 14:05
using eclipse dasRatsel Programming 82 02-01-2006 13:20
Eclipse code formatter Astronouth7303 Programming 0 24-12-2005 17:39
Eclipse with CDT Nis Programming 2 15-06-2005 09:31


All times are GMT -5. The time now is 13:13.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi