However it happens only on Windows 7. On Windows XP once it built and intact, no more builds.
I narrowed down the issue to one prerequisite - $(jar_target_dir)
.
Here is part of the code
# The location where the JAR file will be created.
jar_target_dir := $(build_dir)/chrome
# The main chrome JAR file.
chrome_jar_file := $(jar_target_dir)/$(extension_name).jar
# The root of the JAR sources.
jar_source_root := chrome
# The sources for the JAR file.
jar_sources := bla #... some files, doesn't matter
jar_sources_no_dir := $(subst $(jar_source_root)/,,$(jar_sources))
$(chrome_jar_file): $(jar_sources) $(jar_target_dir)
@echo "Creating chrome JAR file."
@cd $(jar_source_root); $(ZIP) ../$(chrome_jar_file) $(jar_sources_no_dir)
@echo "Creating chrome JAR file. Done!"
$(jar_target_dir): $(build_dir)
echo "Creating jar target dir..."
if [ ! -x $(jar_target_dir) ]; \
then \
mkdir $(jar_target_dir); \
fi
$(build_dir):
@if [ ! -x $(build_dir) ]; \
then \
mkdir $(build_dir); \
fi
so if I just remove $(jar_target_dir)
from $(chrome_jar_file)
rule, it works fine.
UPD:
Here is the basic debug output from make on Windows 7
Reading makefiles...
Updating goal targets....
File `all' does not exist.
Prerequisite `../bin/build/chrome' is newer than
target `../bin/build/chrome/alt.jar'.
Must remake target `../bin/build/chrome/alt.jar'.
Creating chrome JAR file.
updating: content/about.js (deflated 66%)
updating: content/sprintf.js (deflated 52%)
...
and stats
$ stat ../bin/build/chrome/alt.jar ../bin/build/chrome
File: `../bin/build/chrome/alt.jar'
Size: 29220 Blocks: 32 IO Block: 65536 regular file
Device: 22c6affh/36465407d Inode: 59672695062724268 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ acid) Gid: ( 513/ None)
Access: 2010-05-05 13:03:01.066457300 +0900
Modify: 2010-05-05 13:03:01.088960100 +0900
Change: 2010-05-05 13:03:01.091460400 +0900
File: `../bin/build/chrome'
Size: 0 Blocks: 0 IO Block: 65536 directory
Device: 22c6affh/36465407d Inode: 3940649674014457 Links: 1
Access: (0755/drwxr-xr-x) Uid: ( 1000/ acid) Gid: ( 513/ None)
Access: 2010-05-05 13:03:01.090960400 +0900
Modify: 2010-05-05 13:03:01.090960400 +0900
Change: 2010-05-05 13:03:01.090960400 +0900
as you can see chrome
dir is really newer than alt.jar
SOL: Like Eric mentioned, it was bad idea to have directory prerequisite and make production file inside of it. Each time the mtime is updated hence 'need to rebuild'. This part is clear. However, for some cases the timestamps of directory and file created inside are always equal. That's confusing...