1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-30 00:00:11 +01:00

added new make target to build .clang_complete files for Clang-based Atom / Vim autocompletion support

This commit is contained in:
Steffen Vogel 2017-07-25 18:42:57 +02:00
parent cc02829def
commit 6f99e08a35
3 changed files with 53 additions and 2 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
/build/
*~
.clang_complete

View file

@ -148,7 +148,8 @@ CFLAGS += $(addprefix -DWITH_, $(call escape,$(PKGS)))
install: $(addprefix install-,$(filter-out thirdparty doc clients,$(MODULES)))
clean: $(addprefix clean-, $(filter-out thirdparty doc clients,$(MODULES)))
.PHONY: all everything clean install FORCE
.PHONY: all everything clean install
-include $(wildcard $(SRCDIR)/Makefile.*)
-include $(wildcard $(BUILDDIR)/**/*.d)
-include $(addsuffix /Makefile.inc,$(MODULES))
-include $(patsubst %,$(SRCDIR)/%/Makefile.inc,$(MODULES))

49
Makefile.complete Normal file
View file

@ -0,0 +1,49 @@
# Makefile for clang autocompletion
#
# This Makefile produces .clang_complete files containing compiler flags
# which are used by clang autocompletion tools such as:
#
# - https://atom.io/packages/autocomplete-clang
# - https://github.com/Rip-Rip/clang_complete
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
# @license GNU General Public License (version 3)
#
# VILLASnode
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
###################################################################################
SRCMODULES = src lib plugins tools tests/unit
CLANG_COMPLETES = $(patsubst %,$(SRCDIR)/%/.clang_complete,$(SRCMODULES))
$(SRCDIR)/tests/unit/.clang_complete: FLAGS = $(TEST_CFLAGS)
$(SRCDIR)/src/.clang_complete: FLAGS = $(SRC_CFLAGS)
$(SRCDIR)/tools/.clang_complete: FLAGS = $(TOOLS_CFLAGS)
$(SRCDIR)/plugins/.clang_complete: FLAGS = $(PLUGIN_CFLAGS)
$(SRCDIR)/lib/.clang_complete: FLAGS = $(LIB_CFLAGS)
%/.clang_complete:
echo "$(FLAGS)" > $@
clang-complete: $(CLANG_COMPLETES)
clean: clean-clang-complete
clean-clang-complete:
rm $(CLANG_COMPLETES)
.PHONY: clang-complete