Go to Post "prepare to take flight"! I see people taking off shoes and waiting in long lines. - 346CADmen [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-02-2004, 20:11
wun's Avatar
wun wun is offline
Registered User
AKA: David Wolever
#0865 (Warp7)
Team Role: Programmer
 
Join Date: Dec 2003
Rookie Year: 2001
Location: Toronto
Posts: 84
wun will become famous soon enough
Send a message via AIM to wun Send a message via MSN to wun
Makefile for programming under Windows with cygwin

I have been forced into the unfortunate situation of having to program the robot under Windows this year. I also can not stand the MPLAB IDE. This is why I wrote this makefile, so I could program the robot with Vim, and use cygwin/make to compile it. (For those of you who don't know, cygwin allows you to use most common Linux commands from Windows. You can get it here: http://www.cygwin.com/)
If my server is up, you can see an pretty HTML version of the makefile here --> http://wolever.no-ip.com/makefile.html
If its down, I have attached the original makefile so you can use that.
You shouldent have to modify it too much - the only thing you will have to change for sure is the path to your code (unless you keep your code in c:\robotics\FrcCode\)
I hope this helps!
Attached Files
File Type: txt Makefile.txt (1.7 KB, 84 views)
__________________
Help Microsoft stop piracy. Use Linux!

I have three gmail invitations, message me if you want one

Last edited by wun : 18-02-2004 at 21:32.
  #2   Spotlight this post!  
Unread 21-04-2004, 05:26
MikeDubreuil's Avatar
MikeDubreuil MikeDubreuil is offline
Carpe diem
FRC #0125 (Nu-Trons)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Boston, MA
Posts: 967
MikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond repute
Send a message via AIM to MikeDubreuil
Re: Makefile for programming under Windows with cygwin

Very cool, thanks for you help guys.
__________________
"FIRST is like bling bling for the brain." - Woodie Flowers
  #3   Spotlight this post!  
Unread 21-04-2004, 06:57
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Makefile for programming under Windows with cygwin

Thanks a ton. I strongly disliked the IDE too, but never was able to write makefiles that worked for unknown reasons...
__________________

  #4   Spotlight this post!  
Unread 21-04-2004, 07:30
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Makefile for programming under Windows with cygwin

I don't like MPLAB much, but it's good enough. (I've worked with worse; BrixCC, MSW LOGO, Notepad...). But I do need an excuse to learn Linux.
  #5   Spotlight this post!  
Unread 24-04-2004, 21:16
jdong jdong is offline
Linux Nerd
AKA: John D
#0245 (Adam-Bots)
Team Role: Programmer
 
Join Date: Apr 2004
Location: Rochester, MI
Posts: 98
jdong will become famous soon enoughjdong will become famous soon enough
Re: Makefile for programming under Windows with cygwin

During Nationals, I modded this makefile, and mine is a bit 'fancier'. It's well-commented, and needs a bit of editing to remove 245-specific code (i.e. trig.c arm.c arm.h, etc)


Oh yeah, try "make me a sandwich". DONT ASK!!!

Code:
#Team 245 Adam-Bots
#Makefile -- Designed to make the robot's .hex file under Cygwin
#Created by John Dong -- Team 245 jdong@wideopenwest.com
# Based on WUN's code on ChiefDelphi

MCC18=/cygdrive/c/mcc18/bin/mcc18.exe #Don't change
PIC=18F8520 #Also don't change -- will cause compiles to fail.
 


#Common Arg flags
#-D_FRC_BOARD -- Enables FIRST extensions -- must be on!
#Oi -- Enable Integer Promotions
#w  -- warning level (3 highest, 1 lowest)
#O-  -- Disable all optimizations
#pa=? -- Procedural abstraction passes.

ARGS=-D_FRC_BOARD -Oi -w3  -pa=3


LINKER=/cygdrive/c/mcc18/bin/mplink.exe
IFILOAD=/cygdrive/c/Program\ Files/IFI_Loader/IFI_Loader.exe

#Change this to the place where your code is stored (to windows - you cant use the cyg directory)			
#NOTE -- Add an ending \\ to the folder name -- required later!
CODE_PATH=C:\\jd-code-cygwin\\
	#you gotta have the two \\ or make thinks they are escape codes

#OPTIONAL -- Recompile when hfiles change.
INCLUDE_FILES=arm.h bits.h deadreckon.h delays.h ifi_aliases.h ifi_picdefs.h ifi_utilities.h interrupts.h printf_lib.h pwm_curve.h trig.h user_routines.h
#You should not need to change the following two.
LIB_PATH=C:\\mcc18\\lib
INCLUDE_PATH=C:\\mcc18\\h

abcd:make

me:
	@echo "What kind?"
a:
	@echo "You're too slow....."
sandwich:
	@echo "Here you go!"
	@echo -n
	@echo -n
	@echo " =========      <-- BREAD"
	@echo "~~~~~~~~~~~     <-- mmm, CHEESE"
	@echo " ^^^^^^^^^      <-- Use your imagination..."
	@echo " *********      <-- Like this could be meat..."
	@echo " =========      <-- well, at least this is BREAD"
	@echo -n
	@echo -n


#Default -- make the hex file
make: FrcCode.hex

#Saves a timestamped tbz2 backup
backup: FrcCode.hex
	./backup.sh
#Checks default libs
check:
	./chklib.sh
#Remove all the individual file backup (The files ending with ~)
#NOTE that this does NOT remove your tbz2 backups!
clean-backup-files:
	rm -rf *~

#Removes all compiled files from the directory
clean:
	rm -rf *.o Frccode.hex *.cod *.cof *.err *~ *.rej

#Remove hexfiles
nohex:
	rm -rf *.hex *.cod *.cof

auton_test:
	patch -f < auton-test.patch
auton_notest:
	patch -Rf < auton-test.patch
#These all start the IFI Loader.
safeload: prettycode clean check load

load: FrcCode.hex
	echo ${CODE_PATH}FrcCode.hex > /cygdrive/c/Program\ Files/IFI_Loader/LastHexFile.txt

	unix2dos /cygdrive/c/Program\ Files/IFI_Loader/LastHexFile.txt
 
	kill `ps -s | grep IFI_Loader`>crap > crap || true > crap > crap
	rm crap || true
	nice -n 5 $(IFILOAD) & 

prettycode:
	indent *.c *.h && rm *~

all: clean FrcCode.hex



FrcCode.hex :  ${INCLUDE_FILES} main.o user_routines_fast.o user_routines.o printf_lib.o ifi_utilities.o ifi_startup.o arm.o bits.o deadreckon.o interrupts.o pwm_curve.o trig.o
	$(LINKER) /l"$(LIB_PATH)" "18f8520user.lkr" "$(CODE_PATH)main.o" "$(CODE_PATH)user_routines_fast.o" "$(CODE_PATH)user_routines.o" "$(CODE_PATH)printf_lib.o" "$(CODE_PATH)ifi_utilities.o" "$(CODE_PATH)ifi_startup.o" "$(CODE_PATH)arm.o" "$(CODE_PATH)bits.o" "$(CODE_PATH)deadreckon.o" "$(CODE_PATH)interrupts.o" "$(CODE_PATH)pwm_curve.o" "$(CODE_PATH)trig.o" "$(CODE_PATH)FRC_library.lib" /m"FrcCode.map" /o"FrcCode.cof"



printf_lib.o : printf_lib.c ${INCLUDE_FILES}
	$(MCC18) -p=$(PIC) "printf_lib.c" -fo="printf_lib.o" /i"$(INCLUDE_PATH)"

user_routines.o : user_routines.c ${INCLUDE_FILES}
	$(MCC18) -p=$(PIC) "user_routines.c" -fo="user_routines.o" /i"$(INCLUDE_PATH)" $(ARGS)

user_routines_fast.o : user_routines_fast.c ${INCLUDE_FILES}
	$(MCC18) -p=$(PIC) "user_routines_fast.c" -fo="user_routines_fast.o" /i"$(INCLUDE_PATH)" $(ARGS)

main.o : main.c ${INCLUDE_FILES}
	$(MCC18) -p=$(PIC) "main.c" -fo="main.o" /i"$(INCLUDE_PATH)" $(ARGS)

ifi_utilities.o : ifi_utilities.c ${INCLUDE_FILES}
	$(MCC18) -p=$(PIC) "ifi_utilities.c" -fo="ifi_utilities.o" /i"$(INCLUDE_PATH)" $(ARGS)

ifi_startup.o : ifi_startup.c ${INCLUDE_FILES}
	$(MCC18) -p=$(PIC) "ifi_startup.c" -fo="ifi_startup.o" /i"$(INCLUDE_PATH)"$(ARGS)

arm.o : arm.c ${INCLUDE_FILES}
	$(MCC18) -p=$(PIC) "arm.c" -fo="arm.o" /i"$(INCLUDE_PATH)" $(ARGS)

bits.o : bits.c ${INCLUDE_FILES}
	$(MCC18) -p=$(PIC) "bits.c" -fo="bits.o" /i"$(INCLUDE_PATH)" $(ARGS)

deadreckon.o : deadreckon.c ${INCLUDE_FILES}
	$(MCC18) -p=$(PIC) "deadreckon.c" -fo="deadreckon.o" /i"$(INCLUDE_PATH)" $(ARGS)

interrupts.o : interrupts.c ${INCLUDE_FILES}
	$(MCC18) -p=$(PIC) "interrupts.c" -fo="interrupts.o" /i"$(INCLUDE_PATH)" $(ARGS)

pwm_curve.o : pwm_curve.c ${INCLUDE_FILES}
	$(MCC18) -p=$(PIC) "pwm_curve.c" -fo="pwm_curve.o" /i"$(INCLUDE_PATH)" $(ARGS)

trig.o : trig.c ${INCLUDE_FILES}
	$(MCC18) -p=$(PIC) "trig.c" -fo="trig.o" /i"$(INCLUDE_PATH)" $(ARGS)
__________________
John Dong
Co-Captain, Webmaster / Programmer
Team 245 -- Rochester Adams Robotics
  #6   Spotlight this post!  
Unread 29-04-2004, 20:57
wun's Avatar
wun wun is offline
Registered User
AKA: David Wolever
#0865 (Warp7)
Team Role: Programmer
 
Join Date: Dec 2003
Rookie Year: 2001
Location: Toronto
Posts: 84
wun will become famous soon enough
Send a message via AIM to wun Send a message via MSN to wun
Re: Makefile for programming under Windows with cygwin

nice work *gives thumbs up*
When I get to it with my grade 9ns who I am teaching C (this year I was the only programmer on our team) I will fix up my version to support sandwitch and header files (I didnt do much work with header files, so I forgot I had to include them).
Im glad you guys like it thou
__________________
Help Microsoft stop piracy. Use Linux!

I have three gmail invitations, message me if you want one
  #7   Spotlight this post!  
Unread 29-04-2004, 21:04
phrontist's Avatar
phrontist phrontist is offline
Proto-Engineer
AKA: Bjorn Westergard
FRC #1418 (Vae Victus)
Team Role: College Student
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Falls Church, VA
Posts: 828
phrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond repute
Send a message via AIM to phrontist
Re: Makefile for programming under Windows with cygwin

Very, very, nice work.

I should be able to convince the Windows-Nazi Administration at my school to LFS (yeah, I guess that's a verb now) the laptop they gave me.

If not, this will provide me solice.

Oh, and while I'm at it:

Emacs sucks

Anyone care to start the editor holy war thread?
__________________

University of Kentucky - Radio Free Lexington

"I would rather have a really big success or a really spectacular crash and failure then live out the warm eventual death of mediocrity" - Dean Kamen
  #8   Spotlight this post!  
Unread 29-04-2004, 21:11
wun's Avatar
wun wun is offline
Registered User
AKA: David Wolever
#0865 (Warp7)
Team Role: Programmer
 
Join Date: Dec 2003
Rookie Year: 2001
Location: Toronto
Posts: 84
wun will become famous soon enough
Send a message via AIM to wun Send a message via MSN to wun
Re: Makefile for programming under Windows with cygwin

Quote:
Originally Posted by phrontist
Emacs sucks

Anyone care to start the editor holy war thread?
I totally agree
__________________
Help Microsoft stop piracy. Use Linux!

I have three gmail invitations, message me if you want one
  #9   Spotlight this post!  
Unread 30-04-2004, 14:25
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Makefile for programming under Windows with cygwin

But I would love to scrape the Apple logo off and run Redhat. (And OS X is unix based)
  #10   Spotlight this post!  
Unread 09-05-2004, 11:08
jdong jdong is offline
Linux Nerd
AKA: John D
#0245 (Adam-Bots)
Team Role: Programmer
 
Join Date: Apr 2004
Location: Rochester, MI
Posts: 98
jdong will become famous soon enoughjdong will become famous soon enough
Re: Makefile for programming under Windows with cygwin

Quote:
Originally Posted by Astronouth7303
But I would love to scrape the Apple logo off and run Redhat. (And OS X is unix based)
Correction... OSX _IS_ Unix...
__________________
John Dong
Co-Captain, Webmaster / Programmer
Team 245 -- Rochester Adams Robotics
  #11   Spotlight this post!  
Unread 03-09-2004, 11:33
jdong jdong is offline
Linux Nerd
AKA: John D
#0245 (Adam-Bots)
Team Role: Programmer
 
Join Date: Apr 2004
Location: Rochester, MI
Posts: 98
jdong will become famous soon enoughjdong will become famous soon enough
Re: Makefile for programming under Windows with cygwin

In preparation for the new FIRST season, I'm rewriting the makefile to run under Linux, calling MCC with wine when necessary. I'm also working on a LiveCD that'll include the PBASIC Stamp editor and MCC (in some fashion) and wine.
__________________
John Dong
Co-Captain, Webmaster / Programmer
Team 245 -- Rochester Adams Robotics
  #12   Spotlight this post!  
Unread 03-09-2004, 19:11
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
Re: Makefile for programming under Windows with cygwin

Quote:
Originally Posted by jdong
In preparation for the new FIRST season, I'm rewriting the makefile to run under Linux, calling MCC with wine when necessary. I'm also working on a LiveCD that'll include the PBASIC Stamp editor and MCC (in some fashion) and wine.
Now that would be NICEE!!!
__________________
1139 Alumni
  #13   Spotlight this post!  
Unread 03-09-2004, 22:32
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: Makefile for programming under Windows with cygwin

Quote:
Originally Posted by jdong
I'm also working on a LiveCD that'll include the PBASIC Stamp editor and MCC (in some fashion) and wine.
Keep in mind that you would not be able to distribute such a CD if you finish it, since MCC is a commercial product that you're not allowed to redistribute (unless I'm mistaken).
  #14   Spotlight this post!  
Unread 04-09-2004, 14:35
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
Re: Makefile for programming under Windows with cygwin

Quote:
Originally Posted by Dave Flowerday
Keep in mind that you would not be able to distribute such a CD if you finish it, since MCC is a commercial product that you're not allowed to redistribute (unless I'm mistaken).
It seems to me that we all have legit C18 licences and as long as we don't violate our licences he would not be doing anyhting illegal. Besides do you think any of us or anyone at microchip for that matter even care? We are not defrauding them of anyhting. *hides in fear of flames*
__________________
1139 Alumni
  #15   Spotlight this post!  
Unread 16-09-2004, 21:38
jdong jdong is offline
Linux Nerd
AKA: John D
#0245 (Adam-Bots)
Team Role: Programmer
 
Join Date: Apr 2004
Location: Rochester, MI
Posts: 98
jdong will become famous soon enoughjdong will become famous soon enough
Re: Makefile for programming under Windows with cygwin

Quote:
Originally Posted by Dave Flowerday
Keep in mind that you would not be able to distribute such a CD if you finish it, since MCC is a commercial product that you're not allowed to redistribute (unless I'm mistaken).

The version of C18 that they provided us (C-Bot) is a stripped version of mcc -- its hex files are IFI-specific -- they will not run on any old PIC18Fxxxx

Furthermore it does _NOT_ come with a license agreement on the CD. I've contacted both IFI and Microchip, asking about licensing & permission to distribute the .exe on a LiveCD.
__________________
John Dong
Co-Captain, Webmaster / Programmer
Team 245 -- Rochester Adams Robotics
Closed Thread


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
Linux And Windows XP Raven_Writer Chit-Chat 4 06-08-2003 18:53
Windows ME robot180 Chit-Chat 11 07-07-2003 00:21


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

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