From cf3a4550b05f728c7cbb306ee7cdbb9835589a24 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Thu, 23 Mar 2017 20:47:11 +0000 Subject: [PATCH] Makefile: Add phony target "clang-tools" for use with clang-tools. ex: clang-query `make clang-tools` DONT_BUILD. git-svn-id: https://svn.eduke32.com/eduke32@6108 1a8010ca-5511-0410-912e-c29ae57300e0 --- Common.mak | 4 ++-- GNUmakefile | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Common.mak b/Common.mak index 28e340176..23aa932f0 100644 --- a/Common.mak +++ b/Common.mak @@ -66,7 +66,7 @@ CLANG?=0 CLANG_POTENTIAL_VERSION := $(shell $(CCFULLPATH) --version) -ifeq ($(findstring clang,$(CC)),clang) +ifeq ($(findstring clang,$(CC) $(MAKECMDGOALS)),clang) override CLANG=1 CLANGNAME:=$(CC) else @@ -877,7 +877,7 @@ ifeq ($(RENDERTYPE),SDL) SDLCONFIG_CFLAGS := $(strip $(subst -Dmain=SDL_main,,$(shell $(SDLCONFIG) --cflags))) SDLCONFIG_LIBS := $(strip $(subst -mwindows,,$(shell $(SDLCONFIG) --libs))) - COMMONFLAGS += $(SDLCONFIG_CFLAGS) + COMPILERFLAGS += $(SDLCONFIG_CFLAGS) LIBS += $(SDLCONFIG_LIBS) else ifeq ($(SDL_TARGET),1) diff --git a/GNUmakefile b/GNUmakefile index 0f46790b0..f606010ae 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -786,6 +786,7 @@ endif printtools \ rev \ $(ENGINE_OBJ)/rev.$o \ + clang-tools \ .SUFFIXES: .SECONDEXPANSION: @@ -959,6 +960,9 @@ $(foreach i,$(COMPONENTS),$($i_OBJ)): | $(obj) ## PHONIES +clang-tools: $(filter %.c %.cpp %.m %.mm,$(DUKE3D_GAME_SRCS_TARGET) $(DUKE3D_EDITOR_SRCS_TARGET) $(COMMON_EDITOR_SRCS_TARGET) $(ENGINE_SRCS)) + echo $^ -- $(COMPILERFLAGS) $(foreach i,$(COMPONENTS),$($i_CFLAGS)) $(CWARNS) + $(foreach i,$(GAMES),clean$($i)): -rm -f $(foreach i,$(ROLES),$($($(subst clean,,$@))_$i)$(EXESUFFIX)) ifeq ($(PLATFORM),DARWIN)