makefiles

hi, i am trying to do a makefile i have done most of the things they want except this question: A custom rule that lists all file dependencies for all .cpp files in the practical 3 folder. I tried using echo i thought that would help but it doesnt and i tried using print, it also doesnt work. So does any 1 have an idea how you could do this.

The file dependencies are:
Motorbikes.cpp: Motorbikes.h
Vans.cpp: Vans.h
Trucks.cpp: Trucks.h
mainProgram.cpp: Motorbikes.h Vans.h Trucks.h

1
2
echo:
    $(OBJECTS)


i found this on the internet
1
2
3
4
     print: *.h
             lpr -p $?
             touch print


Your help will be highly appreciated.
Last edited on
actual dependencies of mainProgram: Motorbikes.cpp Vans.cpp Trucks.cpp
If you do what you wrote, when you change Motorbikes.cpp, it will not recompile your program.
Topic archived. No new replies allowed.