/ View Ticket
Ticket UUID: 92bd6eaf04e11711f14cb8b3bebb615ae0267550
Title: Suggestion to revise clean rule in main.mk.
Status: Closed Type: Build_Problem
Severity: Cosmetic Priority: Immediate
Subsystem: Makefile Resolution: Fixed
Last Modified: 2011-10-31 18:44:47
Version Found In: 3.6.17
On Cygwin and MinGW, second rebuld by using main.mk will be faild.
$ make -f Makefile.linux-gcc libsqlite3.a
    (The first building will suceed.)
$ make -f Makefile.linux-gcc clean
$ make -f Makefile.linux-gcc libsqlite3.a
    (The second rebuilding will failed.)
gcc -g -O2 -o mkkeywordhash -DNDEBUG=1 -
DHAVE_FDATASYNC=1 ../sqlite/tool/mkkeywordhash.c
./mkkeywordhash >keywordhash.h
cp ../sqlite/src/parse.y .
rm -f parse.h
./lemon -DNDEBUG=1 -DHAVE_FDATASYNC=1 parse.y
Can't open the template file "lempar.c".
make: *** [parse.c] Error 1
$ rm lemon.exe mkkeywordhash.exe 
$ make -f Makefile.linux-gcc libsqlite3.a
    (Rebuilding will suceed.)

When you read, please replace ``foo'' to ``lemon'' or ``mkkeywordhash''. On Cygwin and MinGW, foo.exe will be generated by following rule.

foo: foo.c
	$(CC) -o $@ $<

But, following ``clean'' rule can not delete foo.exe.

	$(RM) foo

So, I suggest to revise some rules for executable files as following.

foo$(EXE): foo.c
	$(CC) -o $@ $<

	$(RM) foo$(EXE)