Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Makefile : Clock skew detected [duplicate]

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.

like image 967
Nadin Haddad Avatar asked Dec 06 '12 14:12

Nadin Haddad


3 Answers

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.

like image 159
sblob Avatar answered Oct 23 '22 16:10

sblob


As denoted in a comment by stijn the message "Clock skew detected" is most commonly given if compiling sources located on an NFS mount and the NFS server's clock runs ahead the client's clock doing the compilation.

like image 27
alk Avatar answered Oct 23 '22 15:10

alk


I saw this in Eclipse a couple of times as well when doing some work on one of the University computers here. My data drive was a network drive and the clock difference between the network drive and the local machine was off.

Switching my workspace to a location on the local machine (C drive) fixed the problem

like image 3
medge Avatar answered Oct 23 '22 17:10

medge