 <pre><code>CC=gcc CPPFLAGS=-I include VPATH=src include main: main.o method1.o method2.o method3.o method4.o -lm $(CC) $^ -o $@ main.o: main.c main.h $(CC) $(CPPFLAGS) -c $&lt; method1.o: method1.c $(CC) $(CPPFLAGS) -c $&lt; method2.o: method2.c $(CC) $(CPPFLAGS) -c $&lt; method3.o: method3.c $(CC) $(CPPFLAGS) -c $&lt; method4.o: method4.c $(CC) $(CPPFLAGS) -c $&lt; </code></pre> <p>it worked like this</p>