my makefile:

DRIVER_SRC = PumaDriver.cpp PumaBody.cpp PumaMotor.cpp base_manipulation.cpp serialPort.cpp
DRIVER_INC = PumaDriver.h PumaBody.h PumaMotor.h base_manipulation.h serialPort.h silvermax_commands.h

All: $(DRI_SRC) $(DRI_INC)
        g++ -Wall -Wextra -g3 -fpic `pkg-config --cflags playercore` -c $(DRIVER_SRC)
        g++ -Wall -Wextra -nostartfiles -shared -rdynamic -o libPumaMotorDriver.so PumaDriver.o PumaBody.o PumaMotor.o serialPort.o base_manipulation.o

       
       
install:
        cp *.so /usr/local/lib

uninstall:
        rm -f *.o *.so
        rm /usr/local/lib/libPumaMotorDriver.so

clean:
        rm -f *.o *.so

This makefile is not properly creating the .so file. How do I write a makefile that works with all my dependencies. The dependencies: The driver file is PumaDriver.cpp and it includes PumaDriver.h. PumaDriver.h also includes PumaBody.h. PumaBody.cpp includes PumaBody.h. PumaBody.h includes PumaMotor.h. PumaMotor.cpp includes PumaMotor.h. PumaMotor.h includes serialPort.h, base_manipulation.h, silvermax_commands.h. serialPort.cpp includes serialPort.h. base_manipulation.cpp includes base_manipulation.h.

Thanks for the help.
willydlw

> All: $(DRI_SRC) $(DRI_INC)
Check the spelling of your dependencies perhaps?

Thanks, but I have tried it with All: $(DRIVER_SRC) $(DRIVER_INC) and still have the same errors. I think it pretty much ignores the target and dependencies.

All is traditionally 'all' (lower case)

Try make --help
Then find out the debug flag, then try
make -D
to see what make is actually doing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.