Community
Participate
Working Groups
Hello, I've just checked the GNU makefile that Eclipse generates (via this option: http://eclipsebook.in/_images/c-wiz-proj-prop-builder.png) The makefile is slightly faulty and can be improved! (I'm running the normal current CDT, downloaded a few days ago) Here's what needs changing: 1) makefile (top-level) top-level makefile should have the all-target RIGHT AT THE TOP (before all other include lines). This is to guarantee that the all-target is the default target. So right at the top just add: all: 2) subdir.mk subdir.mk should use: # Each subdirectory must supply rules for building sources it contributes src/%.o: ../src/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' #gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" #this line is in error gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' Reason: we want test.d to have this content: src/test.o: ../src/testc. and NOT: src/test.d: ../src/test.c #this is faulty Regards,
the folding of the code fragment of subdir.mk (shown above) make it slightly hard to read. the long commented line is the current line that eclipse generates, and is in error #gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" #this line is in error This line needs to be changed to gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -o "$@" "$<"