Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Makefile - generate invalid path(Makefile Project with Existing Code generate invalid path)
Makefile - generate invalid path [message #1739092] Wed, 27 July 2016 13:36 Go to next message
Tom Jan is currently offline Tom JanFriend
Messages: 2
Registered: July 2016
Junior Member
I created project by "Makefile Project with Existing Code", but I can't compile it.

process_begin: CreateProcess(NULL, echo "Building file: ../src/main.c", ...) failed.


I have configuration Default, Eclipse generate makefile in file project\Default\makefile. This makefile include many subdir.mk files.

eg. project\Default\src\subdir.mk has entry
C_SRCS += ../src/main.c

but should have:

C_SRCS += ../../src/main.c

How to fix if ?
How to add ../ to all subdir.mk files ?
Re: Makefile - generate invalid path [message #1739242 is a reply to message #1739092] Thu, 28 July 2016 18:22 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
I think you are perhaps confused on what is expected.

You should have the following files in the project Default directory.

index.php/fa/26607/0/

The makefiles are constructed assuming the project Default directory is the current working directory when make is run.

The make file includes Default\src\subdir.mk among other files.

# All of the sources participating in the build are defined here
-include sources.mk
-include src/subdir.mk
-include subdir.mk
-include objects.mk

It's as if the including make had those statements. Since make is running in the Default directory, the ../src/main.c is the correct relative path. Eclipse should enter that directory when you build the configuration.

To do it manually, from a terminal:

> cd Debug
> make all

The build log in the console window should look something like
13:53:54 **** Incremental Build of configuration Default for project Hello ****
make all 
Building file: ../src/Hello.cpp
Invoking: GCC C++ Compiler
g++ -std=c++0x -O2 -g -Wall -c -fmessage-length=0 -MMD -MP -MF"src/Hello.d" -MT"src/Hello.o" -o "src/Hello.o" "../src/Hello.cpp"
Finished building: ../src/Hello.cpp
 
Building target: Hello
Invoking: GCC C++ Linker
g++  -o "Hello"  ./src/Hello.o   
Finished building target: Hello
 
13:53:55 Build Finished (took 637ms)


So, exactly what did you do when you attempted to build? What was in the resulting build log?


Re: Makefile - generate invalid path [message #1739270 is a reply to message #1739242] Fri, 29 July 2016 08:37 Go to previous messageGo to next message
Tom Jan is currently offline Tom JanFriend
Messages: 2
Registered: July 2016
Junior Member
Hello David

I have project like this:
http://i64.tinypic.com/fdg5jt.png

My Default/makefile:
-include ../makefile.init

RM := del

# All of the sources participating in the build are defined here
-include sources.mk
-include src/subdir.mk
-include subdir.mk
-include objects.mk
(...)


file Default/sources.mk:
S79_SRCS := 
S_SRCS := 
ASM_UPPER_SRCS := 
MSA_UPPER_SRCS := 
ASM_SRCS := 
C_SRCS := 
S79_UPPER_SRCS := 
S_UPPER_SRCS := 
MSA_SRCS := 
ASM_UPPER_DEPS := 
MSA_UPPER_DEPS := 
OBJS := 
ASM_DEPS := 
S79_DEPS := 
S_DEPS := 
S_UPPER_DEPS := 
MSA_DEPS := 
C_DEPS := 
S79_UPPER_DEPS := 

# Every subdirectory with source files must be described here
SUBDIRS := \
src \


file Default/src/subdir.mk:
# Add inputs and outputs from these tool invocations to the build variables 
C_SRCS += \
../src/main.c 

C_DEPS += \
./src/main.d 


# Each subdirectory must supply rules for building sources it contributes
src/main.o: ../src/main.c
	@echo 'Building file: $<'
	@echo 'Invoking: IAR C/C++ Compiler for ARM'
iccarm "$<" -o "$@" --no_wrap_diagnostics -e --cpu ARM7TDMI --fpu None --dlib_config "C:/Program Files (x86)/IAR Systems/Embedded Workbench 7.5/arm/inc/c/DLib_Config_Normal.h" --endian little --interwork --cpu_mode arm -On --no_cse--no_unroll --no_inline --no_code_motion --no_tbaa --no_clustering --no_scheduling --dependencies=m $(basename $(notdir $<)).d
	@echo 'Finished building: $<'
	@echo ' '


Here is my log:
d:\projects\project3\Default>make all
make: *** No rule to make target 'project3', needed by 'all'.  Stop.

d:\projects\project3\Default>make
process_begin: CreateProcess(NULL, echo "Building file: ../src/main.c", ...) failed.
make (e=2): the system cannot find the file specified
src/subdir.mk:15: recipe for target 'src/main.o' failed
make: *** [src/main.o] Error 2


d:\projects\project3\Default>iccarm -v

   IAR ANSI C/C++ Compiler V7.70.1.11437/W32 for ARM
   Copyright 1999-2016 IAR Systems AB.


d:\projects\project3\Default>more src\subdir.mk
################################################################################
# Automatically-generated file. Do not edit!
################################################################################

# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../src/main.c

C_DEPS += \
./src/main.d


# Each subdirectory must supply rules for building sources it contributes
src/main.o: ../src/main.c
        @echo 'Building file: $<'
        @echo 'Invoking: IAR C/C++ Compiler for ARM'
        iccarm "$<" -o "$@" --no_wrap_diagnostics -e --cpu ARM7TDMI --fpu None --dlib_config "C:/Program Files (x86)/IAR Systems/Embedded Workbench 7.5/arm/inc/c/DLib_Config_Normal.h" --endian little --interwork --cpu_mode arm -On --no_cse--no_unroll --no_inline --no_code_motion --no_tbaa --no_clustering --no_scheduling --dependencies=m $(basename $(notdir $<)).d
        @echo 'Finished building: $<'
        @echo ' '



d:\projects\project3\Default>more ..\src\main.c
int main(void)
{
  while (1) {
  }
}


Do you see mistake ?
  • Attachment: project3.png
    (Size: 4.66KB, Downloaded 413 times)
Re: Makefile - generate invalid path [message #1739278 is a reply to message #1739270] Fri, 29 July 2016 09:11 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
My apologies. I missed the implication in your first post.
What that message means is that make couldn't find the program it's trying to run when executing the recipe. In this case, it appears to be the shell. You are going to have to find out why on your own.

Eclipse seems to be working fine.

This may help you fix your problem
http://stackoverflow.com/questions/33674973/makefile-error-make-e-2-the-system-cannot-find-the-file-specified

There are others. Google: CreateProcess(NULL, echo Building file: ../src/main.c, ...) failed. make (e=2): the system cannot find the file specified

[Updated on: Fri, 29 July 2016 09:36]

Report message to a moderator

Previous Topic:Problem with symbols defined in Makefile
Next Topic:Indexer Problems openjdk8 / Ubuntu 16
Goto Forum:
  


Current Time: Thu Apr 25 01:14:47 GMT 2024

Powered by FUDForum. Page generated in 0.04595 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top