comparison Makefile @ 186:524c87ec23a3

Makefile now compiles core/*.cpp except core/default_main.cpp (unless needed). Closes #1530
author Giulio Moro <giuliomoro@yahoo.it>
date Tue, 19 Jan 2016 01:54:34 +0000
parents 31e898185ae8
children 3b8a28edae41
comparison
equal deleted inserted replaced
185:31e898185ae8 186:524c87ec23a3
8 8
9 RM := rm -rf 9 RM := rm -rf
10 STATIC_LIBS := ./libprussdrv.a ./libNE10.a 10 STATIC_LIBS := ./libprussdrv.a ./libNE10.a
11 LIBS := -lrt -lnative -lxenomai 11 LIBS := -lrt -lnative -lxenomai
12 12
13 INCLUDES := -I/usr/include/ne10 -I/usr/xenomai/include -I/usr/arm-linux-gnueabihf/include/xenomai/include -I/usr/arm-linux-gnueabihf/include/ne10 13 INCLUDES := -I./include -I/usr/include/ne10 -I/usr/xenomai/include -I/usr/arm-linux-gnueabihf/include/xenomai/include -I/usr/arm-linux-gnueabihf/include/ne10
14 14
15 15
16 ASM_SRCS := $(wildcard source/*.S) 16 ASM_SRCS := $(wildcard source/*.S)
17 ASM_OBJS := $(addprefix build/source/,$(notdir $(ASM_SRCS:.S=.o))) 17 ASM_OBJS := $(addprefix build/source/,$(notdir $(ASM_SRCS:.S=.o)))
18 ASM_DEPS := $(addprefix build/source/,$(notdir $(ASM_SRCS:.S=.d))) 18 ASM_DEPS := $(addprefix build/source/,$(notdir $(ASM_SRCS:.S=.d)))
24 CPP_SRCS := $(wildcard source/*.cpp) 24 CPP_SRCS := $(wildcard source/*.cpp)
25 CPP_OBJS := $(addprefix build/source/,$(notdir $(CPP_SRCS:.cpp=.o))) 25 CPP_OBJS := $(addprefix build/source/,$(notdir $(CPP_SRCS:.cpp=.o)))
26 CPP_DEPS := $(addprefix build/source/,$(notdir $(CPP_SRCS:.cpp=.d))) 26 CPP_DEPS := $(addprefix build/source/,$(notdir $(CPP_SRCS:.cpp=.d)))
27 27
28 # Core BeagleRT sources 28 # Core BeagleRT sources
29 CORE_CPP_SRCS := \ 29 CORE_CPP_SRCS = $(filter-out core/default_main.cpp, $(wildcard core/*.cpp))
30 ./core/GPIOcontrol.cpp \ 30 CORE_OBJS := $(addprefix build/core/,$(notdir $(CORE_CPP_SRCS:.cpp=.o)))
31 ./core/I2c_Codec.cpp \ 31 CORE_CPP_DEPS := $(addprefix build/core/,$(notdir $(CORE_CPP_SRCS:.cpp=.d)))
32 ./core/PRU.cpp \
33 ./core/RTAudio.cpp \
34 ./core/RTAudioCommandLine.cpp \
35 ./core/Utilities.cpp \
36 ./core/UdpClient.cpp \
37 ./core/WriteFile.cpp
38
39 CORE_OBJS := \
40 ./build/core/GPIOcontrol.o \
41 ./build/core/I2c_Codec.o \
42 ./build/core/PRU.o \
43 ./build/core/RTAudio.o \
44 ./build/core/RTAudioCommandLine.o \
45 ./build/core/Utilities.o \
46 ./build/core/UdpClient.o \
47 ./build/core/WriteFile.o
48
49 CORE_CPP_DEPS := \
50 ./build/core/GPIOcontrol.d \
51 ./build/core/I2c_Codec.d \
52 ./build/core/PRU.d \
53 ./build/core/RTAudio.d \
54 ./build/core/RTAudioCommandLine.d \
55 ./build/core/Utilities.d \
56 ./build/core/UdpClient.d \
57 ./build/core/WriteFile.d
58 32
59 # Objects for a system-supplied default main() file, if the user 33 # Objects for a system-supplied default main() file, if the user
60 # only wants to provide the render functions. 34 # only wants to provide the render functions.
61 DEFAULT_MAIN_CPP_SRCS := ./core/default_main.cpp 35 DEFAULT_MAIN_CPP_SRCS := ./core/default_main.cpp
62 DEFAULT_MAIN_OBJS := ./build/core/default_main.o 36 DEFAULT_MAIN_OBJS := ./build/core/default_main.o
80 54
81 # Rule for user-supplied C++ files 55 # Rule for user-supplied C++ files
82 build/source/%.o: ./source/%.cpp 56 build/source/%.o: ./source/%.cpp
83 @echo 'Building file: $<' 57 @echo 'Building file: $<'
84 @echo 'Invoking: GCC C++ Compiler' 58 @echo 'Invoking: GCC C++ Compiler'
85 g++ $(SYNTAX_FLAG) -I./include $(INCLUDES) -O2 -Wall -c -fmessage-length=0 -U_FORTIFY_SOURCE -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" 59 g++ $(SYNTAX_FLAG) $(INCLUDES) -O2 -Wall -c -fmessage-length=0 -U_FORTIFY_SOURCE -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
86 @echo 'Finished building: $<' 60 @echo 'Finished building: $<'
87 @echo ' ' 61 @echo ' '
88 62
89 # Rule for user-supplied C files 63 # Rule for user-supplied C files
90 build/source/%.o: ./source/%.c 64 build/source/%.o: ./source/%.c
91 @echo 'Building file: $<' 65 @echo 'Building file: $<'
92 @echo 'Invoking: GCC C Compiler' 66 @echo 'Invoking: GCC C Compiler'
93 gcc $(SYNTAX_FLAG) -I./include $(INCLUDES) -O2 -Wall -c -fmessage-length=0 -U_FORTIFY_SOURCE -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" -std=c99 67 gcc $(SYNTAX_FLAG) $(INCLUDES) -O2 -Wall -c -fmessage-length=0 -U_FORTIFY_SOURCE -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" -std=c99
94 @echo 'Finished building: $<' 68 @echo 'Finished building: $<'
95 @echo ' ' 69 @echo ' '
96 70
97 # Rule for user-supplied assembly files 71 # Rule for user-supplied assembly files
98 build/source/%.o: ./source/%.S 72 build/source/%.o: ./source/%.S