Add a test in apps makefiles to get proper function of :make in vim when the user...
authorNathael Pajani <nathael.pajani@ed3l.fr>
Wed, 19 Apr 2017 00:55:03 +0000 (02:55 +0200)
committerNathael Pajani <nathael.pajani@ed3l.fr>
Mon, 6 Feb 2023 04:03:03 +0000 (05:03 +0100)
remote_bitbang/Makefile

index 954c63f..41ae555 100644 (file)
@@ -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} $@