summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2015-08-07 12:52:09 +0000
committerNanang Izzuddin <nanang@teluu.com>2015-08-07 12:52:09 +0000
commitf46f7dd2798655c443180dde500b9438b31dea33 (patch)
treecdafb5e297f77490b9e0d0e0ec9eb931278046d5 /build
parent6a14bb11b68d2daca0ae1f3c522869f650be5a5c (diff)
Misc (re #1843): Fixed compile warnings of "command line option '-frtti' is valid for C++/ObjC++ but not for C" on "make depend" for Android targets.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5154 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'build')
-rw-r--r--build/rules.mak13
1 files changed, 10 insertions, 3 deletions
diff --git a/build/rules.mak b/build/rules.mak
index 0472b0a1..9891bf46 100644
--- a/build/rules.mak
+++ b/build/rules.mak
@@ -57,7 +57,9 @@ FULL_SRCS = $(foreach file, $($(APP)_OBJS), $(SRCDIR)/$(basename $(file)).m $(SR
# When generating dependency (gcc -MM), ideally we use only either
# CFLAGS or CXXFLAGS (not both). But I just couldn't make if/ifeq to work.
#
-DEPFLAGS = $($(APP)_CXXFLAGS) $($(APP)_CFLAGS)
+#DEPFLAGS = $($(APP)_CXXFLAGS) $($(APP)_CFLAGS)
+DEPCFLAGS = $($(APP)_CFLAGS)
+DEPCXXFLAGS = $($(APP)_CXXFLAGS)
# Dependency file
DEP_FILE := .$(app)-$(TARGET_NAME).depend
@@ -76,7 +78,7 @@ print_common:
@echo $(APP)_CFLAGS=$($(APP)_CFLAGS)
@echo $(APP)_CXXFLAGS=$($(APP)_CXXFLAGS)
@echo $(APP)_LDFLAGS=$($(APP)_LDFLAGS)
- @echo DEPFLAGS=$(DEPFLAGS)
+# @echo DEPFLAGS=$(DEPFLAGS)
@echo CC=$(CC)
@echo AR=$(AR)
@echo AR_FLAGS=$(AR_FLAGS)
@@ -216,7 +218,12 @@ depend:
for F in $(FULL_SRCS); do \
if test -f $$F; then \
echo "$(OBJDIR)/" | tr -d '\n' >> $(DEP_FILE); \
- if $(CC) -M $(DEPFLAGS) $$F | sed '/^#/d' >> $(DEP_FILE); then \
+ if echo $$F | grep -q .cpp$$; then \
+ dep="$(CC) -M $(DEPCXXFLAGS) $$F"; \
+ else \
+ dep="$(CC) -M $(DEPCFLAGS) $$F"; \
+ fi; \
+ if eval $$dep | sed '/^#/d' >> $(DEP_FILE); then \
true; \
else \
echo 'err:' >> $(DEP_FILE); \