Makefile troubles - Linux

This is a discussion on Makefile troubles - Linux ; Hi, I got seriopus troubles with my Makefile: this is what it returns: [shell] [root@DEVNEMS src]# make generic g++ -s -I. -c nio.c -o ./build/nio.o {couple of warnings} g++ -s -I. -c memwatch.c -o ./build/memwatch.o g++ -s -I. -c emvmonitor.c ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Makefile troubles

  1. Makefile troubles

    Hi,

    I got seriopus troubles with my Makefile:
    this is what it returns:
    [shell]
    [root@DEVNEMS src]# make generic
    g++ -s -I. -c nio.c -o ./build/nio.o
    {couple of warnings}
    g++ -s -I. -c memwatch.c -o ./build/memwatch.o
    g++ -s -I. -c emvmonitor.c -o ./build/emvmonitor.o
    [warning}
    g++ -s -I. -c gpio.c -o ./build/gpio.o
    {warning}
    cd ./build && g++ -s -pthread -o prs main.o common.o llist.o nlog.o ntsp.o
    nio.o sserver.o nhandler.o memwatch.o con_intersection.o emvmonitor.o
    gpio.o rsxmlparser.o
    g++: main.o: No such file or directory
    g++: common.o: No such file or directory
    g++: llist.o: No such file or directory
    g++: nlog.o: No such file or directory
    g++: ntsp.o: No such file or directory
    g++: con_intersection.o: No such file or directory
    g++: rsxmlparser.o: No such file or directory
    make: *** [prs] Error 1
    [/shell]
    And this is how my Makefile looks:
    [Makefile]
    BUILD_DIR=./build
    PROG=prs
    CFLAGS:=
    OBJS=main.o\
    common.o\
    llist.o\
    nlog.o\
    ntsp.o\
    nio.o\
    sserver.o\
    nhandler.o\
    memwatch.o\
    con_intersection.o\
    emvmonitor.o\
    gpio.o\
    rsxmlparser.o
    SRCS=main.c\
    common.c\
    llist.c\
    nlog.c\
    ntsp.c\
    nio.c\
    sserver.c\
    nhandler.c\
    memwatch.c\
    con_intersection.cpp\
    emvmonitor.cpp\
    gpio.c\
    rsxmlparser.cpp
    all:usage
    generic: CFLAGS += -s
    generic: prs
    genericv: CFLAGS += -DDEBUG -DMEMWATCH -DMEMWATCH_STDIO
    genericv: prs
    ttc: CFLAGS += -s -DTTC_PRS
    ttc: prs
    ttcv: CFLAGS += -DDEBUG -DMEMWATCH -DMEMWATCH_STDIO -DTTC_PRS
    ttcv: prs
    prs: $(OBJS)
    cd $(BUILD_DIR) && g++ $(CFLAGS) -pthread -o prs $(OBJS)
    %.o: %.c
    g++ $(CFLAGS) -I. -c $< -o $(BUILD_DIR)/$@
    %.o: %.cpp
    g++ $(CFLAGS) -I. -c $< -o $(BUILD_DIR)/$@
    clean:
    rm $(BUILD_DIR)/*
    [/Makefile]
    I have no clue what's going on, why can't it compile all source files/link
    them? They're all in a single directory.

    Thanks for help, I'm getting desperate here...
    Thanks!
    Ron
    --
    weeks of software enineering safe hours of planing

  2. Re: Makefile troubles

    Ron Eggler wrote:
    > Hi,
    >
    > I got seriopus troubles with my Makefile:
    > this is what it returns:
    > [...]
    > g++: main.o: No such file or directory
    > g++: common.o: No such file or directory


    Run your make command through 'strace -f' and see
    where it's actually looking for the missing files.

    HTH,
    - J.

+ Reply to Thread