Make the makefile be smart about which OS it's running, and make

environmental changes as appropriate
This commit is contained in:
maniacbug 2011-04-01 22:57:01 -07:00
parent c2dc35652e
commit e1db4401ca
1 changed files with 18 additions and 6 deletions

View File

@ -57,17 +57,29 @@ AVRDUDE_PROTOCOL = stk500v1
COM = 33
endif
ARDUINO_VERSION = 22
PROJECT_NAME = $(notdir $(PWD))
PROJECT_DIR = .
UNAME := $(shell uname)
ifeq ($(UNAME),Darwin)
ARDUINO_VERSION = 21
ARDUINO_DIR = /opt/arduino-00$(ARDUINO_VERSION)
AVR_TOOLS_PATH = $(ARDUINO_DIR)/hardware/tools/avr/bin
AVRDUDECONFIG_PATH = $(ARDUINO_DIR)/hardware/tools/avr/etc
PORT = /dev/tty.usbserial-A600eHIs
PORT2 = /dev/tty.usbserial-A9007LmI
else
ARDUINO_VERSION = 22
ARDUINO_DIR = /opt/arduino-00$(ARDUINO_VERSION)
ARDUINO_CORE = $(ARDUINO_DIR)/hardware/arduino/cores/arduino
ARDUINO_AVR = $(ARDUINO_DIR)/hardware/tools/avr/avr/include/avr
ARDUINO_LIB = $(ARDUINO_DIR)/libraries
AVR_TOOLS_PATH = /usr/bin
AVRDUDECONFIG_PATH = $(ARDUINO_DIR)/hardware/tools
PORT = /dev/ttyUSB0
PORT2 = /dev/ttyUSB1
endif
PROJECT_NAME = $(notdir $(PWD))
PROJECT_DIR = .
ARDUINO_CORE = $(ARDUINO_DIR)/hardware/arduino/cores/arduino
ARDUINO_AVR = $(ARDUINO_DIR)/hardware/tools/avr/avr/include/avr
ARDUINO_LIB = $(ARDUINO_DIR)/libraries
F_CPU = 16000000
##########################################################