# Use USB fo transfer.
USB=-U

# Path to the NXC compiler relative to the Makefile
NXC=nbc
NXTCOM=nxtcom

# Options to pass to the compiler
OPTIONS=-Z2

# Change the name of the program helloworld.rxe to be whatever you want
# to name the final executable
PROGRAM=gear_box

all: $(PROGRAM).rxe download

$(PROGRAM).rxe: $(PROGRAM).nxc Makefile
	$(NXC) -O=$(PROGRAM).rxe \
	$(OPTIONS) \
	$(PROGRAM).nxc

download: $(PROGRAM).rxe
	$(NXTCOM) $(USB) $(PROGRAM).rxe

clean:
	/bin/rm -Rf $(PROGRAM).rxe *~
