Makefile : Clock skew detected

Nadin Haddad picture Nadin Haddad · Dec 6, 2012 · Viewed 58.8k times · Source

My problem is whenever I try to compile using Makefile I get the following :

make: Warning: File `Board.c' has modification time 1.3e+03 s in the future
gcc -Wall -c -Wvla -lm Board.c -o Board.o
gcc -Wall -c -Wvla -lm PlayBoard.c -o PlayBoard.o
gcc -lm ErrorHandle.o Board.o PlayBoard.o -g -o PlayBoard
make: warning:  Clock skew detected.  Your build may be incomplete.

My Makefile is :

CC = gcc
FLAGS = -Wall -c -Wvla

PlayBoard: ErrorHandle.o Board.o PlayBoard.o
    $(CC) -lm ErrorHandle.o Board.o PlayBoard.o -g -o $@

PlayBoard.o: PlayBoard.c Board.o
    $(CC) $(FLAGS) -lm PlayBoard.c -o $@

Board.o : ErrorHandle.o Board.c Board.h
    $(CC) $(FLAGS) -lm Board.c -o $@

.PHONY : clean

clean:
    rm -f Board.o PlayBoard.o PlayBoard

all : PlayBoard

Thank you for your help.

Answer

sblob picture sblob · Sep 26, 2013

A possible solution is to touch every file in the source tree in order to update time-stamps:

Go to the root of the sub-tree an do:

find . -exec touch {} \; 

Then make clean and retry compilation.