8000 mk: add compile_commands.json (clang only) by sreimers · Pull Request #157 · baresip/re · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
< 8000 div id="start-of-content" class="show-on-focus">

mk: add compile_commands.json (clang only) #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ $(BUILD): Makefile $(MK) $(MODMKS)
.PHONY: clean
clean:
@rm -rf $(SHARED) $(STATIC) libre.pc test.d test.o test $(BUILD)
@rm -f compile_commands.json


install: $(SHARED) $(STATIC) libre.pc
Expand Down
10 changes: 7 additions & 3 deletions mk/re.mk
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ CFLAGS += -I$(SYSROOT_ALT)/include
LFLAGS += -L$(SYSROOT_ALT)/lib
endif

# Compiler dependency flags
DFLAGS = -MD -MF $(@:.o=.d) -MT $@

##############################################################################
#
Expand Down Expand Up @@ -117,6 +119,7 @@ ifneq (,$(findstring clang, $(CC_LONGVER)))
CC_VER := $(CC) $(CC_SHORTVER) ($(CC_MAJORVER).x)
MKDEP := $(CC) -MM
ifneq ($(CC_MAJORVER), 4)
DFLAGS += -MJ $@.json
CC_C11 := 1
endif
endif
Expand Down Expand Up @@ -168,9 +171,6 @@ CFLAGS += -Wuninitialized
CFLAGS += -Wno-strict-aliasing
endif

# Compiler dependency flags
DFLAGS = -MD -MF $(@:.o=.d) -MT $@


##############################################################################
#
Expand Down Expand Up @@ -646,6 +646,7 @@ distclean:
@rm -f `find . -name "*.exe"` `find . -name "*.dll"`
@rm -f `find . -name "*.dylib"`
@rm -f *.pc
@rm -f compile_commands.json

.PHONY: info
info::
Expand Down Expand Up @@ -818,6 +819,9 @@ clang:
@clang --analyze $(CLANG_OPTIONS) $(CFLAGS) $(CLANG_SRCS)
@rm -f *.plist

compile_commands.json:
@rm -f $@
@sed -e '1s/^/[/' -e '$$s/,$$/]/' $(BUILD)/**/*.o.json > $@

###############################################################################
#
Expand Down
0