OBJ = main.o gpio.o uart.o processing.o flightcontrol.o timer.o flowcam.o DEPS = main.h gpio.h uart.h types.h processing.h flightcontrol.h timer.h flowcam.h LIBS = CFLAGS = -std=c99 -Wall -export-dynamic -L/usr/lib/python2.7/config -lpython2.7 -lm -ldl -lutil -lpthread CC = gcc EXTENSION = .c #define a rule that applies to all files ending in the .o suffix, which says that the .o file depends upon the .c version of the file and all the .h files included in the DEPS macro. Compile each object file %.o: %$(EXTENSION) $(DEPS) $(CC) -c -o $@ $< $(CFLAGS) #Combine them into the output file #Set your desired exe output file name here all: ExPlat clean ExPlat: $(OBJ) $(CC) -o $@ $^ $(CFLAGS) $(LIBS) #Cleanup .PHONY: clean clean: rm -f *.o *~ core *~