|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
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! Last edited by wun : 18-02-2004 at 21:32. |
|
#2
|
|||||
|
|||||
|
Re: Makefile for programming under Windows with cygwin
Very cool, thanks for you help guys.
|
|
#3
|
||||
|
||||
|
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
|
|||||
|
|||||
|
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
|
|||
|
|||
|
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) |
|
#6
|
|||||
|
|||||
|
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 |
|
#7
|
|||||
|
|||||
|
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? ![]() |
|
#8
|
|||||
|
|||||
|
Re: Makefile for programming under Windows with cygwin
Quote:
|
|
#9
|
|||||
|
|||||
|
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
|
|||
|
|||
|
Re: Makefile for programming under Windows with cygwin
Quote:
|
|
#11
|
|||
|
|||
|
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.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |