Forums

Make problem

  • Hello!

    I have a strange problem right now.

    When compiling an application (in $DEVDIR/my_apps/MyAPP) I used to simply run make.

    Looking at the Makefile, there is an install instruction which should cause my application to be copied

    to $(FSROOT)/examples.

    I have tried to find where FSROOT is defined and found out that it is in bsp/Make.defs. Make.defs is included by

    bsp/Mach/Make.conf, and this latter is included by the Makefile itself. So $(FSROOT) should be known.

    Beside this, I verified that the install instruction works (I removed my application from fs/fs/examples and

    ran the install instruction inside of $DEVDIR/my_apps/MyApp . MyApp appears in $DEVDIR/fs/fs/examples.

    But when I run make from $DEVDIR/my_apps/MyApp, it does not install the application.

    Does anyone know what may have happened? It used to work, and I didn't modify the Makefile.

     

    Thanks,

     

    Pascal

     

  • Hi,

    I assume your Makefile looks like this:

    #

    # myapps/hello/Makefile

    #

    .PHONY: build chkconfig preconfig buildfs install clean

    ifeq ($(DEVDIR),)

    $(error ====== DEVDIR variable is empty, invoke this Makefile from the BSP root, or provide the path to it =====)

    endif

    include $(DEVDIR)/bsp/mach/Make.conf

    BIN = hello

    SRCS = $(BIN).c

    OBJS = $(SRCS:.c=.o)

    CFLAGS += $(EXTRA_CFLAGS)

    ifeq ($(CONFIG_USER_APPS_HELLO),y)

    build:

    $(V)$(CC) -c $(CFLAGS) $(SRCS) -o $(OBJS) $(QOUT)

    $(V)$(CC) $(LDFLAGS) -o $(BIN) $(OBJS) $(QOUT)

    sim:

    chkconfig:

    preconfig:

    buildfs:

    install:

    $(V)install -D -m 755 $(BIN) $(FSROOT)/examples/$(BIN) $(QOUT)

    clean:

    $(V)rm -f $(BIN) *.debug *.o core *~ $(QOUT)

    else

    build:

    sim:

    chkconfig:

    preconfig:

    buildfs:

    install:

    clean:

    endif

     

    If so, you can add a target like this:

    all: build install

    just after

    ifeq ($(CONFIG_USER_APPS_HELLO),y)

    Regards

    Pablo

    Pablo Barrantes
    Embedded Software Engineer
    RidgeRun

  • Did you try

    make install

    ?

  • Hello Pablo!

    Thanks for your reply.

    The problem is that the line beginning by all: already includes install.

    The line is like this:

    all: clean build install

    clean, build and install tags do exist.

    To Todd:

    Yes, I have tried make install:

    1. I have verified that my application exec code is not in fs/fs/examples (so that install has to do something)

    2. I have run make install, and it replies "nothing to be done for install".

    If I take the install line and run it from the terminal:

    install -D -m 755 myapp $DEVDIR/fs/fs/examples/myapp

    then it installs fine.

    That's why I was suspecting an environment variable missing, But FSROOT is defined in

    Make.defs which is included by Make.conf which is included at the beginning of the Makefile.

    So the line $(V)install -D -m 755 $(BIN) $(FSROOT)/examples/$(BIN) $(QOUT)

    should just work fine, but it does not.

    Any hint is welcome.

    Pascal

  • Hi all,

    I have created one .cpp application and my Makefile looks like:

    .PHONY: build chkconfig preconfig buildfs install clean

    ifeq ($(DEVDIR),)

    $(error ====== DEVDIR variable is empty, invoke this Makefile from the BSP root, or provide the path to it =====)

    endif

    include $(DEVDIR)/bsp/mach/Make.conf

    #CC=g++

    #CFLAGS= -g -Wall -DVP_LINUX -fno-stack-protector

    CFLAGS += $(EXTRA_CFLAGS)

    OBJECTS= ComPortIO.o NMEAParser.o GPSInfo.o RFInfo.o

    BIN= com

    # --- targets

    all:    com

    com:ComPortIO.h ComPortIO.cpp main.cpp $(OBJECTS)

           $(CXX) $(CFLAGS) -o com $(OBJECTS) main.cpp

    ComPortIO.o:     ComPortIO.cpp ComPortIO.h

           $(CXX) $(CFLAGS) -c ComPortIO.cpp

    NMEAParser.o:    NMEAParser.cpp NMEAParser.h

           $(CXX) $(CFLAGS) -c NMEAParser.cpp

    GPSInfo.o:       GPSInfo.cpp GPSInfo.h

           $(CXX) $(CFLAGS) -c GPSInfo.cpp

    RFInfo.o:        RFInfo.cpp RFInfo.h

           $(CXX) $(CFLAGS) -c RFInfo.cpp          

    sim:

    chkconfig:

    preconfig:

    buildfs:

    install:

           install -D -m 755 $(BIN) $(DEVDIR)/fs/fs/examples/$(BIN)

    # --- remove binary and executable files

    clean:

           rm -f com

           rm -f ComPortIO.o

           rm -f NMEAParser.o

    #-fopenmp

    I can build this application alone,but when I m trying to make it from DEVDIR build error is comming nd showing messge tht 'com' file is not generated. means problem in building my application.

    pls help me out

  • The SDK build system uses the target 'build', try

    all build:    com