cconfigureg-wan

g-wan not updating dependencies of servlets


When I modify hello.c included with g-wan to include a simple header with #define TEST_VALUE 50 and output it in the hello.c file I noticed that a change to the header file did not trigger an update for g-wan to update the servlet. So if I change the header file test value to 51, no change is noted in the output. If I make any change to the hello.c file, it causes g-wan to recompile the servlet including the dependencies and the change in the header is compiled. Is this the expected behavior? I'm curious because that would mean during development with many dependencies, you would need to update just one character in the main servlet file to trigger a re-compile if all the changes being made are in dependency files.

This behavior was noted by Tim Bolton so I decided to also test it, and pose it as a separate question from a previous thread.

Thanks for any input.

G-WAN 3.3.28 64-bit (Mar 28 2012 11:24:16) - the latest version I saw in the download as of Oct 19th, 2012 ... running on Ubuntu Server 10.04.4 LTS - 64 bit


Solution

  • Is this the expected behavior?

    Yes.

    that would mean during development with many dependencies, you would need to update just one character in the main servlet file to trigger a re-compile if all the changes being made are in dependency files.

    No. There's a better way used by programmers for (at least) the past 30 years.

    The touch Unix command is updating the time stamp of a file without changing its contents.

    Just touch the hello.c servlet when you change its headers.

    Also note that C headers are supposed to be more 'stable' than C files. What is stored in headers is there to be shared by many C files so you should consider to use C files for defines that change often.

    At least you know how to proceed in both cases now.