Add USB_VID and USB_PID to CPPFLAGS only if the board is Leonardo. Fixes #43 and fixes #51

This commit is contained in:
Sudar 2013-05-31 17:05:47 +05:30
parent cd210f96ca
commit 47b2dca1ef
2 changed files with 11 additions and 3 deletions

View file

@ -3,6 +3,9 @@ A Makefile for Arduino Sketches
The following is the rough list of changes that went into different versions. I tried to give credit whenever possible. If I have missed anyone, kindly add it to the list.
### 0.10.5 (in development)
- Add USB_VID and USB_PID to CPPFLAGS only if the board is Leonardo.
### 0.10.4 (2013-05-31) @matthijskooijman
- Improved BAUD_RATE detection logic
- Added logic to check if there is only .ino or .pde file

View file

@ -428,11 +428,11 @@ endif
ifeq ($(VARIANT),leonardo)
# USB IDs for the Leonardo
ifndef USB_VID
USB_VID = $(shell $(PARSE_BOARD_CMD) $(BOARD_TAG) build.vid)
USB_VID = $(shell $(PARSE_BOARD_CMD) $(BOARD_TAG) build.vid 2>/dev/null)
endif
ifndef USB_PID
USB_PID = $(shell $(PARSE_BOARD_CMD) $(BOARD_TAG) build.pid)
USB_PID = $(shell $(PARSE_BOARD_CMD) $(BOARD_TAG) build.pid 2>/dev/null)
endif
endif
@ -624,8 +624,13 @@ DEPS = $(LOCAL_OBJS:.o=.d) $(LIB_OBJS:.o=.d) $(USER_LIB_OBJS:.o=.d) $
CPPFLAGS += -mmcu=$(MCU) -DF_CPU=$(F_CPU) -DARDUINO=$(ARDUINO_VERSION) \
-I. -I$(ARDUINO_CORE_PATH) -I$(ARDUINO_VAR_PATH)/$(VARIANT) \
$(SYS_INCLUDES) $(USER_INCLUDES) -g -Os -Wall \
-DUSB_VID=$(USB_VID) -DUSB_PID=$(USB_PID) \
-ffunction-sections -fdata-sections
# USB IDs for the Leonardo
ifeq ($(VARIANT),leonardo)
CPPFLAGS += -DUSB_VID=$(USB_VID) -DUSB_PID=$(USB_PID)
endif
CFLAGS += -std=gnu99 $(EXTRA_FLAGS) $(EXTRA_CFLAGS)
CXXFLAGS += -fno-exceptions $(EXTRA_FLAGS) $(EXTRA_CXXFLAGS)
ASFLAGS += -mmcu=$(MCU) -I. -x assembler-with-cpp