[NPS] Fixed NPS warnings on OS X

OS X uses clang to compile the code, thus we have a bit different
warning system. Now the C++ code is being compiled with the G++ clang
compiler instead of GCC.
Actually compile C++ files with CXX and C files with CC.

Also fixed some other warnings including UTF-16 character usage.
Converted config report warningt to PRINT_CONFIG_MSG.
We need to push the diagnostics first for clang.
Added GNU99 standard flag to the C targets.
This commit is contained in:
Felix Ruess
2014-08-16 22:22:43 +02:00
parent be58988fbf
commit 51a9f6a49f
14 changed files with 60 additions and 31 deletions
+26 -12
View File
@@ -26,7 +26,6 @@
SRC_ARCH = arch/sim
CC = g++
OPT ?= 2
SIMDIR = $(PAPARAZZI_SRC)/sw/simulator
@@ -39,6 +38,14 @@ CFLAGS += $($(TARGET).CFLAGS)
CFLAGS += $(LOCAL_CFLAGS)
CFLAGS += -O$(OPT)
CFLAGS += -g
CFLAGS += -std=gnu99
CXXFLAGS = -W -Wall
CXXFLAGS += $(INCLUDES)
CXXFLAGS += $($(TARGET).CFLAGS)
CXXFLAGS += $(LOCAL_CFLAGS)
CXXFLAGS += -O$(OPT)
CXXFLAGS += -g
LDFLAGS += $($(TARGET).LDFLAGS)
@@ -48,7 +55,8 @@ LDFLAGS += $($(TARGET).LDFLAGS)
$(TARGET).srcsnd = $(notdir $($(TARGET).srcs))
$(TARGET).objso = $($(TARGET).srcs:%.c=$(OBJDIR)/%.o)
$(TARGET).objs = $($(TARGET).objso:%.S=$(OBJDIR)/%.o)
$(TARGET).objsoxx = $($(TARGET).objso:%.cpp=$(OBJDIR)/%.o)
$(TARGET).objs = $($(TARGET).objsoxx:%.S=$(OBJDIR)/%.o)
all compile: check_jsbsim $(OBJDIR)/simsitl
@@ -59,7 +67,7 @@ check_jsbsim:
$(OBJDIR)/simsitl : $($(TARGET).objs)
@echo LD $@
$(Q)$(CC) $(CFLAGS) -o $@ $($(TARGET).objs) $(LDFLAGS)
$(Q)$(CXX) $(CXXFLAGS) -o $@ $($(TARGET).objs) $(LDFLAGS)
%.s: %.c
@@ -74,9 +82,9 @@ $(OBJDIR)/%.s: %.c
$(CC) $(CFLAGS) -S -o $@ $<
$(OBJDIR)/%.s: %.cpp
@echo CC $@
@echo CXX $@
$(Q)test -d $(dir $@) || mkdir -p $(dir $@)
$(CC) $(CFLAGS) -S -o $@ $<
$(CXX) $(CXXFLAGS) -S -o $@ $<
$(OBJDIR)/%.o: %.c $(OBJDIR)/../Makefile.ac
@echo CC $@
@@ -84,20 +92,26 @@ $(OBJDIR)/%.o: %.c $(OBJDIR)/../Makefile.ac
$(Q)$(CC) $(CFLAGS) -c -o $@ $<
$(OBJDIR)/%.o: %.cpp $(OBJDIR)/../Makefile.ac
@echo CC $@
@echo CXX $@
$(Q)test -d $(dir $@) || mkdir -p $(dir $@)
$(Q)$(CC) $(CFLAGS) -c -o $@ $<
$(Q)$(CXX) $(CXXFLAGS) -c -o $@ $<
.PHONY: all compile check_jsbsim
#
# Dependencies
#
$(OBJDIR)/.depend:
@test -d $(OBJDIR) || mkdir -p $(OBJDIR)
@echo DEPEND $@
$(Q)$(CC) -MM -MG $(CFLAGS) $($(TARGET).srcs) | sed 's|\([^\.]*\.o\)|$(OBJDIR)/\1|' > $@
$(OBJDIR)/%.d: %.c
@echo DEP $@
$(Q)test -d $(dir $@) || mkdir -p $(dir $@)
$(Q)$(CC) -MM -MG $(CFLAGS) $< | sed 's|\([^\.]*\.o\)|$(OBJDIR)/\1|' > $(OBJDIR)/$*.d
$(OBJDIR)/%.d: %.cpp $(OBJDIR)/../Makefile.ac
@echo DEP $@
$(Q)test -d $(dir $@) || mkdir -p $(dir $@)
$(Q)$(CXX) -MM -MG $(CXXFLAGS) $< | sed 's|\([^\.]*\.o\)|$(OBJDIR)/\1|' > $(OBJDIR)/$*.d
ifneq ($(MAKECMDGOALS),clean)
-include $(OBJDIR)/.depend
-include $($(TARGET).objs:.o=.d)
endif