SHELL = /bin/sh SRCDIR = . CC = gcc YACC = bison -y CDEBUG = -g COMPLIANCE_FLAGS = CFLAGS = $(COMPLIANCE_FLAGS) $(CDEBUG) INCLUDES = -I. -I$(SRCDIR) $(shell pkg-config --cflags gstreamer-0.10) LDFLAGS = -g LIBRARIES = -L. -L/usr/gnueabihf/lib $(shell pkg-config --libs gstreamer-0.10) -lm ##################################################################################################### # List your sources here. SOURCES = testcode.c ##################################################################################################### ##################################################################################################### # list the name of your output program here. EXECUTABLE = camera ##################################################################################################### # Create the names of the object files (each .c file becomes a .o file) OBJS = $(patsubst %.c, %.o, $(SOURCES)) include $(SOURCES:.c=.d) all : $(OBJS) $(EXECUTABLE) $(EXECUTABLE) : $(OBJS) $(CC) -o $(EXECUTABLE) $(OBJS) $(LIBRARIES) %.o : %.c #Defines how to translate a single c file into an object file. echo compiling $< echo $(CC) $(CFLAGS) $(INCLUDES) -c $< $(CC) $(CFLAGS) $(INCLUDES) -E $< > $<.preout $(CC) $(CFLAGS) $(INCLUDES) -S $< $(CC) $(CFLAGS) $(INCLUDES) -c $< echo done compiling $< %.d : %.c #Defines how to generate the dependencies for the given files. @set -e; rm -f $@; \ $(CC) $(COMPLIANCE_FLAGS ) $(INCLUDES) -M $< > $@.$$$$; \ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ clean : # Delete any and all artifacts from the build. rm -f *.o rm -f *.preout rm -f *.s rm -f *.S rm -f *d rm -f $(EXECUTABLE)