ex: Add makefile to build examples from installed lib

Change-Id: I10a51dfe90e0672bb33348de241a5be91c9caa37
Signed-off-by: Greg Tucker <greg.b.tucker@intel.com>
This commit is contained in:
Greg Tucker 2021-06-03 17:53:20 -07:00
parent 0f7bf1c04d
commit 628f4e91ea
2 changed files with 24 additions and 8 deletions

24
examples/ec/Makefile Normal file
View File

@ -0,0 +1,24 @@
# Build examples from installed lib
include Makefile.am
incdir = $(shell pkg-config --variable=includedir libisal)
CFLAGS += -include $(incdir)/isa-l.h # Add standard header
CFLAGS += -I $(incdir)/isa-l # Add path to remove error
LDFLAGS = $(shell pkg-config --libs libisal)
progs = $(notdir $(examples))
ex: $(progs)
run: $(addsuffix .run,$(progs))
$(progs): % : %.c
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
$(addsuffix .run,$(progs)): %.run : %
./$<
@echo Completed run: $<
clean:
$(RM) $(progs)

View File

@ -1,8 +0,0 @@
default: ex
include ../../erasure_code/Makefile.am
include Makefile.am
include ../../make.inc
VPATH = . ../../erasure_code ../../include