# -*- makefile -*- # example makefile for building a PF plugin. # this assumes libpf is installed and accessible through pkg-config. # this could mean you need to properly set the PKG_CONFIG_PATH variable. # one or more source files SOURCES = hello.c # plugin filename TARGET = hello.pfo ################# build rules ################ .PHONY: plugin clean plugin: $(TARGET) CFLAGS = `pkg-config libpf --cflags` LIBS = `pkg-config libpf --libs` # FIXME: use Makefile.defs LDFLAGS = -shared # object file %.o: %.c $(CC) $(CFLAGS) $(OPT_CFLAGS) -o $@ -c $< # dependency %.d: %.c $(CC) -M $(CFLAGS) $< > $@.$$$$; \ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ -include $(SOURCES:.c=.d) objects = $(SOURCES:.c=.o) # build target $(TARGET): $(objects) $(CC) $(LIBS) $(LDFLAGS) $(objects) -o $@ clean: rm -f *~ *.o *.pfo *.d