From 61e307b53fa1e1086a75a892a5e9778dcf557cbf Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Wed, 19 Apr 2017 02:55:03 +0200 Subject: [PATCH] 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 --- alpha/Makefile | 13 +++++++++++-- beta/Makefile | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/alpha/Makefile b/alpha/Makefile index ed84b76..41ae555 100644 --- a/alpha/Makefile +++ b/alpha/Makefile @@ -3,10 +3,19 @@ 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/beta/Makefile b/beta/Makefile index ed84b76..41ae555 100644 --- a/beta/Makefile +++ b/beta/Makefile @@ -3,10 +3,19 @@ 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} $@ -- 2.43.0