2

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

sday
  • 1,041
  • 14
  • 22

2 Answers2

1

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.

Gil
  • 3,279
  • 1
  • 15
  • 25
  • Thanks for the clarification Gil. I can see the resource/speed implication in having the web server monitor all files and determining who they belong to. Do any of the big IDE's like eclipse have the ability to specify a master/root document such as the hello.c file to be automatically "touched" if a dependency is modified? I'm trying to figure out a good way to setup shop where forgetting to "touch" the root file doesn't become an issue when dealing with a large project. Thanks – sday Oct 22 '12 at 11:08
  • Eclipse indexes **all** the files, so it monitors everything. Keep in mind that this IDE is a CLIENT process (not a server). – Gil Oct 24 '12 at 15:20
0

I am also having this issue so I created a servlet to help me solve it. Using this I don't need to update every file on my CSP folder. I posted the code on my blog.

Update servlet_dependencies

The script just runs touch command on all files under CSP folder.

Richard Heath
  • 349
  • 3
  • 12