2

I'm trying to modify some C++ files in ns2 and then recompile using make command. Although new .o file is created after make, the output is similar to that of previous C++ file (before modifying). Can someone suggest what may be the reason behind it?

2
  • What sort of changes were you making? A make file is only as good as the dependencies it encodes. So for example if you were making changes to inlined functions in a header and the files that included it weren't recompiled, then that might explain what you're seeing. Apr 8, 2011 at 1:35
  • 4
    Try using: make clean before make. This removes the old .o files and creates new ones. So you completely recompile it.
    – omnidan
    Apr 10, 2011 at 16:07

1 Answer 1

1

Are you modifying .cpp (or .C .cc etc.) files or header files? Some Makefiles are written very poorly and don't have decent dependency information (gcc -MMD or makedepend). This means the project is not rebuild correctly if you modify some files (often header files). You can check what files are triggered by modification (and why) with the command:

make --debug=b -n

You must log in to answer this question.