Find the answer to your Linux question:
Results 1 to 2 of 2
I have the following makefile that should compile a list of source files into an executable. When trying to make, I get the error shown. I can't understand why I ...
  1. #1
    Just Joined!
    Join Date
    Jul 2009
    Posts
    27

    No such file or directory, confused??

    I have the following makefile that should compile a list of source files into an executable. When trying to make, I get the error shown. I can't understand why I am getting it since all the source files exist and are in the same directory. Any ideas?

    Makefile:
    Code:
    SOURCE_DIR = $(top_srcdir)
    SOURCE_INCLUDE_DIR = $(SOURCE_DIR)/../../include
    SOURCE_COMMON_DIR = $(SOURCE_DIR)/
    SOURCE_LDSCRIPT_DIR = $(SOURCE_DIR)
    
    BUILD_DIR = $(top_builddir)
    BUILD_PROM_DIR = $(BUILD_DIR)
    
    
    CC=gcc
    CFLAGS=-c -Wall
    LDFLAGS=-M -T $(SOURCE_LDSCRIPT_DIR)/Linker.ld  
    SOURCES= Main.c \
             ErrorHandler.c \
             ScriptProcess.c \
             Queues.c \
             Commands.c \
             Processes.c \
    	 Utilities.c \
         	 Executive.s \
    	 time.o \
             $(SOURCE_COMMON_DIR)/Esr.c \
    	 $(SOURCE_COMMON_DIR)/bitset.s
    
    OBJECTS=$(SOURCES:.c=.o)
    EXECUTABLE=Program1
    
    all: $(SOURCES) $(EXECUTABLE)
    	
    $(EXECUTABLE): $(OBJECTS) 
    	$(CC) $(LDFLAGS) $(OBJECTS) -o $@
    
    .c.o:
    	$(CC) $(CFLAGS) $< -o $@
    .s.o:
    	$(CC) $(CFLAGS) $< -o $@
    Error:
    Code:
    $ make
     cd .. && automake-1.10 --gnu  Makefile
     cd . && /bin/sh ./config.status Makefile
    config.status: creating Makefile
    gcc -M -T ../Linker.ld   Main.o ErrorHandler.o ScriptProcess.o Queues.o Commands.o Processes.o Utilities.o Executive.s time.o -o Program1
    gcc: Executive.s: No such file or directory
    gcc: time.o: No such file or directory
    make: *** [Program1] Error 1

  2. #2
    Just Joined!
    Join Date
    Jul 2009
    Posts
    27
    Fixed for now by adding absolute path to files in directory. Seems like it shouldn't matter, but I'm not getting the error anymore

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...