Mercurial > hg > beaglert
comparison Makefile @ 318:f7b19ea31bbb prerelease
Added NEON vectorised float<->int converters. Curiously, its performance is worse than the C version. I guess clang is better at vectorising than we thought! The new code remains disabled for now.
| author | andrewm |
|---|---|
| date | Mon, 30 May 2016 01:06:01 +0100 |
| parents | 868cfb137fe5 |
| children | bd54819ccfa7 |
comparison
equal
deleted
inserted
replaced
| 317:52733b58bdf3 | 318:f7b19ea31bbb |
|---|---|
| 86 # Core Bela sources | 86 # Core Bela sources |
| 87 CORE_CPP_SRCS = $(filter-out core/default_main.cpp, $(wildcard core/*.cpp)) | 87 CORE_CPP_SRCS = $(filter-out core/default_main.cpp, $(wildcard core/*.cpp)) |
| 88 CORE_OBJS := $(addprefix build/core/,$(notdir $(CORE_CPP_SRCS:.cpp=.o))) | 88 CORE_OBJS := $(addprefix build/core/,$(notdir $(CORE_CPP_SRCS:.cpp=.o))) |
| 89 CORE_CPP_DEPS := $(addprefix build/core/,$(notdir $(CORE_CPP_SRCS:.cpp=.d))) | 89 CORE_CPP_DEPS := $(addprefix build/core/,$(notdir $(CORE_CPP_SRCS:.cpp=.d))) |
| 90 | 90 |
| 91 CORE_ASM_SRCS := $(wildcard core/*.S) | |
| 92 CORE_ASM_OBJS := $(addprefix build/core/,$(notdir $(CORE_ASM_SRCS:.S=.o))) | |
| 93 CORE_ASM_DEPS := $(addprefix build/core/,$(notdir $(CORE_ASM_SRCS:.S=.d))) | |
| 94 | |
| 95 | |
| 91 # Objects for a system-supplied default main() file, if the user | 96 # Objects for a system-supplied default main() file, if the user |
| 92 # only wants to provide the render functions. | 97 # only wants to provide the render functions. |
| 93 DEFAULT_MAIN_CPP_SRCS := ./core/default_main.cpp | 98 DEFAULT_MAIN_CPP_SRCS := ./core/default_main.cpp |
| 94 DEFAULT_MAIN_OBJS := ./build/core/default_main.o | 99 DEFAULT_MAIN_OBJS := ./build/core/default_main.o |
| 95 DEFAULT_MAIN_CPP_DEPS := ./build/core/default_main.d | 100 DEFAULT_MAIN_CPP_DEPS := ./build/core/default_main.d |
| 115 # @echo 'Invoking: C++ Compiler' | 120 # @echo 'Invoking: C++ Compiler' |
| 116 @$(CXX) $(SYNTAX_FLAG) $(INCLUDES) $(CPP_FLAGS) -Wall -c -fmessage-length=0 -U_FORTIFY_SOURCE -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" | 121 @$(CXX) $(SYNTAX_FLAG) $(INCLUDES) $(CPP_FLAGS) -Wall -c -fmessage-length=0 -U_FORTIFY_SOURCE -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" |
| 117 @echo ' ...done' | 122 @echo ' ...done' |
| 118 @echo ' ' | 123 @echo ' ' |
| 119 | 124 |
| 125 # Rule for Bela core ASM files | |
| 126 build/core/%.o: ./core/%.S | |
| 127 @echo 'Building $(notdir $<)...' | |
| 128 # @echo 'Invoking: GCC Assembler' | |
| 129 @as -o "$@" "$<" | |
| 130 @echo ' ...done' | |
| 131 @echo ' ' | |
| 132 | |
| 120 # Rule for user-supplied C++ files | 133 # Rule for user-supplied C++ files |
| 121 $(PROJECT_DIR)/build/%.o: $(PROJECT_DIR)/%.cpp | 134 $(PROJECT_DIR)/build/%.o: $(PROJECT_DIR)/%.cpp |
| 122 @echo 'Building $(notdir $<)...' | 135 @echo 'Building $(notdir $<)...' |
| 123 # @echo 'Invoking: C++ Compiler' | 136 # @echo 'Invoking: C++ Compiler' |
| 124 @$(CXX) $(SYNTAX_FLAG) $(INCLUDES) $(CPP_FLAGS) -Wall -c -fmessage-length=0 -U_FORTIFY_SOURCE -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" | 137 @$(CXX) $(SYNTAX_FLAG) $(INCLUDES) $(CPP_FLAGS) -Wall -c -fmessage-length=0 -U_FORTIFY_SOURCE -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" |
| 144 # This is a nasty kludge: we want to be able to optionally link in a default | 157 # This is a nasty kludge: we want to be able to optionally link in a default |
| 145 # main file if the user hasn't supplied one. We check for the presence of the main() | 158 # main file if the user hasn't supplied one. We check for the presence of the main() |
| 146 # function, and conditionally call one of two recursive make targets depending on whether | 159 # function, and conditionally call one of two recursive make targets depending on whether |
| 147 # we want to link in the default main file or not. The kludge is the mess of a shell script | 160 # we want to link in the default main file or not. The kludge is the mess of a shell script |
| 148 # line below. Surely there's a better way to do this? | 161 # line below. Surely there's a better way to do this? |
| 149 Bela: $(CORE_OBJS) $(ASM_OBJS) $(C_OBJS) $(CPP_OBJS) $(STATIC_LIBS) $(DEFAULT_MAIN_OBJS) | 162 Bela: $(CORE_ASM_OBJS) $(CORE_OBJS) $(ASM_OBJS) $(C_OBJS) $(CPP_OBJS) $(STATIC_LIBS) $(DEFAULT_MAIN_OBJS) |
| 150 $(eval DEFAULT_MAIN_CONDITIONAL := $(shell bash -c 'if [ `nm $(PROJECT_DIR)/build/*.o | grep -w T | grep -w main | wc -l` == '0' ]; then echo "$(DEFAULT_MAIN_OBJS)"; else echo ""; fi')) | 163 $(eval DEFAULT_MAIN_CONDITIONAL := $(shell bash -c 'if [ `nm $(PROJECT_DIR)/build/*.o | grep -w T | grep -w main | wc -l` == '0' ]; then echo "$(DEFAULT_MAIN_OBJS)"; else echo ""; fi')) |
| 151 @echo 'Invoking: C++ linker' | 164 @echo 'Invoking: C++ linker' |
| 152 @$(CXX) $(SYNTAX_FLAG) -L/usr/xenomai/lib -L/usr/arm-linux-gnueabihf/lib -L/usr/arm-linux-gnueabihf/lib/xenomai -L/usr/lib/arm-linux-gnueabihf -pthread -Wpointer-arith -o "$(PROJECT_DIR)/$(PROJECT)" $(CORE_OBJS) $(DEFAULT_MAIN_CONDITIONAL) $(ASM_OBJS) $(C_OBJS) $(CPP_OBJS) $(STATIC_LIBS) $(LIBS) | 165 @$(CXX) $(SYNTAX_FLAG) -L/usr/xenomai/lib -L/usr/arm-linux-gnueabihf/lib -L/usr/arm-linux-gnueabihf/lib/xenomai -L/usr/lib/arm-linux-gnueabihf -pthread -Wpointer-arith -o "$(PROJECT_DIR)/$(PROJECT)" $(CORE_ASM_OBJS) $(CORE_OBJS) $(DEFAULT_MAIN_CONDITIONAL) $(ASM_OBJS) $(C_OBJS) $(CPP_OBJS) $(STATIC_LIBS) $(LIBS) |
| 153 @echo 'Finished building target: $@' | 166 @echo 'Finished building target: $@' |
| 154 | 167 |
| 155 # Other Targets: | 168 # Other Targets: |
| 156 # This rule compiles c and c++ source files without output or linking | 169 # This rule compiles c and c++ source files without output or linking |
| 157 SYNTAX: $(C_OBJS) $(CPP_OBJS) | 170 SYNTAX: $(C_OBJS) $(CPP_OBJS) |
