I changed my code and recompiled with gcc/makefile, but nothing changed???
I suspected this was happening (its happened before), so I modified the following line of code in input.c:
Code:
else{printf("Invalid Command!");}
to
I then removed all the .o files, including input.o, as well as the compiled .exe
Code:
x:
rm c c.exe main.o input.o main input check4check.o makemove.o dangergenerator.o printdangerboard.o absolutepins.o convertfen.o printboard.o countpieces.o pawnmoves.o bishopmoves.o rookmoves.o knightmoves.o queenmoves.o kingmoves.o createmove.o displaymoves.o
and I verified everything was removed from my directory except for the .c and .h files
I then recompiled my program and ran it, and the output wasn't changed at all, because it still says "Invalid command!" -- how is this happening? I am changing and saving the .c file and recompiling, and it is using the old code that as far as I can tell should no longer exist anywhere. This makes it impossible to debug since I can't actually change the code. The .c file has definitely changed, but it is clearly not actually recompiling input.c, and somehow it is reusing the old code that I've deleted.
Here is my makefile:
Code:
c: main.o input.o check4check.o makemove.o dangergenerator.o printdangerboard.o absolutepins.o convertfen.o printboard.o countpieces.o pawnmoves.o bishopmoves.o rookmoves.o knightmoves.o queenmoves.o kingmoves.o createmove.o displaymoves.o
gcc -g main.o input.o check4check.o makemove.o dangergenerator.o printdangerboard.o absolutepins.o convertfen.o printboard.o countpieces.o pawnmoves.o bishopmoves.o rookmoves.o knightmoves.o queenmoves.o kingmoves.o createmove.o displaymoves.o -o c
main.o: main.c header.h
input.o: input.c header.h
convertfen.o: convertfen.c header.h
printboard.o: printboard.c header.h
countpieces.o: countpieces.c header.h
pawnmoves.o: pawnmoves.c header.h
bishopmoves.o: bishopmoves.c header.h
rookmoves.o: rookmoves.c header.h
knightmoves.o: knightmoves.c header.h
queenmoves.o: queenmoves.c header.h
kingmoves.o: kingmoves.c header.h
createmove.o: createmove.c header.h
displaymoves.o: displaymoves.c header.h
absolutepins.o: absolutepins.c header.h
dangergenerator.o: dangergenerator.c header.h
printdangerboard.o: printdangerboard.c header.h
makemove.o: makemove.c header.h
check4check.o: check4check.c header.h
x:
rm c c.exe main.o input.o main input check4check.o makemove.o dangergenerator.o printdangerboard.o absolutepins.o convertfen.o printboard.o countpieces.o pawnmoves.o bishopmoves.o rookmoves.o knightmoves.o queenmoves.o kingmoves.o createmove.o displaymoves.o
xx:
rm c