From: Nathael Pajani Date: Wed, 19 Apr 2017 00:55:03 +0000 (+0200) Subject: Add a test in apps makefiles to get proper function of :make in vim when the user... X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=6f3320c3f2033dbce3634fa40e4b35ea2933ce84;p=soft%2Flpc122x%2Fexamples Add a test in apps makefiles to get proper function of :make in vim when the user has added "let $COMPILE_FROM_IDE = 1" to his ~/.vimrc --- diff --git a/adc/Makefile b/adc/Makefile index 954c63f..41ae555 100644 --- a/adc/Makefile +++ b/adc/Makefile @@ -1,13 +1,21 @@ -# Makefile for "base" apps -# This includes apps for the GPIO Demo Module and for the LPC1224-BO board. +# Makefile for apps MODULE = $(shell basename $(shell cd .. && pwd && cd -)) NAME = $(shell basename $(CURDIR)) +# Add this to your ~/.vimrc in order to get proper function of :make in vim : +# let $COMPILE_FROM_IDE = 1 +ifeq ($(strip $(COMPILE_FROM_IDE)),) + PRINT_DIRECTORY = --no-print-directory +else + PRINT_DIRECTORY = + LANG = C +endif + .PHONY: $(NAME).bin $(NAME).bin: - @make -C ../../.. --no-print-directory NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ + @make -C ../../.. ${PRINT_DIRECTORY} NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ clean mrproper: - @make -C ../../.. --no-print-directory $@ + @make -C ../../.. ${PRINT_DIRECTORY} $@ diff --git a/eeprom/Makefile b/eeprom/Makefile index 954c63f..41ae555 100644 --- a/eeprom/Makefile +++ b/eeprom/Makefile @@ -1,13 +1,21 @@ -# Makefile for "base" apps -# This includes apps for the GPIO Demo Module and for the LPC1224-BO board. +# Makefile for apps MODULE = $(shell basename $(shell cd .. && pwd && cd -)) NAME = $(shell basename $(CURDIR)) +# Add this to your ~/.vimrc in order to get proper function of :make in vim : +# let $COMPILE_FROM_IDE = 1 +ifeq ($(strip $(COMPILE_FROM_IDE)),) + PRINT_DIRECTORY = --no-print-directory +else + PRINT_DIRECTORY = + LANG = C +endif + .PHONY: $(NAME).bin $(NAME).bin: - @make -C ../../.. --no-print-directory NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ + @make -C ../../.. ${PRINT_DIRECTORY} NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ clean mrproper: - @make -C ../../.. --no-print-directory $@ + @make -C ../../.. ${PRINT_DIRECTORY} $@ diff --git a/epaper/Makefile b/epaper/Makefile index d43a689..9dd3adb 100644 --- a/epaper/Makefile +++ b/epaper/Makefile @@ -1,14 +1,22 @@ -# Makefile for "base" apps -# This includes apps for the GPIO Demo Module and for the LPC1224-BO board. +# Makefile for apps MODULE = $(shell basename $(shell cd .. && pwd && cd -)) NAME = $(shell basename $(CURDIR)) +# Add this to your ~/.vimrc in order to get proper function of :make in vim : +# let $COMPILE_FROM_IDE = 1 +ifeq ($(strip $(COMPILE_FROM_IDE)),) + PRINT_DIRECTORY = --no-print-directory +else + PRINT_DIRECTORY = + LANG = C +endif + .PHONY: $(NAME).bin $(NAME).bin: - @make -C ../../.. --no-print-directory NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ + @make -C ../../.. ${PRINT_DIRECTORY} NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ cat $@ *.epaper > $(NAME).img clean mrproper: - @make -C ../../.. --no-print-directory $@ + @make -C ../../.. ${PRINT_DIRECTORY} $@ diff --git a/gpio_intr/Makefile b/gpio_intr/Makefile index 954c63f..41ae555 100644 --- a/gpio_intr/Makefile +++ b/gpio_intr/Makefile @@ -1,13 +1,21 @@ -# Makefile for "base" apps -# This includes apps for the GPIO Demo Module and for the LPC1224-BO board. +# Makefile for apps MODULE = $(shell basename $(shell cd .. && pwd && cd -)) NAME = $(shell basename $(CURDIR)) +# Add this to your ~/.vimrc in order to get proper function of :make in vim : +# let $COMPILE_FROM_IDE = 1 +ifeq ($(strip $(COMPILE_FROM_IDE)),) + PRINT_DIRECTORY = --no-print-directory +else + PRINT_DIRECTORY = + LANG = C +endif + .PHONY: $(NAME).bin $(NAME).bin: - @make -C ../../.. --no-print-directory NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ + @make -C ../../.. ${PRINT_DIRECTORY} NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ clean mrproper: - @make -C ../../.. --no-print-directory $@ + @make -C ../../.. ${PRINT_DIRECTORY} $@ diff --git a/i2c_temp/Makefile b/i2c_temp/Makefile index 954c63f..41ae555 100644 --- a/i2c_temp/Makefile +++ b/i2c_temp/Makefile @@ -1,13 +1,21 @@ -# Makefile for "base" apps -# This includes apps for the GPIO Demo Module and for the LPC1224-BO board. +# Makefile for apps MODULE = $(shell basename $(shell cd .. && pwd && cd -)) NAME = $(shell basename $(CURDIR)) +# Add this to your ~/.vimrc in order to get proper function of :make in vim : +# let $COMPILE_FROM_IDE = 1 +ifeq ($(strip $(COMPILE_FROM_IDE)),) + PRINT_DIRECTORY = --no-print-directory +else + PRINT_DIRECTORY = + LANG = C +endif + .PHONY: $(NAME).bin $(NAME).bin: - @make -C ../../.. --no-print-directory NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ + @make -C ../../.. ${PRINT_DIRECTORY} NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ clean mrproper: - @make -C ../../.. --no-print-directory $@ + @make -C ../../.. ${PRINT_DIRECTORY} $@ diff --git a/i2c_uv/Makefile b/i2c_uv/Makefile index 954c63f..41ae555 100644 --- a/i2c_uv/Makefile +++ b/i2c_uv/Makefile @@ -1,13 +1,21 @@ -# Makefile for "base" apps -# This includes apps for the GPIO Demo Module and for the LPC1224-BO board. +# Makefile for apps MODULE = $(shell basename $(shell cd .. && pwd && cd -)) NAME = $(shell basename $(CURDIR)) +# Add this to your ~/.vimrc in order to get proper function of :make in vim : +# let $COMPILE_FROM_IDE = 1 +ifeq ($(strip $(COMPILE_FROM_IDE)),) + PRINT_DIRECTORY = --no-print-directory +else + PRINT_DIRECTORY = + LANG = C +endif + .PHONY: $(NAME).bin $(NAME).bin: - @make -C ../../.. --no-print-directory NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ + @make -C ../../.. ${PRINT_DIRECTORY} NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ clean mrproper: - @make -C ../../.. --no-print-directory $@ + @make -C ../../.. ${PRINT_DIRECTORY} $@ diff --git a/lcd_char/Makefile b/lcd_char/Makefile index 954c63f..41ae555 100644 --- a/lcd_char/Makefile +++ b/lcd_char/Makefile @@ -1,13 +1,21 @@ -# Makefile for "base" apps -# This includes apps for the GPIO Demo Module and for the LPC1224-BO board. +# Makefile for apps MODULE = $(shell basename $(shell cd .. && pwd && cd -)) NAME = $(shell basename $(CURDIR)) +# Add this to your ~/.vimrc in order to get proper function of :make in vim : +# let $COMPILE_FROM_IDE = 1 +ifeq ($(strip $(COMPILE_FROM_IDE)),) + PRINT_DIRECTORY = --no-print-directory +else + PRINT_DIRECTORY = + LANG = C +endif + .PHONY: $(NAME).bin $(NAME).bin: - @make -C ../../.. --no-print-directory NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ + @make -C ../../.. ${PRINT_DIRECTORY} NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ clean mrproper: - @make -C ../../.. --no-print-directory $@ + @make -C ../../.. ${PRINT_DIRECTORY} $@ diff --git a/ledstrip/Makefile b/ledstrip/Makefile index 954c63f..41ae555 100644 --- a/ledstrip/Makefile +++ b/ledstrip/Makefile @@ -1,13 +1,21 @@ -# Makefile for "base" apps -# This includes apps for the GPIO Demo Module and for the LPC1224-BO board. +# Makefile for apps MODULE = $(shell basename $(shell cd .. && pwd && cd -)) NAME = $(shell basename $(CURDIR)) +# Add this to your ~/.vimrc in order to get proper function of :make in vim : +# let $COMPILE_FROM_IDE = 1 +ifeq ($(strip $(COMPILE_FROM_IDE)),) + PRINT_DIRECTORY = --no-print-directory +else + PRINT_DIRECTORY = + LANG = C +endif + .PHONY: $(NAME).bin $(NAME).bin: - @make -C ../../.. --no-print-directory NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ + @make -C ../../.. ${PRINT_DIRECTORY} NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ clean mrproper: - @make -C ../../.. --no-print-directory $@ + @make -C ../../.. ${PRINT_DIRECTORY} $@ diff --git a/oled/Makefile b/oled/Makefile index 954c63f..41ae555 100644 --- a/oled/Makefile +++ b/oled/Makefile @@ -1,13 +1,21 @@ -# Makefile for "base" apps -# This includes apps for the GPIO Demo Module and for the LPC1224-BO board. +# Makefile for apps MODULE = $(shell basename $(shell cd .. && pwd && cd -)) NAME = $(shell basename $(CURDIR)) +# Add this to your ~/.vimrc in order to get proper function of :make in vim : +# let $COMPILE_FROM_IDE = 1 +ifeq ($(strip $(COMPILE_FROM_IDE)),) + PRINT_DIRECTORY = --no-print-directory +else + PRINT_DIRECTORY = + LANG = C +endif + .PHONY: $(NAME).bin $(NAME).bin: - @make -C ../../.. --no-print-directory NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ + @make -C ../../.. ${PRINT_DIRECTORY} NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ clean mrproper: - @make -C ../../.. --no-print-directory $@ + @make -C ../../.. ${PRINT_DIRECTORY} $@ diff --git a/power_down/Makefile b/power_down/Makefile index da44d1f..41ae555 100644 --- a/power_down/Makefile +++ b/power_down/Makefile @@ -1,12 +1,21 @@ -# Makefile for "base" apps +# Makefile for apps MODULE = $(shell basename $(shell cd .. && pwd && cd -)) NAME = $(shell basename $(CURDIR)) +# Add this to your ~/.vimrc in order to get proper function of :make in vim : +# let $COMPILE_FROM_IDE = 1 +ifeq ($(strip $(COMPILE_FROM_IDE)),) + PRINT_DIRECTORY = --no-print-directory +else + PRINT_DIRECTORY = + LANG = C +endif + .PHONY: $(NAME).bin $(NAME).bin: - @make -C ../../.. --no-print-directory NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ + @make -C ../../.. ${PRINT_DIRECTORY} NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ clean mrproper: - @make -C ../../.. --no-print-directory $@ + @make -C ../../.. ${PRINT_DIRECTORY} $@ diff --git a/servomotor/Makefile b/servomotor/Makefile index 954c63f..41ae555 100644 --- a/servomotor/Makefile +++ b/servomotor/Makefile @@ -1,13 +1,21 @@ -# Makefile for "base" apps -# This includes apps for the GPIO Demo Module and for the LPC1224-BO board. +# Makefile for apps MODULE = $(shell basename $(shell cd .. && pwd && cd -)) NAME = $(shell basename $(CURDIR)) +# Add this to your ~/.vimrc in order to get proper function of :make in vim : +# let $COMPILE_FROM_IDE = 1 +ifeq ($(strip $(COMPILE_FROM_IDE)),) + PRINT_DIRECTORY = --no-print-directory +else + PRINT_DIRECTORY = + LANG = C +endif + .PHONY: $(NAME).bin $(NAME).bin: - @make -C ../../.. --no-print-directory NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ + @make -C ../../.. ${PRINT_DIRECTORY} NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ clean mrproper: - @make -C ../../.. --no-print-directory $@ + @make -C ../../.. ${PRINT_DIRECTORY} $@ diff --git a/ultrasonic_sensor/Makefile b/ultrasonic_sensor/Makefile index 954c63f..41ae555 100644 --- a/ultrasonic_sensor/Makefile +++ b/ultrasonic_sensor/Makefile @@ -1,13 +1,21 @@ -# Makefile for "base" apps -# This includes apps for the GPIO Demo Module and for the LPC1224-BO board. +# Makefile for apps MODULE = $(shell basename $(shell cd .. && pwd && cd -)) NAME = $(shell basename $(CURDIR)) +# Add this to your ~/.vimrc in order to get proper function of :make in vim : +# let $COMPILE_FROM_IDE = 1 +ifeq ($(strip $(COMPILE_FROM_IDE)),) + PRINT_DIRECTORY = --no-print-directory +else + PRINT_DIRECTORY = + LANG = C +endif + .PHONY: $(NAME).bin $(NAME).bin: - @make -C ../../.. --no-print-directory NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ + @make -C ../../.. ${PRINT_DIRECTORY} NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ clean mrproper: - @make -C ../../.. --no-print-directory $@ + @make -C ../../.. ${PRINT_DIRECTORY} $@ diff --git a/watchdog/Makefile b/watchdog/Makefile index 954c63f..41ae555 100644 --- a/watchdog/Makefile +++ b/watchdog/Makefile @@ -1,13 +1,21 @@ -# Makefile for "base" apps -# This includes apps for the GPIO Demo Module and for the LPC1224-BO board. +# Makefile for apps MODULE = $(shell basename $(shell cd .. && pwd && cd -)) NAME = $(shell basename $(CURDIR)) +# Add this to your ~/.vimrc in order to get proper function of :make in vim : +# let $COMPILE_FROM_IDE = 1 +ifeq ($(strip $(COMPILE_FROM_IDE)),) + PRINT_DIRECTORY = --no-print-directory +else + PRINT_DIRECTORY = + LANG = C +endif + .PHONY: $(NAME).bin $(NAME).bin: - @make -C ../../.. --no-print-directory NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ + @make -C ../../.. ${PRINT_DIRECTORY} NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@ clean mrproper: - @make -C ../../.. --no-print-directory $@ + @make -C ../../.. ${PRINT_DIRECTORY} $@